These are chat archives for FreeCodeCamp/Help

19th
Aug 2015
Justin Dieter
@JDieter12
Aug 19 2015 00:10
If there are any Mac users, can you guys recommend any sources to learn keyboard shortcuts? I'd like to be able to navigate Atom without a mouse, just a keyboard. I found myself manually removing tab spaces on multiple lines, and it took forever. I need to work on my mouseless workflow, a lot.
SojournerOctocat
@SojournerOctocat
Aug 19 2015 00:10
@JDieter12 There's an app named KeyCue that you might check out.
Marie Pelletier
@Marie000
Aug 19 2015 00:16
  anyone else working on the jQuery section? Are you getting any bugs? (correct code not passing) 
DTing
@dting
Aug 19 2015 00:20
@Marie000 a lot of that section is checked using regex. Make sure you follow the instructions exactly.
@Marie000 don't add extra spaces.
Ryan Malm
@Rybar
Aug 19 2015 00:21
G.Enemy = function(){
G.Entity.call(this);
} //so far so good...
G.Enemy.prototype = Object.create(G.Entity.prototype);
G.Enemy.prototype.constructor = G.Enemy;

var enemy = new G.Enemy();

G.Enemy.prototype.update = function() {console.log('enemy updating')}  //

enemy.update()  // returns 'enemy updating'.
This works, thanks @crisberrios and @dting, both suggestions were part of the issue
CamperBot
@camperbot
Aug 19 2015 00:21
rybar sends brownie points to @crisberrios and @dting :sparkles: :thumbsup: :sparkles:
:star: 149 | @crisberrios | http://www.freecodecamp.com/crisberrios
:star: 329 | @dting | http://www.freecodecamp.com/dting
Cristián Berríos
@crisberrios
Aug 19 2015 00:23
@Rybar but enemy prototype is Entity prototype, try creating an entity and using update()
Angel Jimenez
@aJimmer
Aug 19 2015 00:27
this whole update thing is a little confusing. Are people going back and completing everything again or is everyone just continuing where they left off
SojournerOctocat
@SojournerOctocat
Aug 19 2015 00:29
@Solerxnaut I can't even login!
Angel Jimenez
@aJimmer
Aug 19 2015 00:30
I had that issue yesterday but i was able to login using github
Clayton
@cjg040103
Aug 19 2015 00:30
Anybody know why it keeps saying I need the #left-well element to have a red background, even though it has one on the results screen before i say its a bug?
This message was deleted
<script>
  $(document).ready(function() {
    $("#target1").css("color", "red");
    $("#target1").prop("disabled", true);
    $("#target4").remove();
    $("#target2").appendTo("#right-well");
    $("#target5").clone().appendTo("#left-well");
    $("#left-well").parent().css("background-color", "red")

  });
</script>

<!-- You shouldn't need to modify code below this line -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <h4>#left-well</h4>
      <div class="well" id="left-well">
        <button class="btn btn-default target" id="target1">#target1</button>
        <button class="btn btn-default target" id="target2">#target2</button>
        <button class="btn btn-default target" id="target3">#target3</button>
      </div>
    </div>
    <div class="col-xs-6">
      <h4>#right-well</h4>
      <div class="well" id="right-well">
        <button class="btn btn-default target" id="target4">#target4</button>
        <button class="btn btn-default target" id="target5">#target5</button>
        <button class="btn btn-default target" id="target6">#target6</button>
      </div>
    </div>
  </div>
</div>
Angel Jimenez
@aJimmer
Aug 19 2015 00:32
try <h4 id = "left-well"
and put #left-well in your <style>
Clayton
@cjg040103
Aug 19 2015 00:33
I'm an idiot
Angel Jimenez
@aJimmer
Aug 19 2015 00:33
live and learn
Clayton
@cjg040103
Aug 19 2015 00:33
i think...
nope
Max
@MaxRubyDev
Aug 19 2015 00:34
@Solerxnaut my map is working fine, so far... Just really slow updating. And my screens (code section especially) is so slow I just might log off. Only been on <10 minutes and haven't been able to complete a single one.
Clayton
@cjg040103
Aug 19 2015 00:35
<script>
  $(document).ready(function() {
    $("#target1").css("color", "red");
    $("#target1").prop("disabled", true);
    $("#target4").remove();
    $("#target2").appendTo("#right-well");
    $("#target5").clone().appendTo("#left-well");
    $("#left-well").parent().css("background-color", "red")

  });
</script>

<!-- You shouldn't need to modify code below this line -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <h4 id="#left-well">#left-well</h4>
      <div class="well" id="left-well">
        <button class="btn btn-default target" id="target1">#target1</button>
        <button class="btn btn-default target" id="target2">#target2</button>
        <button class="btn btn-default target" id="target3">#target3</button>
      </div>
    </div>
    <div class="col-xs-6">
      <h4>#right-well</h4>
      <div class="well" id="right-well">
        <button class="btn btn-default target" id="target4">#target4</button>
        <button class="btn btn-default target" id="target5">#target5</button>
        <button class="btn btn-default target" id="target6">#target6</button>
      </div>
    </div>
  </div>
</div>
Max
@MaxRubyDev
Aug 19 2015 00:36
The hard part is, I know most of this segment already, just want to complete each waypoint in succession and get through it already! Where can we see some updates, an ETA or something?
Angel Jimenez
@aJimmer
Aug 19 2015 00:38
< h4 id = "left-well">
yea i might put FCC away for a couple of days and come back in hopes of it having cleared up a little
Clayton
@cjg040103
Aug 19 2015 00:41
aaaaand... I reported it as a bug.
oh well... l8r
DTing
@dting
Aug 19 2015 00:43
@cjg040103
$('#target1').parent().css("background-color", "red");
not
$('#left-well').parent().css("background-color", "red");
you made the left-well element's parent's background red
Jelani Thompson
@JelaniThompson
Aug 19 2015 00:48
Hey guys
Working on a program I was doing yesterday
Does anyone know why this isn't doing what it's intended to do?
It's supposed to print whatever you type in the text box to the screen, but it isn't working
Does anyone know why?
It should show you the code when you're in CodePen
Joris Labie
@labiej
Aug 19 2015 00:54
@JelaniThompson you are mixing regular javascript and jQuery
I think at least
DTing
@dting
Aug 19 2015 00:54

@JelaniThompson

//Making a program that copies memes to your clipboard
//Look for Clipboard.js on GitHub

var dictionary = {
  "gimme": "༼ つ ◕_◕ ༽つ",
  "umadbro": "¯\_(ツ)_/¯",
  "lenny": "( ͡° ͜ʖ ͡°)"
}

function checkCharacter() {
  //Assign $ascii_box variable to ascii-box element
  var $ascii_box = $("#ascii-box");

  //Update value of $ascii_box_value everytime the text field changes
  $ascii_box.on("input", function() {
    var $ascii_box_value = $(this).val();
    if (dictionary.hasOwnProperty($ascii_box_value)) {
      document.write(dictionary[$ascii_box_value]);
    }
  });
}
checkCharacter();

The way yo have it now your on callback function doesnt do anything other than set a variable.

Max
@MaxRubyDev
Aug 19 2015 00:54
Is anyone else having trouble waiting / getting the code box to populate in the Waypoints?
I've been on for nearly 30 minutes now and waiting for >5 minutes for this dang code box to load. I can type stuff into it but it doesn't load with the unedited code (e.g., cat.jpg). So, I can't complete the waypoint and continue to the next one.
DTing
@dting
Aug 19 2015 00:57
@MaxRubyDev no problems here
Max
@MaxRubyDev
Aug 19 2015 00:58
Ok. P.S. I'm downloading Chrome for iOS now, hoping that somehow that will help. 25% downloaded now, see you in another half hour.
Jelani Thompson
@JelaniThompson
Aug 19 2015 01:02
@dting Ah OK! Was the code itself all right though? Like the logic side of things
Also here's some karma lol
Thanks! @dting
CamperBot
@camperbot
Aug 19 2015 01:02
jelanithompson sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 333 | @dting | http://www.freecodecamp.com/dting
Max
@MaxRubyDev
Aug 19 2015 01:04
Yeah thanks @dting
CamperBot
@camperbot
Aug 19 2015 01:04
maxrubydev sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 334 | @dting | http://www.freecodecamp.com/dting
HayleeNeal
@HayleeNeal
Aug 19 2015 01:07

Hey everyone. I'm in jQuery and I could use some help. here's the task Your #target1 element should have the classes animated‚ shake and btn-primary.

and here's my code. Where did I go wrong. I've been stuck for like 30 minutes.
```

Joris Labie
@labiej
Aug 19 2015 01:08
@JelaniThompson almost, as you see he had to move the search-part (with hasOwnProperty) inside the anonymous function
HayleeNeal
@HayleeNeal
Aug 19 2015 01:08
 $(document).ready(function() {
$("button").addClass("animated")
$(".btn").addClass("shake")
$("#target1").addClass("btn primary")
  });
Joris Labie
@labiej
Aug 19 2015 01:08
semi-colons make a difference?
Max
@MaxRubyDev
Aug 19 2015 01:08
Testing markdown here, ignore if you like
woo-hoo, I got italics!
Joris Labie
@labiej
Aug 19 2015 01:09
I cannot ignore that
HayleeNeal
@HayleeNeal
Aug 19 2015 01:09
nope @labiej
SojournerOctocat
@SojournerOctocat
Aug 19 2015 01:09
@HayleeNeal What's the URL/link?
Joris Labie
@labiej
Aug 19 2015 01:10
btn-primary
last class has a typo ;-)
SojournerOctocat
@SojournerOctocat
Aug 19 2015 01:11
Those darn dashes!
HayleeNeal
@HayleeNeal
Aug 19 2015 01:11
That fixed it. I can't believe it was one silly typo that tripped me up for so long. Thanks so much!
CamperBot
@camperbot
Aug 19 2015 01:11
if you want to thank someone, put an @ before their name!
Joris Labie
@labiej
Aug 19 2015 01:12
typo's are the worst xD
alnano
@alnano
Aug 19 2015 01:17
ok, let me ask this question in this room. nth-child targets all child elements ?
no matter where its located?
Joris Labie
@labiej
Aug 19 2015 01:18
@alnano example?
alnano
@alnano
Aug 19 2015 01:21
so in jquery chapter 15 , it tells me to target the "well " second child. To do this i type (".target:nth-child(2)"). How did it know i wanted to target the well nth child?
Joris Labie
@labiej
Aug 19 2015 01:22
You agree html can be written in tree-like way if you want?
alnano
@alnano
Aug 19 2015 01:22
ok
Joris Labie
@labiej
Aug 19 2015 01:23
<div class="container">
     <div class="left">

     </div>
     <div  class="right">

     </div>
</div>
How many childs does container have?
alnano
@alnano
Aug 19 2015 01:23
2
Joris Labie
@labiej
Aug 19 2015 01:24
Now if I add a few buttons in each of those children
How many children does container have now?
alnano
@alnano
Aug 19 2015 01:24
2?
Joris Labie
@labiej
Aug 19 2015 01:24
Indeed
The children are direct descendants if you like
If you envision it as a tree it's easier to see
alnano
@alnano
Aug 19 2015 01:26
how does it know what children i am trying to target though? if "left" had a 2 buttons in it, then the class" Left" would have 2 children? how would i target "left" number 2 children ?
Joris Labie
@labiej
Aug 19 2015 01:27
This message was deleted
By using a new jQuery selector
$('.left')
alnano
@alnano
Aug 19 2015 01:29
yea i thought so, because in jquery15, i have to type out $(".target")
should i not instead do $(".well")
to target the "well" Class
Max
@MaxRubyDev
Aug 19 2015 01:33
In case anyone cares to know, my problem "waiting" for the black code box to populate was solved by downloading Chrome for iOS! (Was using Safari.). Thanks again @benmcmahon100 for the suggestion!
CamperBot
@camperbot
Aug 19 2015 01:33
maxrubydev sends brownie points to @benmcmahon100 :sparkles: :thumbsup: :sparkles:
:warning: maxrubydev already gave benmcmahon100 points
alnano
@alnano
Aug 19 2015 01:34
ill just move on
alnano
@alnano
Aug 19 2015 01:41
nvm, i figured it out\
Steven Young
@ShelbyGT
Aug 19 2015 01:41
 Math.floor(Math.random() * (3 - 1 + 1)) + 1;
     slotOne[];
    Math.floor(Math.random() * (3 - 1 + 1)) + 1;
     slotTwo[];
   Math.floor(Math.random() * (3 - 1 + 1)) + 1;
     slotThree[];
hellllpppp
lol
HayleeNeal
@HayleeNeal
Aug 19 2015 01:45
$("#left-well").parent().css("background-color", "red");
This is how you set a parent element 's css using jQuery? Or did I miss something?
Steven Young
@ShelbyGT
Aug 19 2015 01:46
looks right to me
HayleeNeal
@HayleeNeal
Aug 19 2015 01:48
It's saying it's wrong. I don't understand :(
Steven Young
@ShelbyGT
Aug 19 2015 01:50
what browser are you using
HayleeNeal
@HayleeNeal
Aug 19 2015 01:52
Chrome
Fani H
@goslingparade
Aug 19 2015 01:53
Oh HayleeNeal, are you working on Waypoint: Target a Specific Child of an Element Using jQuery"?
I figured it out if you're wondering :)
Billy Goodson
@B-Goodson
Aug 19 2015 01:53
Is there any way to include a large amount of space in HTML? I've been linking 7 or 8 <br> is there a better way?
Fani H
@goslingparade
Aug 19 2015 01:53
I wrote "$(".well:nth-child(2)").children().addClass("animated bounce");"
@B-Goodson you can always make a div and give it a width and height
Billy Goodson
@B-Goodson
Aug 19 2015 01:54
ahh okay thanks @goslingparade
CamperBot
@camperbot
Aug 19 2015 01:54
b-goodson sends brownie points to @goslingparade :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for goslingparade
HayleeNeal
@HayleeNeal
Aug 19 2015 01:54
@goslingparade target the parent element
Steven Young
@ShelbyGT
Aug 19 2015 01:54
@HayleeNeal I have heard of other people have issues using chrome,,I use firefox and dont have that issue
just a thought
HayleeNeal
@HayleeNeal
Aug 19 2015 01:55
This is the first one I found. I even sent a screenshot to my friend who is a full stack developer and he says it looks right. it's most likely a bug
Steven Young
@ShelbyGT
Aug 19 2015 01:56
probably
Fani H
@goslingparade
Aug 19 2015 01:57
Have you tried targeting "#target1" instead of "#left-well"?
HayleeNeal
@HayleeNeal
Aug 19 2015 01:58
Well, it accepted that. So weird because it said to select the left well id.
Joris Labie
@labiej
Aug 19 2015 02:01
it didn't say that
read carefully
it says to give #left-well a red background
now div around it is red (hence the red background for the <h4>#left-well</h4>
Steven Young
@ShelbyGT
Aug 19 2015 02:03
PLEASE help
 Math.floor(Math.random() * (3 - 1 + 1)) + 1;
     slotOne[];
    Math.floor(Math.random() * (3 - 1 + 1)) + 1;
     slotTwo[];
   Math.floor(Math.random() * (3 - 1 + 1)) + 1;
     slotThree[];
Joris Labie
@labiej
Aug 19 2015 02:04
@ShelbyGT slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
Steven Young
@ShelbyGT
Aug 19 2015 02:05
ahhh for real,,,i freakin knew i was over thinking it
Thanks @labiej
CamperBot
@camperbot
Aug 19 2015 02:05
shelbygt sends brownie points to @labiej :sparkles: :thumbsup: :sparkles:
:star: 306 | @labiej | http://www.freecodecamp.com/labiej
Joris Labie
@labiej
Aug 19 2015 02:06
Keep going, learning a new language always takes some getting used to
Cordoba84
@fcordoba84
Aug 19 2015 02:20
hi anyone having trouble signing in fcc
Sean
@seanr707
Aug 19 2015 02:23
@fcordoba84 with email?
vdivya51991
@vdivya51991
Aug 19 2015 02:24
how to add classes to the elements using jquery?
Sean
@seanr707
Aug 19 2015 02:24
@vdivya51991 $('blah').addClass('bleh');
or $('blah').attr('class', 'bleh')
Max
@MaxRubyDev
Aug 19 2015 03:18
Is it just me, or did FCC website just go kaput?
"Safari could not open the pag because the server stopped responding." Also cannot load it up in Chrome.
Michelle Edmondson
@GeeksRock
Aug 19 2015 03:20
I can't launch in Chrome either :(
Spoke too soon. It's back :)
Kolloom
@Kolloom
Aug 19 2015 03:26
why is that when i type $($) the page crashes, im on slot machine
Michelle Edmondson
@GeeksRock
Aug 19 2015 03:28
It's doing lots of weird stuff. My map doesn't look right.
And when I click on the link that normally shows a calendar, it's displaying my profile :-1:
Michael Krebs
@michael-krebs
Aug 19 2015 03:41
@Kolloom that's a known bug i think quincy is working on it
Michelle Edmondson
@GeeksRock
Aug 19 2015 03:56
Thanks!
Chad Kreutzer
@ChadKreutzer
Aug 19 2015 04:09
The site isn't coming up for me either. I tried both Chrome and Edge.
John Nieves
@karn09
Aug 19 2015 04:10
I guess I'm not the only one
TuiLaHiep
@TuiLaHiep
Aug 19 2015 04:27
hi guys
im having same problem here
Anthony MacMahon
@SansPulp
Aug 19 2015 04:30

Has anyone gone back (since the update) and done Waypoint: Use Conditional Logic with IfElse Statements?

I've entered the following:

function myFunction(){
  var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
  // Create and if else statement here to return "heads" if flip is 0. Otherwise return "tails".
  if (flip === 0) {
    return "heads";
  }
  else {
    return "tails";
  }
  // Only change code below this line.


}

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return(myFunction());})();

And I get all the checkmarks. I think I'm doing everything it asks me to, but I don't know. It seems to be passing all the tests. Any thoughts?

Rex Schrader
@SaintPeter
Aug 19 2015 04:34
@SansPulp What is the issue?
@SansPulp You said it's passing all the tests?
Matt Everson
@matteverson
Aug 19 2015 04:35
The new waypoints operate on regexes too, so they might be looking for your code to be below the // Only change code below this line. line.
Anthony MacMahon
@SansPulp
Aug 19 2015 04:37
@SaintPeter Yeah, it's passing all the tests, but I don't get any kind of completion pop-up or a confirmation on the map. I
Rex Schrader
@SaintPeter
Aug 19 2015 04:37
The site may be having some issues right now
Anthony MacMahon
@SansPulp
Aug 19 2015 04:37
@SaintPeter I was just wondering if I'm missing something. It seems pretty simple
Matt Everson
@matteverson
Aug 19 2015 04:39
@SansPulp I just passed it by creating a condition below that line. Seems to work ok
Anthony MacMahon
@SansPulp
Aug 19 2015 04:40
@matteverson You mean you passed the if/else statement below // Only change code below this line.? I tried that and it didn't work.
Jordan Epps
@jkepps
Aug 19 2015 04:41
anyone else having issues with 33. Waypoint: Sift through Text with Regular Expressions? seems like all i need to do is change the regular expression to /and/gi and that should work, but it's not passing the second test
Matt Everson
@matteverson
Aug 19 2015 04:43
@SansPulp Try refreshing the page
noi5e
@noi5e
Aug 19 2015 04:43
@jkepps try and+
Will Moody
@willmoody
Aug 19 2015 04:43

Hey guys, I'm having a hard time understanding what I'm doing wrong on Waypoint: Generate Random Whole Numbers within a Range:

var min = 0;
var max = 12;
function myFunction() {
  // Make myFunction return a random number between zero and nine instead of a decimal
  // Only change code below this line.

  return(Math.floor(Math.random() * (9-0+1))+0);
}

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return(myFunction());})();

I'm missing one of the checkmarks, whose error reads,
assert((function(){if(editor.getValue().match(/max/g).length >= 2 && editor.getValue().match(/min/g).length >= 2 && editor.getValue().match(/Math.floor/g) && editor.getValue().match(/Math.random/g)){return(true);}else{return(false);}})(), 'You should be using the function given in the description to calculate the random in number in a range');You should be using the function given in the description to calculate the random in number in a range

Any help would be extremely appreciated!

Jordan Epps
@jkepps
Aug 19 2015 04:44
@noi5e that did the trick, thanks!
Anthony MacMahon
@SansPulp
Aug 19 2015 04:45
@matteverson That was all it needed. Thanks!
Matt Everson
@matteverson
Aug 19 2015 04:45
@fractal-mind I see the assert is looking for two uses of max and min in your code, rather than using numeric literals in the Math.floor() statement.
Will Moody
@willmoody
Aug 19 2015 04:47
Oh. Oooohh. So it literally wants me to use exactly the example code
Thanks @matteverson ! I guess it's showing it to me this way because I'll usually be pulling numbers from somewhere else?
Matt Everson
@matteverson
Aug 19 2015 04:49
@fractal-mind Yeah, the idea is your function will be reusable, finding a random value between any two numbers.
Will Moody
@willmoody
Aug 19 2015 04:50
@matteverson Ahh, gotcha. Thanks again!
Also, I must say I find it odd that there isn't a bot giving out brownie points in the official channel in which I imagine people are most likely to be thanked
Chad Kreutzer
@ChadKreutzer
Aug 19 2015 05:25
@fractal-mind I suspect that it is intentional, as this is the channel where you are supposed to be seeking help and not there.
TC
@tcpecher
Aug 19 2015 05:40
is there a way to reference a member of a sub-array? If I have array = [[ 2 , 3, 5 ], [7,8,9]] and I want to point to the second value in the first sub-set?
Chad Kreutzer
@ChadKreutzer
Aug 19 2015 05:44
@tcpecher array0
lol
@tcpecher
array[0][1]
TC
@tcpecher
Aug 19 2015 05:45
@ChadKreutzer thanks!
Chad Kreutzer
@ChadKreutzer
Aug 19 2015 05:46
where the first bracket is the index for the first level of elements and the second bracket is the index for the contents of the first one. :)
TC
@tcpecher
Aug 19 2015 05:47
awesome. i knew it was something like that, but i couldn't find the right syntax...
Chad Kreutzer
@ChadKreutzer
Aug 19 2015 05:47
np
Chad Kreutzer
@ChadKreutzer
Aug 19 2015 06:08

@SaintPeter getting there:

 Array.prototype.arrayDiff = function (arr2) {
            return this.filter(function (elem) {
                return (arr2.indexOf(elem) < 0);
            });
        };
        Array.prototype.symmetricOfTwo = function (arr2) {
            return this.arrayDiff(arr2).concat(arr2.arrayDiff(this));
        };

Just gotta deal with duplicates and then I'm thinking I can just put an

if(arguments[2])...

in to deal with if there is a third array.

ronaldnicol89
@ronaldnicol89
Aug 19 2015 06:32
anyone finish factoralize a number
I am too lost right now
Chad Kreutzer
@ChadKreutzer
Aug 19 2015 06:35
@ronaldnicol89 is that one of the new ones?
grr. they're doing maintenance so I can't get in to see which one you are talking about.
Chad Kreutzer
@ChadKreutzer
Aug 19 2015 06:48
@ronaldnicol89 Okay, I at least got in enough to see which one you are talking about. What are you having trouble with? post what you have so far.
ronaldnicol89
@ronaldnicol89
Aug 19 2015 06:49
i got it but I dont really understand. the correct answer is 120, but arent the factors of 5 ony 1,5?
Evan Aubry
@evanAubry
Aug 19 2015 06:50
1 2 3 4 5
Chad Kreutzer
@ChadKreutzer
Aug 19 2015 06:50
@ronaldnicol89 yes, but we're talking about a different thing: factorial.
represented by !
so, for example, 8! or (8 factorial) would be 1234567*8
dammit. I hate it when it does that.
1*2*3... and so on to ...7*8
got it?
Luis Felipe López G.
@luishendrix92
Aug 19 2015 06:55
wiki factorial
bonfire factorial
ronaldnicol89
@ronaldnicol89
Aug 19 2015 06:55
ahhhhhh
Luis Felipe López G.
@luishendrix92
Aug 19 2015 06:55
bf factorial
wtf Camperbot isn't here, anyway.
ronaldnicol89
@ronaldnicol89
Aug 19 2015 06:55
damn math
Chad Kreutzer
@ChadKreutzer
Aug 19 2015 06:55
@luishendrix92 lmao, or you could do that. :D
ronaldnicol89
@ronaldnicol89
Aug 19 2015 06:55
thanks @ChadKreutzer
Chad Kreutzer
@ChadKreutzer
Aug 19 2015 06:56
np. my last good deed of the night. goodnight, fellow campers.
Luis Felipe López G.
@luishendrix92
Aug 19 2015 06:56
Do a recursion: first, if n is 0 or 1, return 1, if not, return the same function but this time the argument should equal to n-1 (thanks to closures)
Or use a while loop.
Chad Kreutzer
@ChadKreutzer
Aug 19 2015 06:57
@luishendrix92 he solved it, he just didn't know what he had solved.
Jawad
@jawadowned
Aug 19 2015 07:00
Heya can anybody help me with a zipline ?
dc
@dcsan
Aug 19 2015 07:03
botstatus
CamperBot
@camperbot
Aug 19 2015 07:03
All bot systems are go!
botVersion: 0.0.11
env: prod
botname: camperbot
dc
@dcsan
Aug 19 2015 07:03
bf fact
CamperBot
@camperbot
Aug 19 2015 07:03

:fire:Bonfire: Factorialize a Number :link:

function factorialize(num) {
  return num;
}

factorialize(5);

Return the factorial of the provided integer.

more info:  bf details | bf links | hint

Mbos95
@Mbos95
Aug 19 2015 07:09

in Jquery:Waypoint: Remove Classes from an element with jQuery

How would I go about removing all the btn-default from all of the buttons at the same time ?

ronaldnicol89
@ronaldnicol89
Aug 19 2015 07:09
can you link me to the waypoint
like that ?
Luis Felipe López G.
@luishendrix92
Aug 19 2015 07:11
Using a removeClass but applied to all the elements with the button tag.
ronaldnicol89
@ronaldnicol89
Aug 19 2015 07:11
you have to do each individually as far as im aware
Mbos95
@Mbos95
Aug 19 2015 07:11
So that would be 6 lines of code then ?
ronaldnicol89
@ronaldnicol89
Aug 19 2015 07:11
the example on the side
$("#target2").removeClass("btn-default");
Mbos95
@Mbos95
Aug 19 2015 07:11
Yea oke. I tried doing left-well and right-well but for some reason that didn't work
ronaldnicol89
@ronaldnicol89
Aug 19 2015 07:12
yeah 6 times, i think because left well and right well dont inhereit from the #target classes
there might be a way to do it with .parent() but I’m not sure
Mbos95
@Mbos95
Aug 19 2015 07:13
Ah oke. didn't had that yet! i'll run into that later. for now I passed this tutorial.
thanks @luishendrix92
CamperBot
@camperbot
Aug 19 2015 07:13
mbos95 sends brownie points to @luishendrix92 :sparkles: :thumbsup: :sparkles:
:warning: mbos95 already gave luishendrix92 points
Mbos95
@Mbos95
Aug 19 2015 07:13
thanks @ronaldnicol89
CamperBot
@camperbot
Aug 19 2015 07:13
mbos95 sends brownie points to @ronaldnicol89 :sparkles: :thumbsup: :sparkles:
:star: 213 | @ronaldnicol89 | http://www.freecodecamp.com/ronaldnicol89
ronaldnicol89
@ronaldnicol89
Aug 19 2015 07:13
thanks
CamperBot
@camperbot
Aug 19 2015 07:13
if you want to thank someone, put an @ before their name!
ronaldnicol89
@ronaldnicol89
Aug 19 2015 07:14
thanks @Mbos95
CamperBot
@camperbot
Aug 19 2015 07:14
ronaldnicol89 sends brownie points to @mbos95 :sparkles: :thumbsup: :sparkles:
:star: 110 | @mbos95 | http://www.freecodecamp.com/mbos95
Evan Aubry
@evanAubry
Aug 19 2015 07:14
$("button").removeClass("btn-default");
Mbos95
@Mbos95
Aug 19 2015 07:15
thanks @evanAubry
CamperBot
@camperbot
Aug 19 2015 07:15
mbos95 sends brownie points to @evanaubry :sparkles: :thumbsup: :sparkles:
:star: 167 | @evanaubry | http://www.freecodecamp.com/evanaubry
Evan Aubry
@evanAubry
Aug 19 2015 07:15
np
ronaldnicol89
@ronaldnicol89
Aug 19 2015 07:15
@evanAubry (y)
that was a thumbs up
Evan Aubry
@evanAubry
Aug 19 2015 07:16
i knew it :+1:
knew what you meant*
ronaldnicol89
@ronaldnicol89
Aug 19 2015 07:21
how do you do it on here lol
Mbos95
@Mbos95
Aug 19 2015 07:22
type :+1':
remove the '
ronaldnicol89
@ronaldnicol89
Aug 19 2015 07:22
:+1:
thanks
CamperBot
@camperbot
Aug 19 2015 07:22
if you want to thank someone, put an @ before their name!
Mbos95
@Mbos95
Aug 19 2015 07:27

in http://freecodecamp.com/challenges/waypoint-use-appendto-to-move-elements-with-jquery

I use $("#target2").appendTo("#left-well");
$("#target2").appendTo("rightleft-well");

Why doesn this work?

Uhum,
$("#target2").appendTo("#left-well");
$("#target2").appendTo("#rightleft-well");
Sorry! Got it working( with confusion...)
Shaklin
@ShaklinSyed
Aug 19 2015 07:30
Hi all
Mbos95
@Mbos95
Aug 19 2015 07:30
hey
Shaklin
@ShaklinSyed
Aug 19 2015 07:30
hi @Mbos95
looking for some help with bootstrap
Mbos95
@Mbos95
Aug 19 2015 07:31
I am not good with it at all! but lets give it a shot
I just did those tutorials myself yesterday :D
or want to wait untill someone more skilled comes along ?
Woolwit
@Woolwit
Aug 19 2015 07:45
I finally passed spinalCase but it looks ugly to me and I have the sense I'm missing something simple that would have solved it hours ago. Especially I would have liked to not use an iterator through an array. But I couldn't find a way to address an actual regex match in order to put a .toLowerCase() on it. If anyone is familiar with spinalCase and would like to have a look and offer suggestions (no audio, but chat) you could pair with me and my solution at http://pythontutor.com/visualize.html#togetherjs=3aI9ATQC5c Thanks
CamperBot
@camperbot
Aug 19 2015 07:45
if you want to thank someone, put an @ before their name!
Komal Bhandari
@panaroma
Aug 19 2015 08:23
any one want to help me on Waypoint: Bring your JavaScript Slot Machine to Life
May Pagatpatan
@myflryuna
Aug 19 2015 08:27
```
function palindrome(str) {
var strPeriod = str.split('. ').join('').toLowerCase();
var strComma = strPeriod.split(', ').join('').toLowerCase();
var strSpace = strComma.split(' ').join('').toLowerCase();
var strPalin = strSpace.split('').reverse().join('');

  if (strSpace === strPalin){
    return true;
  }
  else{
    return false;
  }

}

palindrome("A man, a plan, a canal. Panama");
Hi fellow campers, i'm not too good in string manipulation, is there any other way to split a multiple character in one line?
Komal Bhandari
@panaroma
Aug 19 2015 08:32
@myflryuna use regular expressions to split
May Pagatpatan
@myflryuna
Aug 19 2015 08:35
@panorama, please provide split statement that can remove multiple special character in one line? i tried this statement because i tried this statement
str.split('. '|', ').join('').toLowerCase();
but doesn't work
@panaroma * i tried this statement str.split('. '|', ').join('').toLowerCase(); but doesn't work
Krzysztof Miąsko
@kmiasko
Aug 19 2015 08:45
@myflryuna i thinks thats what you're looking for str.toLowerCase().split(/[,.]?\s/);
and you could just create var newString = str.toLowerCase(); instead of using this function all the time
DRY don't repeat Yourself
You could take other approach, first remove every non wanted character from the string, and then just split it.
May Pagatpatan
@myflryuna
Aug 19 2015 08:52

Thanks @kmiasko
```
function palindrome(str) {
var strSample = str.split(/[,.]?\s/).join('').toLowerCase();

var strPalin = str.split(/[,.]?\s/).reverse().join('').toLowerCase();

if (strSample === strPalin){
return true;
}
else{
return false;
}

}

palindrome("A man, a plan, a canal. Panama");

CamperBot
@camperbot
Aug 19 2015 08:52
myflryuna sends brownie points to @kmiasko :sparkles: :thumbsup: :sparkles:
:star: 189 | @kmiasko | http://www.freecodecamp.com/kmiasko
May Pagatpatan
@myflryuna
Aug 19 2015 08:59
```
function palindrome(str) {
var strSample = str.split(/[,.]?\s/).join('').toLowerCase();

var strPalin = strSample.split('').reverse().join('');

  if (strSample === strPalin){
    return true;
  }
  else{
   return false;
  }
  //return strPalin;
}

palindrome("A man, a plan, a canal. Panama");
Krzysztof Miąsko
@kmiasko
Aug 19 2015 09:01
yeah, good job
Rabin Shrestha
@jyapujuju
Aug 19 2015 09:06
  $(document).ready(function() {
    $("button").addclass("animated");
    $(".btn").addclass("shake");
    $("#target1").addclass ("btn-primary");
  });
</script>

<!-- You shouldn't need to modify code below this line -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <h4>#left-well</h4>
      <div class="well" id="left-well">
        <button class="btn btn-default target" id="target1">#target1</button>
        <button class="btn btn-default target" id="target2">#target2</button>
        <button class="btn btn-default target" id="target3">#target3</button>
      </div>
    </div>
    <div class="col-xs-6">
      <h4>#right-well</h4>
      <div class="well" id="right-well">
        <button class="btn btn-default target" id="target4">#target4</button>
        <button class="btn btn-default target" id="target5">#target5</button>
        <button class="btn btn-default target" id="target6">#target6</button>
      </div>
    </div>
  </div>
</div>
what i did wrong
?
Waypoint: Target the same element with multiple jQuery Selectors
May Pagatpatan
@myflryuna
Aug 19 2015 09:19
Hi @jyapujuju , try this .addClass rather than .addclass
Rabin Shrestha
@jyapujuju
Aug 19 2015 09:43
thanks @myflryuna <3
CamperBot
@camperbot
Aug 19 2015 09:43
jyapujuju sends brownie points to @myflryuna :sparkles: :thumbsup: :sparkles:
:star: 182 | @myflryuna | http://www.freecodecamp.com/myflryuna
Kelvin O
@kerukelw
Aug 19 2015 09:50
man now sometimes i can login and sometimes i cant
Sean Campbell
@natac13
Aug 19 2015 10:26
Hey has anyone else had camper bot say no receiver found for giving brownie points and if so how do I fix this issue?
Tim Millar
@tim-millar
Aug 19 2015 10:38
Hey guys, after the launch of the new map, I was roughly at the basic front-end ziplines section, so I've decided to give them a go.
I'm pretty inept at front-end stuff, and it seems pretty daunting to try to reverse engineer a page.
Anyone got any advice about how to approach it?
divyafamt
@divyafamt8
Aug 19 2015 11:08
am stuck in Waypoint: Override Styles in Subsequent CSS
how do u add two classes for h1 ?
anyone any advice on how to approach ?
Lionel Croes
@lionelx1
Aug 19 2015 11:11
which number is that case?
May Pagatpatan
@myflryuna
Aug 19 2015 11:12
Try this <h1 class="pink-text blue-text">
divyafamt
@divyafamt8
Aug 19 2015 11:12
ahh.. I will try
brill..it worked
thanks a ton
CamperBot
@camperbot
Aug 19 2015 11:12
if you want to thank someone, put an @ before their name!
Daniel
@hihipriz
Aug 19 2015 11:12
was just gonna answer you too :)
divyafamt
@divyafamt8
Aug 19 2015 11:13
CamperBot
@camperbot
Aug 19 2015 11:13
if you want to thank someone, put an @ before their name!
divyafamt
@divyafamt8
Aug 19 2015 11:13
thanks @myflryuna ..............this is much better
CamperBot
@camperbot
Aug 19 2015 11:13
divyafamt8 sends brownie points to @myflryuna :sparkles: :thumbsup: :sparkles:
:star: 184 | @myflryuna | http://www.freecodecamp.com/myflryuna
Elizabeth Hatleli
@TheHighPriestess
Aug 19 2015 11:14
@tim-millar If you're referring to Infinito Web Design Studio .....try look at some Bootstrap basic templates..and go from there
Daniel
@hihipriz
Aug 19 2015 11:14
I'm on the bonfire reverse string, and it tells me that I "didn't run any tests", what does that mean?
Elizabeth Hatleli
@TheHighPriestess
Aug 19 2015 11:14
Daniel
@hihipriz
Aug 19 2015 11:14
doesn't say anything about that in the instructions
flota113
@flota113
Aug 19 2015 11:29
@hihipriz I don't remember but I think it may be wrong code? look at the browser console ;)
Rabin Shrestha
@jyapujuju
Aug 19 2015 11:40
  $(document).ready(function() {
    $("#target1").css("color", "red");
    $("#target1").prop("disabled", true);
    $("#target4").remove();
    $("#target2").appendTo("#right-well");
    $("#target5").clone().appendTo("#left-well");
    $("#target1").parent().css("background-color", "red");
    $("#right-well").children().css("color", "green");
    $("#left-well:nth-child(2)").addClass("bounce");
    $("#right-well:nth-child(2)").addClass("bounce");

  });
</script>
what i did wrong ??
Waypoint: Target a Specific Child of an Element Using jQuery
Rabin Shrestha
@jyapujuju
Aug 19 2015 11:48
@myflryuna
May Pagatpatan
@myflryuna
Aug 19 2015 11:50
Try this $(".target:nth-child(n)").addClass("animated bounce");
rather than the last 2 statements but (n) must be the number of the element
Rabin Shrestha
@jyapujuju
Aug 19 2015 11:53
thanks its worked @myflryuna (y)
CamperBot
@camperbot
Aug 19 2015 11:53
jyapujuju sends brownie points to @myflryuna :sparkles: :thumbsup: :sparkles:
:star: 185 | @myflryuna | http://www.freecodecamp.com/myflryuna
Tim Millar
@tim-millar
Aug 19 2015 11:54
@TheHighPriestess It's the portfolio page zipline. Thanks for the link!
CamperBot
@camperbot
Aug 19 2015 11:54
tim-millar sends brownie points to @thehighpriestess :sparkles: :thumbsup: :sparkles:
:star: 202 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
Lionel Croes
@lionelx1
Aug 19 2015 11:55
who writes down everything they learn?
Max Gorozii
@xanlong
Aug 19 2015 11:59
Hi! Im not sure, where should I write for discussion... Maybe directly to Quincy, but ... Do everyone think, what closed-sourced ScreenHero, which doesn't work on linux - best choice for pair programming?
Jeremy Gorniak
@Gornstats
Aug 19 2015 12:00
@xanlong ive heard many linux users use TeamViewer
Sean
@seanr707
Aug 19 2015 12:01
^ This
or you can use an ide sharing service (i.e. c9)
Max Gorozii
@xanlong
Aug 19 2015 12:05
@Gornstats @seanr707 of course, i can, buе most people will use screenhero - with all its lacks. And it make more hard to find pair for programing
Sean
@seanr707
Aug 19 2015 12:08
The great thing about Teamviewer though is that unlike SH you don't even need to sign up, which I think would allow for someone who really wants to pair with able to do quickly and easily
I would just try asking people if they would mind doing a quick download of TeamV and I'm sure most people would be compliant, or already have both
Also, you can check out gitter.im/FreeCodeCamp/TeamViewer
Max Gorozii
@xanlong
Aug 19 2015 12:10
@seanr707 thx, i didn't know about this chat.
CamperBot
@camperbot
Aug 19 2015 12:10
xanlong sends brownie points to @seanr707 :sparkles: :thumbsup: :sparkles:
:star: 145 | @seanr707 | http://www.freecodecamp.com/seanr707
Sean
@seanr707
Aug 19 2015 12:13
Your welcome!
RC Maples
@rcmaples
Aug 19 2015 12:37
Strangeness is afoot. I cannot get the "I've completed this challenge" button to do anything on the portfolio zipline. :/
Greg Noble
@gregnoble
Aug 19 2015 12:53
You may just need to wait
did you try clicking and giving it a few seconds? mine was doing that yesterday.
trying to remember what i did to fix it. @rcmaples
Tim Millar
@tim-millar
Aug 19 2015 12:57
Hard reload and clear cache helped me solve a similar problem @rcmaples
Madalin Matei
@JustMD
Aug 19 2015 13:23
Can I get some help in "Title Case a Sentence", what should I use in the if statement :(
Da Cheezy Mobsta
@mobesa
Aug 19 2015 13:23
bonfire title case
CamperBot
@camperbot
Aug 19 2015 13:23

:fire:Bonfire: Title Case a Sentence :link:

function titleCase(str) {
  return str;
}

titleCase("I'm a little tea pot");

Return the provided string with the first letter of each word capitalized.

more info:  bf details | bf links | hint

Da Cheezy Mobsta
@mobesa
Aug 19 2015 13:25
@JustMD why not show us your code for this bonfire?
Madalin Matei
@JustMD
Aug 19 2015 13:27
because is a mess
Da Cheezy Mobsta
@mobesa
Aug 19 2015 13:27
it's alright
just remember to put it between two ```s
Madalin Matei
@JustMD
Aug 19 2015 13:30
blob
any hint?what I should add?
Sean Campbell
@natac13
Aug 19 2015 13:36
@JustMD Just check in the if statement if var i = 0 then change the charAt(0) to capitalize
also you need to be looping through the array items that you make not the original string
so your var c is a array of the words right?
Madalin Matei
@JustMD
Aug 19 2015 13:37
yes, I just split them individualy
but don't know where should I use it
Sean Campbell
@natac13
Aug 19 2015 13:38
so then you need the length of var c for how many words there are
Madalin Matei
@JustMD
Aug 19 2015 13:38
no, I need to cap1st letter of each word
Sean Campbell
@natac13
Aug 19 2015 13:38
well the goal is to change the first letter of each word so the for loop has to be more like
```
for(var i = 0; i < c.length; i++) {
then you target each word by
c[i]
since c is the array and i is an index
Da Cheezy Mobsta
@mobesa
Aug 19 2015 13:42
@natac13 note that string are immutable
explain immutable
CamperBot
@camperbot
Aug 19 2015 13:42

:point_right: js immutable [wiki]

Immutable means unchangeable i.e. you can't change.

Javascript has lots of immutable types e.g. string primitive type. Try this in your console.

s = "red";
console.log(s[1]); //→ "e"
s[1] = "x";
console.log(s) //→ "red"

the s didn't change! WAT!

:pencil: read more about js immutable on the FCC Wiki

Sean Campbell
@natac13
Aug 19 2015 13:43
@mobesa yeah so you build a new string base off the old one with the first letter uppercase()
Da Cheezy Mobsta
@mobesa
Aug 19 2015 13:43
@natac13 :thumbsup:
Sean Campbell
@natac13
Aug 19 2015 13:43
Oh ok you knew already...
Da Cheezy Mobsta
@mobesa
Aug 19 2015 13:43
:smile:
Sean Campbell
@natac13
Aug 19 2015 13:44
thanks @mobesa
CamperBot
@camperbot
Aug 19 2015 13:44
natac13 sends brownie points to @mobesa :sparkles: :thumbsup: :sparkles:
:star: 216 | @mobesa | http://www.freecodecamp.com/mobesa
Da Cheezy Mobsta
@mobesa
Aug 19 2015 13:44
:blush:
Here's how to simply fix this:
(hold on a minute) :watch:
Sean Campbell
@natac13
Aug 19 2015 13:47
@JustMD if you are stuck what we are talking about is making
c[i] = c[i].chatAt(0).toUpperCase() + c[i].slice(1);
Tom Pyszczuk
@Ne0nite
Aug 19 2015 13:47
I need help :/ Trying to do the "Return largest numbers in array" bonefire and can't figure out the logic quiet right :/ Could somebody pls look at the code and maybe give some tips ?
function largestOfFour(arr) {
function sort(a, b) {
   return a - b;
 }
 var largestNum = [];
    for ( var i=0 ; i < arr.length; i++) {
        var sortedArray = arr[i].sort(sort);
        console.log("Looping : ", [i] , sortedArray);
        console.log(sortedArray[3]);
        var largestNum =+ largestNum.push(sortedArray[3]);




      }
  console.log("This is the new array: ",largestNum);

}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Madalin Matei
@JustMD
Aug 19 2015 13:49
ty
Da Cheezy Mobsta
@mobesa
Aug 19 2015 13:49
@natac13 & @JustMD :point_down:
function titleCase(str) {
  var a = str.length,
          b = str,
          c = str.split(' ');
  for (var i = 0; i < a; i++) {
     c[i] = c[i].chatAt(0).toUpperCase() + c[i].slice(1); //thanks to natac13 
}
  return c.join(' ');
}
CamperBot
@camperbot
Aug 19 2015 13:49
mobesa sends brownie points to @natac13 and @justmd :sparkles: :thumbsup: :sparkles:
:star: 174 | @justmd | http://www.freecodecamp.com/justmd
:star: 235 | @natac13 | http://www.freecodecamp.com/natac13
Sean Campbell
@natac13
Aug 19 2015 13:49
@mobesa Exactly!
Da Cheezy Mobsta
@mobesa
Aug 19 2015 13:50
:+1:
@Ne0nite hold on
Tom Pyszczuk
@Ne0nite
Aug 19 2015 13:51
@mobesa okies
Da Cheezy Mobsta
@mobesa
Aug 19 2015 13:54
@JustMD a small piece advice (that you might already know):
  • for variable names: try to use names that make their content obvious like str_len for the length of a string
bonfire largest numbers in array
CamperBot
@camperbot
Aug 19 2015 13:55

:fire:Bonfire: Return Largest Numbers in Arrays :link:

function largestOfFour(arr) {
  // You can do this!
  return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays.

more info:  bf details | bf links | hint

Javier
@jalonso087
Aug 19 2015 13:56
im having some issues with the first zipline. it has a giant margin on the right side and i cant seem to get rid of it. ive tried different ways of stretching the image like cover or 100%, and ive also tried margin-right: 0px; to no avail. help! please :) http://codepen.io/jalonso087/pen/wabrom
Jeff Huang
@a49678321
Aug 19 2015 14:00
Excuse me, how do I post coding background?
Javier
@jalonso087
Aug 19 2015 14:01
use ``` before and after the code
Marcus Eisele
@eiselems
Aug 19 2015 14:01
@jalonso087 is there a tutorial somewhere to create that parallelx effect :?
Jeff Huang
@a49678321
Aug 19 2015 14:02
@jalonso087 thx!
CamperBot
@camperbot
Aug 19 2015 14:02
a49678321 sends brownie points to @jalonso087 :sparkles: :thumbsup: :sparkles:
:star: 215 | @jalonso087 | http://www.freecodecamp.com/jalonso087
Javier
@jalonso087
Aug 19 2015 14:03
hm, what do you mean by parallelx effect? the page background/scrolling?
null@a496783 no problem!
Marcus Eisele
@eiselems
Aug 19 2015 14:05
yeah @jalonso087 or did you just copy? not sure if I missed something about it
Da Cheezy Mobsta
@mobesa
Aug 19 2015 14:05
@Ne0nite I got lost in your code... :worried:
I ran it: it's a little :bug:y
Tom Pyszczuk
@Ne0nite
Aug 19 2015 14:06
let me clear it up then
Javier
@jalonso087
Aug 19 2015 14:06
i managed to find something on google, the code i found was background-image:url('https://40.media.tumblr.com/1b916597d3e174399cb7adadddb66ede/tumblr_nt5uk4psl31ud7rr3o1_1280.jpg'); background-repeat:no-repeat; background-attachment: fixed;
as css
Tom Pyszczuk
@Ne0nite
Aug 19 2015 14:06
function largestOfFour(arr) {
function sort(a, b) {
   return a - b;
 }
 var largestNum = [];
    for ( var i=0 ; i < arr.length; i++) {
        var sortedArray = arr[i].sort(sort);
        console.log("Looping : ", [i] , sortedArray);
//        console.log(sortedArray[3]);
        var largestNum =+sortedArray[3];
//        console.log(largestNum);




      }
  console.log("This is the new array: ",largestNum);

}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Javier
@jalonso087
Aug 19 2015 14:06
the main part of it that gives that effect is background-attachment: fixed;
Tom Pyszczuk
@Ne0nite
Aug 19 2015 14:07
disregard the commented out lines, they are just for me to keep track of what happens :)
Da Cheezy Mobsta
@mobesa
Aug 19 2015 14:07
@Ne0nite :ok_hand:
Tom Pyszczuk
@Ne0nite
Aug 19 2015 14:08
basically I know how to sort the original array and now I would like to push the last element of the sorted array on every loop to the var largestNumber
at least thats how I see it :)
Da Cheezy Mobsta
@mobesa
Aug 19 2015 14:09
largestNum.push(sortedArray[3]) :point_left:
try it
Mihai
@mihaisavezi
Aug 19 2015 14:10
I'm doing bonfires Inventory. Does anyone know why my code freezes, or i'm getting the infinity loop error here ?
function inventory(arr1, arr2) {
    // All inventory must be accounted for or you're fired!
    // compare if elements that are in new inv are in cur inv;
    // if they're not there add them, based on the alphabetical order put them between the
    // corresponding elements
    var i = 0;


    for(i; i < arr1.length; i++) {
      if(arr2.indexOf(arr1[1][i]) > -1) {
        arr1[i][0] += arr2[i][0];
      }
      else
        arr1.push(arr2[i]);
    } 


  arr1.sort(function (a,b) {
      if (a[1] === b[1]) {
        return 0;
    }
    else {
        return (a[1] < b[1]) ? -1 : 1;
    }
  });


    return arr1;
}

// Example inventory lists
var curInv = [
    [21, 'Bowling Ball'],
    [2, 'Dirty Sock'],
    [1, 'Hair Pin'],
    [5, 'Microphone']
];

var newInv = [
    [2, 'Hair Pin'],
    [3, 'Half-Eaten Apple'],
    [67, 'Bowling Ball'],
    [7, 'Toothpaste']
];

inventory(curInv, newInv);
Tom Pyszczuk
@Ne0nite
Aug 19 2015 14:11
@mobesa lol wow.. heh thank You. But i don't get one thing then. Why didn't it work when I had var largestNum = largestNum.push(sortedArray[3]) ?
CamperBot
@camperbot
Aug 19 2015 14:11
ne0nite sends brownie points to @mobesa :sparkles: :thumbsup: :sparkles:
:star: 217 | @mobesa | http://www.freecodecamp.com/mobesa
JackAcid
@jack-acid
Aug 19 2015 14:15
Hello. I am working in Basic Algorithm Scripting: Bonfire: Title Case a Sentence. I can get my code to pass, but it feels ungainly. I build up a 'newStr' one character at a time, then reassign 'str = newStr' before returning 'str'. Is there a place to check for better implementations of a bonfire?
This message was deleted
CamperBot
@camperbot
Aug 19 2015 14:16
:bulb: to format code use backticks! ``` more info
JackAcid
@jack-acid
Aug 19 2015 14:17
oof, that didn't work. I am very new here. How do I enter code so that it is formatted, please?
Mbos95
@Mbos95
Aug 19 2015 14:17
to format code use backticks! ```
JackAcid
@jack-acid
Aug 19 2015 14:17
I see, backtick, not forward. Thank you, @Mbos95
CamperBot
@camperbot
Aug 19 2015 14:17
jack-acid sends brownie points to @mbos95 :sparkles: :thumbsup: :sparkles:
:star: 126 | @mbos95 | http://www.freecodecamp.com/mbos95
JackAcid
@jack-acid
Aug 19 2015 14:18
This message was deleted
Tom Pyszczuk
@Ne0nite
Aug 19 2015 14:18
press "```" then shift enter . then enter code. then ctrl enter
JackAcid
@jack-acid
Aug 19 2015 14:18
function titleCase(str) {
  var newStr = "";
  newStr += str.charAt(0).toUpperCase();

  for (var i = 1; i < str.length; i++) {
    if (str.charAt(i - 1) === " ") {
      newStr += str.charAt(i).toUpperCase();
    }
    else {
      newStr += str.charAt(i).toLowerCase();
    }
  }

  str = newStr;
  return str;
}

titleCase("I'm a little tea pot");
Mbos95
@Mbos95
Aug 19 2015 14:19
This message was deleted
Tom Pyszczuk
@Ne0nite
Aug 19 2015 14:19
@jack-acid here is my code for that bonefire if You would like to check a different approach
function titleCase(str) {
    str = str.toLowerCase();
    var array = str.split(/\s/g);
    var arrayUpper = [];
    for (var i=0; i < array.length; i++) { 
       var stringUpper =  array[i].charAt(0).toUpperCase() + array[i].slice(1);
       arrayUpper.push(stringUpper);
//       console.log(stringUpper);
     }

    return arrayUpper.join(' ');
//     console.log(arrayUpper);  
}

titleCase("I'm a little tea pot");
Mbos95
@Mbos95
Aug 19 2015 14:19
This message was deleted
<div class"row body" id="low">
    <div class="col-md-4" id="low">
Ah! got it working xD sorry..
Tom Pyszczuk
@Ne0nite
Aug 19 2015 14:19
:)
JackAcid
@jack-acid
Aug 19 2015 14:20
thanks @Ne0nite
CamperBot
@camperbot
Aug 19 2015 14:20
jack-acid sends brownie points to @ne0nite :sparkles: :thumbsup: :sparkles:
:star: 110 | @ne0nite | http://www.freecodecamp.com/ne0nite
Mbos95
@Mbos95
Aug 19 2015 14:20
thanks @Ne0nite
CamperBot
@camperbot
Aug 19 2015 14:20
mbos95 sends brownie points to @ne0nite :sparkles: :thumbsup: :sparkles:
:star: 111 | @ne0nite | http://www.freecodecamp.com/ne0nite
Jeff Huang
@a49678321
Aug 19 2015 14:23
Is any one out there who have finished Bonfire : Exact change?
I have problem with the decimal point.
Elizabeth Hatleli
@TheHighPriestess
Aug 19 2015 14:28
Bonfire Where are thou is really puzzling me.
CamperBot
@camperbot
Aug 19 2015 14:28
Sorry, can't find a bonfire called where are thou is really puzzling me. [ Check the map? ]
Elizabeth Hatleli
@TheHighPriestess
Aug 19 2015 14:29
I found a solution on Stack Overflow but this line is confusing me:
if (collection[i].hasOwnProperty(sourceProp) && collection[i][sourceProp] == source[sourceProp])
What is this: collection[i][sourceProp] ???
OK...I understand what's going on.
Elizabeth Hatleli
@TheHighPriestess
Aug 19 2015 14:34
I think my brain is fried from the heat here.
crizzydime
@crizzydime
Aug 19 2015 14:34
any know bugs for the "waypoint-give-your-javascript-slot-machine-some-stylish-images" my slot machine works fine but I cannot get it to pass me...
Elizabeth Hatleli
@TheHighPriestess
Aug 19 2015 14:36
It passed me yesterday when I did it
Da Cheezy Mobsta
@mobesa
Aug 19 2015 14:38
@TheHighPriestess collection[i][sourceProp] explained: First, collection[i] is the i-th element of the collection array which happens to be an Object. While [sourceProp] is the property of the collection[i] object.
Capiche?
This message was deleted
CamperBot
@camperbot
Aug 19 2015 14:38
Sorry, can't find a bonfire called where art thout. [ Check the map? ]
Da Cheezy Mobsta
@mobesa
Aug 19 2015 14:39
This message was deleted
CamperBot
@camperbot
Aug 19 2015 14:39

:fire:Bonfire: Where art thou :link:

function where(collection, source) {
  var arr = [];
  // What's in a name?
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });

Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).

more info:  bf details | bf links | hint

Da Cheezy Mobsta
@mobesa
Aug 19 2015 14:41
@TheHighPriestess no more problems with the bonfire?
crizzydime
@crizzydime
Aug 19 2015 14:44
$($(".slot")[0]).html('<img src = "' + images[slotOne -1] + '">');

$($(".slot")[1]).html('<img src = "' + images[slotTwo -1] + '">');

$($(".slot")[2]).html('<img src = "' + images[slotThree -1] + '">');
This is for "waypoint-give-your-javascript-slot-machine-some-stylish-images", any idea why I can't pass?
Tom
@PHLMoney
Aug 19 2015 14:50
@crizzydime It's a little weird, but it's probably the quotes.
Elizabeth Hatleli
@TheHighPriestess
Aug 19 2015 14:51
@mobesa I found the solution on stack overflow.
Tom
@PHLMoney
Aug 19 2015 14:51
@crizzydime in real life, the quotes do not matter, of course. But for this exercise, you need to use the provided quote format.
@crizzydime I found that a couple times in the exercises. ' vs " and vice versa
@crizzydime the solution function is looking for exact cases there.
Da Cheezy Mobsta
@mobesa
Aug 19 2015 14:51
@crizzydime I really don't know but, for starters, I think that there should be only one $ operator... maybe?
@TheHighPriestess :sparkles:
Elizabeth Hatleli
@TheHighPriestess
Aug 19 2015 14:52
@mobesa That one was hard though.
Tom
@PHLMoney
Aug 19 2015 14:52
@crizzydime Did that work for you?
Da Cheezy Mobsta
@mobesa
Aug 19 2015 14:53
@TheHighPriestess yep, it was hard... to hard for me that I forgot all about how I managed to solve it... :smile:
crizzydime
@crizzydime
Aug 19 2015 14:53
@PHLMoney Let me adjust these quotes! Thanks for the heads up
CamperBot
@camperbot
Aug 19 2015 14:53
crizzydime sends brownie points to @phlmoney :sparkles: :thumbsup: :sparkles:
:star: 237 | @phlmoney | http://www.freecodecamp.com/phlmoney
Elizabeth Hatleli
@TheHighPriestess
Aug 19 2015 14:53
@mobesa It seemed a lot harder than the ones before it.
Tom
@PHLMoney
Aug 19 2015 14:53
@crizzydime if you just change the single to double around .slot, that might do it.
Alternatively, copy the code from the waypoint description and adjust the numbers
Da Cheezy Mobsta
@mobesa
Aug 19 2015 14:54
@TheHighPriestess it get's harder and harder naturally...
Keep up the good work!!
Tom
@PHLMoney
Aug 19 2015 14:55
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');

Works, but

$($(".slot")[0]).html('<img src = "' + images[slotOne -1] + '">');

does not. They are equivilant though.

May Pagatpatan
@myflryuna
Aug 19 2015 14:56

@crizzydime , if you could notice the slot number below:

$($(".slot")[0]).html('<img src = "' + images[slotOne -1] + '">');
(".slot")[0]) . . . slotOne

Nnxoxo
@Nnxoxo
Aug 19 2015 14:56
@PHLMoney, they still aren't working on my machine
crizzydime
@crizzydime
Aug 19 2015 14:57
@PHLMoney Yea, after adjusting the quotes, the code still runs and the slots work, but cannot pass the waypoint
May Pagatpatan
@myflryuna
Aug 19 2015 14:57
try this:
$($(".slot")[1]).html('<img src = "' + images[slotOne -1] + '">');
Tom
@PHLMoney
Aug 19 2015 14:58
@crizzydime Which case is not being met?
@crizzydime For the waypoint.
crizzydime
@crizzydime
Aug 19 2015 14:58
@PHLMoney Use the provided code three times. One for each slot
Nnxoxo
@Nnxoxo
Aug 19 2015 14:59
@crizzydime, find solution
Tom
@PHLMoney
Aug 19 2015 14:59
paste your code in again?
crizzydime
@crizzydime
Aug 19 2015 14:59
$($(".slot")[0]).html('<img src = "' + images[slotOne -1] + '">');
$($(".slot")[1]).html('<img src = "' + images[slotTwo -1] + '">');
$($(".slot")[2]).html('<img src = "' + images[slotThree -1] + '">');
Nnxoxo
@Nnxoxo
Aug 19 2015 14:59
so u need to copy and paste the code example from the task 3 times
Tahmid Zahin
@Zahin-10
Aug 19 2015 14:59
var strArray=[];
var space=/\s+/gi;
function palindrome(str) {
// Good luck!
str.toLowerCase();
str=str.replace(space,'');
strArray=str.split("");
strArray.reverse();
strArray=strArray.join("");
if(str===strArray)
{
return true;
}
else
{
return false;
}
}
palindrome("race car");
what's wrong with it
??
showing this error
assert.deepEqual(palindrome("A man, a plan, a canal. Panama"), true);expected false to deeply equal true
Nnxoxo
@Nnxoxo
Aug 19 2015 15:00
and replace the slotOne to slotTwo and to slotThree and update the indexes
Tom
@PHLMoney
Aug 19 2015 15:00
Yes, I would just copy and paste rather than hand typing it.
    $($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');


    $($('.slot')[1]).html('<img src = "' + images[slotTwo-1] + '">');


    $($('.slot')[2]).html('<img src = "' + images[slotThree-1] + '">');
You have spaces on your subtractor
I think it is looking for an EXACT case
even though it shouldn't be.
Nnxoxo
@Nnxoxo
Aug 19 2015 15:01
@PHLMoney, in real projects spaces don't matter
Tom
@PHLMoney
Aug 19 2015 15:01
Your code is legit, but its matching an exact character set
@Nnutthowze I know. Neither do quotes. Both matter for this waypoint
May Pagatpatan
@myflryuna
Aug 19 2015 15:01
update the indexes:
```
```
$($(".slot")[1]).html('<img src = "' + images[slotOne -1] + '">');
$($(".slot")[2]).html('<img src = "' + images[slotTwo -1] + '">');
$($(".slot")[3]).html('<img src = "' + images[slotThree -1] + '">');
Tom
@PHLMoney
Aug 19 2015 15:02
If you delete the spaces before -1, the waypoint will pass, @crizzydime
Tahmid Zahin
@Zahin-10
Aug 19 2015 15:02
can anyone please tell me whats wrong with my palindrome check algorithm
Tom
@PHLMoney
Aug 19 2015 15:02
@myflryuna Your indices are incorrect. .slot only has 3 elements and it starts at 0.
crizzydime
@crizzydime
Aug 19 2015 15:02

@PHLMoney yep, that dang white space

@myflryuna thank you as well!

CamperBot
@camperbot
Aug 19 2015 15:02
crizzydime sends brownie points to @phlmoney and @myflryuna :sparkles: :thumbsup: :sparkles:
:warning: crizzydime already gave phlmoney points
:star: 186 | @myflryuna | http://www.freecodecamp.com/myflryuna
Tahmid Zahin
@Zahin-10
Aug 19 2015 15:02

'''
var code="var strArray=[];
var space=/\s+/gi;
function palindrome(str) {
// Good luck!
str.toLowerCase();
str=str.replace(space,'');
strArray=str.split("");
strArray.reverse();
strArray=strArray.join("");
if(str===strArray)
{
return true;
}
else
{
return false;
}
}

palindrome("race car");
"

CamperBot
@camperbot
Aug 19 2015 15:02
:bulb: to format code use backticks! ``` more info
Tahmid Zahin
@Zahin-10
Aug 19 2015 15:03

sry
var strArray=[];
var space=/\s+/gi;
function palindrome(str) {
// Good luck!
str.toLowerCase();
str=str.replace(space,'');
strArray=str.split("");
strArray.reverse();
strArray=strArray.join("");
if(str===strArray)
{
return true;
}
else
{
return false;
}
}

palindrome("race car");

Tom
@PHLMoney
Aug 19 2015 15:03
@crizzydime I had the same issue with that waypoint, may already be an open issue posted for it.
Nnxoxo
@Nnxoxo
Aug 19 2015 15:03
@PHLMoney strange if u delete the quotes and insert double quotes the code also won't work
omg
Tom
@PHLMoney
Aug 19 2015 15:04
@Nnutthowze Correct. It is looking for an exact case.
Nnxoxo
@Nnxoxo
Aug 19 2015 15:04
ye
Tom
@PHLMoney
Aug 19 2015 15:04
@Nnutthowze If anything in the character set changes, you cannot pass the waypoint.
@Nnutthowze Even if the functionality remains the same
Nnxoxo
@Nnxoxo
Aug 19 2015 15:04
I think was better to use codeacademy
Roger Nattkemper
@RogerNattkemper
Aug 19 2015 15:09
@Zahin-10 I don't think you're handling punctuation, try using \w
Tahmid Zahin
@Zahin-10
Aug 19 2015 15:19
hmm
Oscar
@OscarRobertRodriguez
Aug 19 2015 15:40
is something wrong with this code:
$(".well:nth-child(2)").addClass('animated bounce');
Oscar
@OscarRobertRodriguez
Aug 19 2015 15:46
its working now seems the problem was it needed a space at ".well :nth-child(2)" for it to work
Richard Gottleber
@rgottleber
Aug 19 2015 15:55
Hi, looking at the sorted Union bonfire.. Not sure how to implement reduce into the solution.. I have an idea on what the solution could be without it but wanted to follow the prescribed route.... Any pointers?
Sean Campbell
@natac13
Aug 19 2015 15:58
help sorted union
CamperBot
@camperbot
Aug 19 2015 15:58

:point_right: trying to understand the solution for fccs sorted union using callback function [wiki]

Hopefully the following post is appropriate for this forum...

  function unite(arr1, arr2, arr3) {
    var merge = function(coll,item) {
      if (coll.indexOf(item) < 0)
        coll.push(item);
      return coll;
    };
    //TODO this can be simplified
    arr1 = arr2.reduce(merge, arr1);
    arr1 = arr3.reduce(merge, arr1);
    return arr1;
  }
  unite([1, 2, 3], [5, 2, 1, 4], [2, 1]);

I've already submitted an answer for "Sorted Union" but it was without using "reduce", which uses a "callback function". The answer that I've found, shown above uses it.

I've spent several hours so far trying to understand where "merge" gets its arguments. I understand from reduce's prototype that its first argument is a callback function (which is merge in this case), and I get what a callback function is. And the callback function's arguments are supposedly: (previousValue, currentValue, index, array) when being called by "reduce", which steps, one-by-one, through the arrays somehow using merge. Maybe "item" matches up with being currentValue, but that's it.

I don't know where someone's supposed to learn this type of programming because there are no examples like it in "prototypes" and "callback functions" where arguments required seem to change depending on context.
:pencil: read more about trying to understand the solution for fccs sorted union using callback function on the FCC Wiki

Richard Gottleber
@rgottleber
Aug 19 2015 16:07
I got it sorted finally found an example that made sense of it :)
@camperbot
@natac13 thanks! My phone didn't refresh the chat until I posted
CamperBot
@camperbot
Aug 19 2015 16:08
rgottleber sends brownie points to @natac13 :sparkles: :thumbsup: :sparkles:
:star: 239 | @natac13 | http://www.freecodecamp.com/natac13
Tod
@thermobee
Aug 19 2015 16:09
anyone here that can help me with return the largest number in arrays bonfire?
CamperBot
@camperbot
Aug 19 2015 16:09
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Steven Young
@ShelbyGT
Aug 19 2015 16:10
wow,,stuck on lesson two of bonfires already
Daniela
@undefinedsymbol
Aug 19 2015 16:12
@ShelbyGT Do you have some code already? You might post it and we will try to help ;)
Tod
@thermobee
Aug 19 2015 16:13
@undefinedsymbol how about you look at my code? ;)
Komal Bhandari
@panaroma
Aug 19 2015 16:16
any one willing to help me on this : Waypoint: Bring your JavaScript Slot Machine to Life
Evan Davis
@davisec52
Aug 19 2015 16:23
Hi, everybody--I'm doing the first Zipline setting up Codepen. For some reason, Bootstrap does not seem to be active. Jquery is active and working, but the "Hello Codepen" text is solid black. Anyone have any ideas? Here is the link to the page: http://codepen.io/davisec52/details/WvqbXp
Valerie Spivey
@vlspivey
Aug 19 2015 16:24
Need help with Waypoint Use an ID Attribute to style an element:

<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}

.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}

.smaller-image {
width: 100px;
}
.gray-background {
background-color: gray
}
#cat-photo-element {
background-color: green;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>

<div class="gray-background">
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>

<form action="/submit-cat-photo" id="cat-photo-form" "green-background">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
Can't get past: "Your form element should have the background-color of green."

Javier
@jalonso087
Aug 19 2015 16:27
@davisec52 you have to add bootstrap to you CSS, not javascript :)
*your
Tod
@thermobee
Aug 19 2015 16:27
anyone here that can help me with return the largest number in arrays bonfire?
CamperBot
@camperbot
Aug 19 2015 16:27
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Javier
@jalonso087
Aug 19 2015 16:27
click settings near the top, then CSS, then quickadd bootstrap and itll fix your issue, looks like you had it quick added for javascript instead
Jearson Gomez
@jayGorio
Aug 19 2015 16:29
hello guys do you have any recommended websites to learn interactive java like this site?
Evan Davis
@davisec52
Aug 19 2015 16:29
@jalonso087 Crap! Of course! I must have been lobotomized overnight. Thank you @ jalons087.
CamperBot
@camperbot
Aug 19 2015 16:29
davisec52 sends brownie points to @jalonso087 :sparkles: :thumbsup: :sparkles:
:star: 218 | @jalonso087 | http://www.freecodecamp.com/jalonso087
Javier
@jalonso087
Aug 19 2015 16:29
no problem @davisec52
@jayGorio codecademy is a good one
anyone able to help me out in implementing/using APIs? im on the second zipline and i dont get how to implement it (particularly the forismatic API)
Jearson Gomez
@jayGorio
Aug 19 2015 16:30
@jalonso087 thanks but I think they dont offer java.
CamperBot
@camperbot
Aug 19 2015 16:30
jaygorio sends brownie points to @jalonso087 :sparkles: :thumbsup: :sparkles:
:star: 219 | @jalonso087 | http://www.freecodecamp.com/jalonso087
Javier
@jalonso087
Aug 19 2015 16:31
@jayGorio ah youre right, sorry about that
they do offer javascript however
Jearson Gomez
@jayGorio
Aug 19 2015 16:32
yeah anymore sites you can refer?
Tod
@thermobee
Aug 19 2015 16:39
not for java
but there are enough books and videos on youtube for you to learn from
Tahmid Zahin
@Zahin-10
Aug 19 2015 16:43

`var index=[];
function titleCase(str) {
str=str.toLowerCase();
for(var i=0;i<str.length;i++)
{
if(i===0)
{
index.push(i);
}
else if(str.charAt(i)===" ")
{
index.push(i+1);
}
}
var counter;
str=str.split("");
for(var j=0;j<index.length;j++)
{
counter=index[j];
str[counter]=str[counter].toUpperCase();
}
str=str.join("");
return str;
}

titleCase("HERE IS MY HANDLE HERE IS MY SPOUT");`

what's wrong with it ??it works fine but for some reason they are say it's incorrect.

saying*
Tod
@thermobee
Aug 19 2015 16:44
guys stop pasting code in here, its very hard to read
Tahmid Zahin
@Zahin-10
Aug 19 2015 16:44
I am sorry brother but need some help over here :3
Coira Ellison
@Coira
Aug 19 2015 16:45
hi @Zahin-10 you can format code using three backticks `
explain format
CamperBot
@camperbot
Aug 19 2015 16:45

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

``` ⇦ Type 3 backticks, then press [shift + enter ⏎]

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Tahmid Zahin
@Zahin-10
Aug 19 2015 16:46
ohk thanks
CamperBot
@camperbot
Aug 19 2015 16:46
if you want to thank someone, put an @ before their name!
Tahmid Zahin
@Zahin-10
Aug 19 2015 16:46
yeah i know that
Coira Ellison
@Coira
Aug 19 2015 16:47
camperbot's a bot, it always does that :)
Tahmid Zahin
@Zahin-10
Aug 19 2015 16:47
:P lol
var index=[];
function titleCase(str) {
  str=str.toLowerCase();
  for(var i=0;i<str.length;i++)
    {
      if(i===0)
        {
          index.push(i);
        }
      else if(str.charAt(i)===" ")
        {
          index.push(i+1);
        }
    }
  var counter;
  str=str.split("");
  for(var j=0;j<index.length;j++)
    {
      counter=index[j];
      str[counter]=str[counter].toUpperCase();      
    }
  str=str.join("");
  return str;
}

titleCase("HERE IS MY HANDLE HERE IS MY SPOUT");
ok why isnt it working :/
Coira Ellison
@Coira
Aug 19 2015 16:49
what's the exercise name? so i can have a look at the instructions
Coira Ellison
@Coira
Aug 19 2015 16:50
ok i see, you're basically there
except you've got some global variables (i.e index, and str)
Tahmid Zahin
@Zahin-10
Aug 19 2015 16:51
wo what's wrong with it imean it works fine but it say's wrong
Coira Ellison
@Coira
Aug 19 2015 16:51
if you put index inside the function it should be fine
(i was wrong about str)
Tahmid Zahin
@Zahin-10
Aug 19 2015 16:52
ohk great
let me chk
ohk wolud you care to explain why did that happen, i mean it's ok to declare global variables right??
Coira Ellison
@Coira
Aug 19 2015 16:53
global variables are generally a bad thing, and you want to avoid them as much as possible
Tahmid Zahin
@Zahin-10
Aug 19 2015 16:53
hmm Thanks @Coira
CamperBot
@camperbot
Aug 19 2015 16:53
zahin-10 sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
Coira Ellison
@Coira
Aug 19 2015 16:53
i'm not sure, but perhaps in this case because it's global, the grader can access index, and it messes something up
CamperBot
@camperbot
Aug 19 2015 16:53
:star: 169 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Aug 19 2015 16:54
np :)
bmdcm
@bmdcm
Aug 19 2015 16:58
hi
can anyone help me with the api from forismatic
This message was deleted
(function () {
var $request = $('#request');
var $quotes = $('#quotes');
$('#request').on('click',function() {
var forismaticAPI = "http://api.forismatic.com/api/1.0/?callback=?";
$.getJSON( forismaticAPI, {
method: "getQuote",
lang: "en",
format: "xml",
dataType: "json",
success:function(data) {
$('#quotes').append('<p> Quote: ' + this.quoteText + '</p>');
$('#quotes').append('<p>Author : ' + this.quoteAuthor+ '</p>');
}
});
});
});
i receive a Uncaught SyntaxError: Unexpected token <
is the first time using api :)
bmdcm
@bmdcm
Aug 19 2015 17:06
This message was deleted
CamperBot
@camperbot
Aug 19 2015 17:06
:bulb: to format code use backticks! ``` more info
bmdcm
@bmdcm
Aug 19 2015 17:07
This message was deleted
This message was deleted
This message was deleted
Marc Davenport
@oneate7
Aug 19 2015 17:08
Do three backticks, move to the next line, paste code, move to the next line, three backticks
bmdcm
@bmdcm
Aug 19 2015 17:09
thanks
$(function () {
 var $request = $('#request');
 var $quotes = $('#quotes');
    $('#request').on('click',function() {
        var forismaticAPI = "http://api.forismatic.com/api/1.0/?callback=?";
        $.getJSON( forismaticAPI, {
            method: "getQuote",
            lang: "en",
            format: "xml",
            dataType: "json",
            success:function(data) {
                $('#quotes').append('<p> Quote: ' + this.quoteText + '</p>');
                $('#quotes').append('<p>Author : ' + this.quoteAuthor+ '</p>');
            }
        });
    });
});
can anyone help me?
Moisés Man
@moigithub
Aug 19 2015 17:13

@bmdcm

$.ajax({
  dataType: "json",
  url: url,
  data: data,
  success: success
});

or
jQuery.getJSON( url [, data ] [, success ] )

or like this...

$.getJSON( flickerAPI, {
    tags: "mount rainier",
    tagmode: "any",
    format: "json"
  })
   .done(function( data ) { 
       //... 
} );

http://api.jquery.com/jquery.getjson/

Bill
@kirah1314
Aug 19 2015 17:17
@moigithub how about dataType: dataType? i'm on the same project :)
bmdcm
@bmdcm
Aug 19 2015 17:20
@moigithub like this?
$(function () {
 var $request = $('#request');
 var $quotes = $('#quotes');
    $('#request').on('click',function() {
        var forismaticAPI = "http://api.forismatic.com/api/1.0/?callback=?";
        $.getJSON( forismaticAPI, {
            method: "getQuote",
            lang: "en",
            format: "xml",
            dataType: "json",
        });
        .done(function ( data ) {
            $.each(forismatic.quote.quoteText, function(text) {
                quotes.append('<p> Quote: ' + text + '</p>');
            });
            $.each(forismatic.quote.quoteAuthor, function(author) {
                quotes.append('<p> Quote: ' + author + '</p>');
            });
    });
});
I receive an error on the line
.done(function ( data ) {
DTing
@dting
Aug 19 2015 17:22
@bmdcm you need to remove the ; before that .
@bmdcm also remove method: "getQuote"
@bmdcm link your codepen
I receive the error Uncaught SyntaxError: Unexpected token <
Julian Fernandes
@Noblelynx
Aug 19 2015 17:30

Would someone be able to explain to me why in this waypoint , the only even number shaking is target6, why doesn't target2 shake?

this is my code btw

<script>
  $(document).ready(function() {
    $("#target1").css("color", "red");
    $("#target1").prop("disabled", true);
    $("#target4").remove();
    $("#target2").appendTo("#right-well");
    $("#target5").clone().appendTo("#left-well");
    $("#target1").parent().css("background-color", "red");
    $("#right-well").children().css("color", "green");
    $("#left-well").children().css("color", "green");
    $(".target:nth-child(2)").addClass("animated bounce");
    $(".target:even").addClass("animated shake");

  });
</script>

<!-- You shouldn't need to modify code below this line -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <h4>#left-well</h4>
      <div class="well" id="left-well">
        <button class="btn btn-default target" id="target1">#target1</button>
        <button class="btn btn-default target" id="target2">#target2</button>
        <button class="btn btn-default target" id="target3">#target3</button>
      </div>
    </div>
    <div class="col-xs-6">
      <h4>#right-well</h4>
      <div class="well" id="right-well">
        <button class="btn btn-default target" id="target4">#target4</button>
        <button class="btn btn-default target" id="target5">#target5</button>
        <button class="btn btn-default target" id="target6">#target6</button>
      </div>
    </div>
  </div>
</div>
cooljoe21
@cooljoe21
Aug 19 2015 17:32
I need help with http://www.freecodecamp.com/challenges/waypoint-style-text-inputs-as-form-controls. I am not understanding what the third step means. Can I have some help?
Julian Fernandes
@Noblelynx
Aug 19 2015 17:33
have you tried adding the class "form-control" to the input element @cooljoe21 ?
cooljoe21
@cooljoe21
Aug 19 2015 17:34
no, I'll try that.
Moisés Man
@moigithub
Aug 19 2015 17:35
@bmdcm
method:"getquote"
its part of the api parameters,, add it again :)
 $.getJSON( forismaticAPI, {
          method:"getQuote",
            lang: "en",
            format: "xml",

        })
bmdcm
@bmdcm
Aug 19 2015 17:37
@Noblelynx
$('.target:even').addClass('animated shake');
Omar
@oab00
Aug 19 2015 17:37
@bmdcm um
getJSON then xml ?
which one u want ?
Irma Millirons
@badjedi
Aug 19 2015 17:37
Is there an reference or archive to answer questions, if someone had the same issue?
Julian Fernandes
@Noblelynx
Aug 19 2015 17:37
@bmdcm thanks, I got it working. But i just wanted to know why with ".target:even" the buttons that are shaking are odd ones?
CamperBot
@camperbot
Aug 19 2015 17:37
noblelynx sends brownie points to @bmdcm :sparkles: :thumbsup: :sparkles:
:star: 249 | @bmdcm | http://www.freecodecamp.com/bmdcm
bmdcm
@bmdcm
Aug 19 2015 17:39
@oab00 getJSON
@Noblelynx because of this
$(".target:nth-child(2)").addClass("animated bounce");
Julian Fernandes
@Noblelynx
Aug 19 2015 17:45

@bmdcm Even if i take out the line

$(".target:nth-child(2)").addClass("animated bounce");

They still seem to be the odd ones shaking (with the exception of target6)

Andrew Scalise
@AndrewScalise
Aug 19 2015 17:45

function largestOfFour(arr) {
// You can do this!
return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

looking for help on this one
how can i iterate over the multiple arrays?
lauratalaat
@lauratalaat
Aug 19 2015 17:47

Hi. I have to do this:Inside your script element, add this code: $(document).ready(function() { to your script. Then close it on the following line (still inside your script element) with: }); And
i write like this:
``

<script>
$(document).ready(function() { });
</script>

``
What it is inccorect?

Elizabeth Hatleli
@TheHighPriestess
Aug 19 2015 17:47
Does anyone know where I can find some GOOD examples of .filter() for arrays?
Not MDN.
lauratalaat
@lauratalaat
Aug 19 2015 17:47
<script>
$(document).ready(function() { });
</script>
Elizabeth Hatleli
@TheHighPriestess
Aug 19 2015 17:48
Their examples aren't helpful.
Sean
@seanr707
Aug 19 2015 17:49
anyone know what I am doing wrong with .scrollTop with jQuery?
  var pos = $('html, body, .' + sect).scrollTop();
  $('html, body').animate({
      "scrollTop": pos + 100
   });
Sean Campbell
@natac13
Aug 19 2015 17:49
He does really nice functional programming tutorials one of which is one filter
Elizabeth Hatleli
@TheHighPriestess
Aug 19 2015 17:51
@natac13 I don't see a video labeled that.
Do you know which one it is?
Tod
@thermobee
Aug 19 2015 17:53
function largestOfFour(arr) {
  var num = 0;
  var newarr = [];
  for (var i = 0; i < 4; i++) {
    for (var j = 0; j < 4; i++) {
      if ( arr[i][j] > num) {
        newarr.push(arr[i][j]);
      }
    }
    num = 0;
  }
  return newarr;
}
Can somebody tell me why this code isnt working?
tjstinso
@tjstinso
Aug 19 2015 17:56
what is the code supposed to do?
are you filtering a list? or trying to sort
Sean Campbell
@natac13
Aug 19 2015 17:58
first one
@thermobee yep
@thermobee put your puhs just above the num = 0 part as well I do not think it is good to hard code the value of 4 since the number of arrays in the given array could change
Tod
@thermobee
Aug 19 2015 18:01
put my what im sorry?
DTing
@dting
Aug 19 2015 18:01
@bmdcm
$(document).ready(function() {
  var $request = $('#request');
  var $quotes = $('#quotes');
  $('#request').on('click', function() {
    $.ajax({
      url: "http://api.forismatic.com/api/1.0/",
      jsonp: "jsonp",
      data: {
        lang: "en",
        method: "getQuote",
        format: "jsonp"
      },
      dataType: "jsonp",
      success: function(data) {
        console.log(data);
        $('#quotes').append('<p> Quote: ' + data.quoteText + '</p>');
        $('#quotes').append('<p> Author: ' + data.quoteAuthor + '</p>');
      }
    });
  });
});
Sean Campbell
@natac13
Aug 19 2015 18:02
@thermobee where it says newarr.push(arr[i][j]);
Tod
@thermobee
Aug 19 2015 18:02
why would i zero the counter everytime? how is it supposed to count?
btw the error that im getting is Cannot read property '0' of undefined
@natac13
Sean Campbell
@natac13
Aug 19 2015 18:04
ok so you need to check if the current value is bigger than the num and if so set the num to that value
lol yeah I got it now
Tod
@thermobee
Aug 19 2015 18:04
Ohhh im retarted
Sean Campbell
@natac13
Aug 19 2015 18:05
pair?
Tod
@thermobee
Aug 19 2015 18:05
you are right
DTing
@dting
Aug 19 2015 18:05
@thermobee The problem with your code is whenever you find a value that is larger than the current value you push it to the new array. You only want to push to the new array once per nested array
Sean Campbell
@natac13
Aug 19 2015 18:05
@dting thanks! yeah you have to search the whole array before pushing the value
CamperBot
@camperbot
Aug 19 2015 18:05
natac13 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 361 | @dting | http://www.freecodecamp.com/dting
Tod
@thermobee
Aug 19 2015 18:06
so you are saying, go through the whole inner loop, find the biggest number AND then push it to the array
@dting
DTing
@dting
Aug 19 2015 18:06
@thermobee another way if you want to solve it more functionally is to use arr.map and Math.max.apply
Tod
@thermobee
Aug 19 2015 18:07
@dting yeah i saw those online but i want to figure it out on my own :)
ivanhnavi
@ivanhnavi
Aug 19 2015 18:07
anybody have any advice on Exact change
DTing
@dting
Aug 19 2015 18:07
@ivanhnavi solve it in cents.
Tod
@thermobee
Aug 19 2015 18:07
@natac13 wanna pair up?
DTing
@dting
Aug 19 2015 18:08
@ivanhnavi otherwise you might have problems floating point inaccuracy.
Sean Campbell
@natac13
Aug 19 2015 18:08
Tod
@thermobee
Aug 19 2015 18:09
@natac13 check your private
ivanhnavi
@ivanhnavi
Aug 19 2015 18:09
@dting interesting , i'll see what I can do
Bill
@kirah1314
Aug 19 2015 18:11
@thermobee to not get the error, just have return newarr; under
      }
  newarr.push(arr[i][j]);
      }
Tod
@thermobee
Aug 19 2015 18:11
it still gives me the same error
@kirah1314
return newarr;
oops
Bill
@kirah1314
Aug 19 2015 18:12
function largestOfFour(arr) {
  var num = 0;
  var newarr = [];

  for (var i = 0; i < 4; i++) {
    for (var j = 0; j < 4; i++) {

      if ( arr[i][j] > num) {


       newarr.push(arr[i][j]);
      }
       return newarr;
    }
    num = 0;
  }

}
i got a return of 4
Tod
@thermobee
Aug 19 2015 18:12
ok 1 sec
but 4 is not right
4 is just the first number
it should be 5
DTing
@dting
Aug 19 2015 18:13
@thermobee if you return you will return out of the function.
Bill
@kirah1314
Aug 19 2015 18:13
I said to not get the error lol, I didn't say this will do what you want it to
Tod
@thermobee
Aug 19 2015 18:13
haha true
function largestOfFour(arr) {
  var num = 0;
  var newarr = [];
  for (var i = 0; i < 4; i++) {
    for (var j = 0; j < 4; i++) {
      if ( arr[i][j] > num) {
        num = arr[i][j];
      }  
    }
    newarr.push(arr[i][j]);
    num = 0;
  }
  return newarr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
I belive this should be the right code but its not working
DTing
@dting
Aug 19 2015 18:15
@thermobee now you are just pushing the last value of j into the newarr
@thermobee you probably want to push num
Tod
@thermobee
Aug 19 2015 18:15
jesus, whats is wrong with me today
@dting you are right
yeah i changed it but its still giving me the same error - Cannot read property '0' of undefined
DTing
@dting
Aug 19 2015 18:17
oh
your inner for loop you are incrementing i
instead of j
which means you are trying to read arr[5][0] at some point which is undefined.
Tod
@thermobee
Aug 19 2015 18:19
rofl
@dting you da man
as soon as I changed it to j++ it worked
bmdcm
@bmdcm
Aug 19 2015 18:28
@dting THANKS EXCELLENT
CamperBot
@camperbot
Aug 19 2015 18:28
bmdcm sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 364 | @dting | http://www.freecodecamp.com/dting
bmdcm
@bmdcm
Aug 19 2015 18:28
@dting saved the day
lauratalaat
@lauratalaat
Aug 19 2015 18:32

Hi. I have to do this:Inside your script element, add this code: $(document).ready(function() { to your script. Then close it on the following line (still inside your script element) with: }); And
i write like this:
``

<script>
$(document).ready(function() { });
</script>

``
What it is inccorect?

sorry

I have to do this:
Your left-well element should have a red background.
You should use the parent( function to modify this element.)
and my code is

 $("#left-well").parent().css("background-color", "red");

What is inccorect? Can anyone help me?

Rex Schrader
@SaintPeter
Aug 19 2015 18:34
@lauratalaat The target should be #target1, not #left-well - we're using the parent attribute to see the "parent" of #targat1
@lauratalaat You could also do the parent of #target2 or #target3 as well - their parents are all #left-well
jim3
@jim3
Aug 19 2015 18:35
Hi, the jQuery code runs in Free Code Camp fine but I'm trying to get it to animate/bounce in my browser as well. Does anyone know what I"m missing? Code is here: http://codepen.io/anon/pen/gpNpQv
lauratalaat
@lauratalaat
Aug 19 2015 18:36
@SaintPeter Thanks a lot. Now i understand.
Rex Schrader
@SaintPeter
Aug 19 2015 18:36
@lauratalaat NP
jim3
@jim3
Aug 19 2015 18:36
Ugh, sorry about that...should have logged in to show code here.
Rex Schrader
@SaintPeter
Aug 19 2015 18:37
@jim3 I don't see a button to animate
status
botstatus
CamperBot
@camperbot
Aug 19 2015 18:37
All bot systems are go!
botVersion: 0.0.11
env: prod
botname: camperbot
Rex Schrader
@SaintPeter
Aug 19 2015 18:40
@jim3 Ah, the problem is that you don't have the class definitions for either animated nor bounce - they are probably defined on the FCC site, but not on your codepen.
jim3
@jim3
Aug 19 2015 18:40
Ahhhh...okay, now I understand why. I figured those were include in the jQuery library
Tahmid Zahin
@Zahin-10
Aug 19 2015 18:41
function repeat(str, num) {
  // repeat after me
  num--;
  if(num>0)
  {
    repeat(str,num);
  }

  return str;
}

repeat('abc', 3);
what's wrong with it
recursion is not working, need some help .....
Rex Schrader
@SaintPeter
Aug 19 2015 18:41
@jim3 Nope - you could probably find them on the FCC site if you dug around
jim3
@jim3
Aug 19 2015 18:41
ok ty :thumbsup:
Rex Schrader
@SaintPeter
Aug 19 2015 18:42
@Zahin-10 You need to assign the value to repeat back to str. Right now you're 'return'ing the string, but you're not assigning it to anything.
DTing
@dting
Aug 19 2015 18:42
@jim3 it's animate.js
sorry animate.css
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.min.css">
jim3
@jim3
Aug 19 2015 18:44
@dting Cool, I'll play with it after a few more exercises. Thank you.
CamperBot
@camperbot
Aug 19 2015 18:44
jim3 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 367 | @dting | http://www.freecodecamp.com/dting
chellc
@chellc
Aug 19 2015 18:44
i completed 35 waypoints .. and all of my progress has disappeared HELP!
DTing
@dting
Aug 19 2015 18:46
@chellc did you change the way you log in?
Tahmid Zahin
@Zahin-10
Aug 19 2015 18:46
hmm ohk got it @SaintPeter thanks
CamperBot
@camperbot
Aug 19 2015 18:46
zahin-10 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 218 | @saintpeter | http://www.freecodecamp.com/saintpeter
chellc
@chellc
Aug 19 2015 18:48
HMM.. @dting YES! I signed in w github instead of linked in, phew! thanks !
CamperBot
@camperbot
Aug 19 2015 18:48
chellc sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 368 | @dting | http://www.freecodecamp.com/dting
Cornelious Tujare
@Andy9860
Aug 19 2015 18:48
m getting an error please help
Mahtab
@RoadToCode822
Aug 19 2015 18:50
I need help
Damon Anderson
@CoderNurse
Aug 19 2015 18:52
On all of the waypoints/bonfires, if I get stuck and click the "Help" button, and then click "Take me to the help room" from the popup window, the link is broken and does nothing. Am I the only one?
Cody Bouscaren
@codybousc
Aug 19 2015 18:55
Hey all, I'm a bit confused what 'Waypoint: Condense arrays with .reduce' is asking us to do. Actually, it describes what the .reduce method does and doesn't ask to do anything with it. Any advice ?
Waypoint: Condense arrays with reduce
Reduce can be useful for condensing and array or numbers into one value.

var singleVal = array.reduce(function(previousVal, currentVal){

  return(previousVal+currentVal);

});
DTing
@dting
Aug 19 2015 18:57
@codybousc I think it wants you to find the sum of the array
basically they gave you the answer
Cody Bouscaren
@codybousc
Aug 19 2015 18:58
hmm, i just copied the example code verbatim and it passed?
DTing
@dting
Aug 19 2015 18:58
ya
Cody Bouscaren
@codybousc
Aug 19 2015 18:58
hmm
ok
i'm not sure that taught me how to use reduce, but onward i march
Cody Bouscaren
@codybousc
Aug 19 2015 19:06
all of the object oriented waypoints seemed a little simplistic and not necessarily geared towards OO programming. splitting and joining arrays?
DTing
@dting
Aug 19 2015 19:09
thats probably the functional part
"Object Oriented and Functional Programming"
Gina Lee
@leegina
Aug 19 2015 19:23

help!
i don't know why this code isn't passing the test..

return(Math.floor(Math.random() * (10 - 2 + 1)) + 2);

i'm trying to generate a random number in a range, and apparently, this isn't cutting it
Rich Churcher
@richchurcher
Aug 19 2015 19:25
Well, for starters 10 - 2 + 1 is the same as 10 - 1 ;)
but to generate a random in a range:
Math.random() * (max - min) + min;
that will include min and exclude max
Gina Lee
@leegina
Aug 19 2015 19:26
@richchurcher the waypoint assignment gave this format: Math.floor(Math.random() * (max - min + 1)) + min
DTing
@dting
Aug 19 2015 19:27
@leegina they just want you to paste that code in
Rich Churcher
@richchurcher
Aug 19 2015 19:29
ah I see what you're working on... yep, if you lead with Math.floor() you get inclusive for both limits
perhaps you should show your whole code?
Gina Lee
@leegina
Aug 19 2015 19:29
@dting thank you...
CamperBot
@camperbot
Aug 19 2015 19:29
leegina sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 374 | @dting | http://www.freecodecamp.com/dting
Gina Lee
@leegina
Aug 19 2015 19:30
@richchurcher i think I was doing the right thing, but since I was working on a waypoint, they wanted me to just paste Math.floor(Math.random() * (max - min + 1)) + min in the code
thank you everyone for your help
CamperBot
@camperbot
Aug 19 2015 19:30
if you want to thank someone, put an @ before their name!
RC Maples
@rcmaples
Aug 19 2015 19:34

Can someone help me with making a button work on bootstrap? I have a button that looks like this:

<button type="button" id="new" class="btn btn-primary">New Quote <i class="fa fa-arrow-circle-right"></i></button>

And javascript that looks like this:

$(document).ready(function(){
     $("#new").click(function(){
        alert("Hi!") ;
     });
 });
But the button won't act like a normal bootstrap button, and it won't click.
DTing
@dting
Aug 19 2015 19:39
@rcmaples what are you coding that on? codepen?
Mohamed A. Farouk
@captainmoha
Aug 19 2015 19:39
@rcmaples The code works well with me.
@rcmaples Make sure you're linking bootstrap and jquery
RC Maples
@rcmaples
Aug 19 2015 19:39
Yeah, I'm on code pen. http://codepen.io/rcmaples/pen/JdQYEJ
Jerry Robles
@jerryrobles
Aug 19 2015 19:40
anyone having issues with the completed challenge buttons not working?
RC Maples
@rcmaples
Aug 19 2015 19:41
@dting @captainmoha I've been coding everything in cloud 9, here's the script includes from my main html:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
  <script src="./js/script.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.js"></script>
seth dehaan
@sethxd
Aug 19 2015 19:42
Can anyone take a look at my code from the Mutations bonfire?
blob
checks out fine on all tests except the first
DTing
@dting
Aug 19 2015 19:43
@rcmaples you have something covering your buttons
@rcmaples hmm nm lemme look again sorry
RC Maples
@rcmaples
Aug 19 2015 19:46
@dting hrm I set the .panel panel defualt z-index to -1 to get the h2 banner to sit down on top of it.
DTing
@dting
Aug 19 2015 19:46
@rcmaples
<div class="col-md-6 col-md-offset-3" style="z-index:-1"> remove the style
and you can click your button
RC Maples
@rcmaples
Aug 19 2015 19:46
well crap. I'll figure out how to get that typeof styling another way then. I've been trying to click that button for an hour now. Thanks @dting !
CamperBot
@camperbot
Aug 19 2015 19:46
rcmaples sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 376 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 19 2015 19:47
@sethxd you dont want to return until after the for loop for true
seth dehaan
@sethxd
Aug 19 2015 19:48
@dting are you sure? i tried placing it outside the loop, and it makes all the other tests fail but the first pass
DTing
@dting
Aug 19 2015 19:49
let me look at your code again
@sethxd oh. ya move it outside. and change your loop to < instead of <=
Aleksandar B.
@aleksandar-b
Aug 19 2015 19:52
What is this referingto in Angular controller?
CamperBot
@camperbot
Aug 19 2015 19:52
:trollface: troll problems? notify admins here
seth dehaan
@sethxd
Aug 19 2015 19:53
awesome, that did the trick! thanks @dting !
CamperBot
@camperbot
Aug 19 2015 19:53
sethxd sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 377 | @dting | http://www.freecodecamp.com/dting
CamperBot
@camperbot
Aug 19 2015 19:53
:trollface: troll problems? notify admins here
Aleksandar B.
@aleksandar-b
Aug 19 2015 19:56
@dting didn't find the reference to keyword this... Did you watch videos that FCC linked to on Angular. In some lessons he was using this keyword, but I don't remember where, i think it was in controller.
CamperBot
@camperbot
Aug 19 2015 19:56
:trollface: troll problems? notify admins here
DTing
@dting
Aug 19 2015 19:57
oh. "this"
gotcha
if you use the "controller as" convention, "this" is accessible in the view.
CamperBot
@camperbot
Aug 19 2015 19:58
:trollface: troll problems? notify admins here
DTing
@dting
Aug 19 2015 20:00

so like

var app = angular.module('myapp', []);
app.controller('myController', function() {
  this.greeting = "hello world";
});

and

<div ng-app="myapp">
   <div ng-controller="myController as ctrl">
     {{ ctrl.greeting }}
  </div>
</div>
CamperBot
@camperbot
Aug 19 2015 20:00
:trollface: troll problems? notify admins here
DTing
@dting
Aug 19 2015 20:00
oops
Joris Labie
@labiej
Aug 19 2015 20:00
lol controller
CamperBot
@camperbot
Aug 19 2015 20:00
:trollface: troll problems? notify admins here
Joris Labie
@labiej
Aug 19 2015 20:01
it's as if camperbot is trolling itself
CamperBot
@camperbot
Aug 19 2015 20:01
:trollface: troll problems? notify admins here
Aleksandar B.
@aleksandar-b
Aug 19 2015 20:02
@dting so, if I am using "exampleControler as product" and then do "ng-repeat = product.something" the this keyword means product or something?
DTing
@dting
Aug 19 2015 20:03
this means exampleController
CamperBot
@camperbot
Aug 19 2015 20:03
:trollface: troll problems? notify admins here
DTing
@dting
Aug 19 2015 20:03
which you aliased as product
so in your exampleController if you had this.something = ["hi", "world"]; you would get a repeat
CamperBot
@camperbot
Aug 19 2015 20:04
:trollface: troll problems? notify admins here
Aleksandar B.
@aleksandar-b
Aug 19 2015 20:05
@dting thank you.
CamperBot
@camperbot
Aug 19 2015 20:05
samosale sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 378 | @dting | http://www.freecodecamp.com/dting
Guudow
@Guudow
Aug 19 2015 20:22
need held.. Give your form element the id of cat-photo-form.
Aleksandar B.
@aleksandar-b
Aug 19 2015 20:34
@dting do I need to use convention "Controler as " or not? In other tutorials i have never seen that..
DTing
@dting
Aug 19 2015 20:34
if you want to use "this" then you use controller as. Otherwise people use $scope
CamperBot
@camperbot
Aug 19 2015 20:34
:trollface: troll problems? notify admins here
Aliza
@alizagoldberg
Aug 19 2015 20:43

Hi, folks. I have a question about the Git section. I have been working through the challenges on Git-It while using Cloud9. I'm on the Commit challenge and keeping failing but don't know why:

$ git add read-me.txt
alizagoldberg@nodejs:~/workspace/hello-world (master) $ git commit -m "Added a line, hope it works now"
[master fd63cc4] Added a line, hope it works now
1 file changed, 1 insertion(+), 1 deletion(-)
alizagoldberg@nodejs:~/workspace/hello-world (master) $ git-it verify
Verifying "COMMIT TO IT"...

ACTUAL EXPECTED


"Seems there are changes" != "Changes have been committed!"
"to commit still." != ""
"" != null

FAIL

CamperBot
@camperbot
Aug 19 2015 20:43

welcome to FreeCodeCamp @alizagoldberg!

DTing
@dting
Aug 19 2015 20:56
@alizagoldberg try deleting the file and remaking it
Krzysztof Miąsko
@kmiasko
Aug 19 2015 20:58
@alizagoldberg remove repo, do it again
it's working for me
oh @alizagoldberg add something inside that file
if file is empty commit will ignore it if i recall
Carla Berjano
@CarlaBpt
Aug 19 2015 21:00
Hi, I need help! Is there any issue with my code? $(document).ready(function() {
$("button").addClass(animated);
$(".btn").addClass(shake);
$("#target1").addClass(btn-primary);
});
This is Waypoint: Target the same element with multiple jQuery Selectors, and it's not taking it as completed
Owen
@owencampbell
Aug 19 2015 21:01
@CarlaBpt Try adding class names as strings e.g. “animated"
Carla Berjano
@CarlaBpt
Aug 19 2015 21:01
okay let me try that
wow that was it! thanks @owencampbell !
CamperBot
@camperbot
Aug 19 2015 21:02
carlabpt sends brownie points to @owencampbell :sparkles: :thumbsup: :sparkles:
:star: 95 | @owencampbell | http://www.freecodecamp.com/owencampbell
Owen
@owencampbell
Aug 19 2015 21:02
NP
Carla Berjano
@CarlaBpt
Aug 19 2015 21:02
although there's something I'm not picking
those class names, aren't they functions?
anyway, it's already 10PM, time to go to get! will look this up tomorrow. Everyone, have a great evening!
*bed
galacticfan
@galacticfan
Aug 19 2015 21:05
Hey, anybody else having trouble clicking the 'I have completed this button' on the build a portfolio page zipline? http://www.freecodecamp.com/challenges/zipline-build-a-personal-portfolio-webpage
Owen
@owencampbell
Aug 19 2015 21:05
@CarlaBpt No, their just class names
DTing
@dting
Aug 19 2015 21:05
@galacticfan use control enter
Owen
@owencampbell
Aug 19 2015 21:05
@CarlaBpt addClass is the method
DTing
@dting
Aug 19 2015 21:05
@galacticfan ctrl-enter to submit i think theres a bug
Carla Berjano
@CarlaBpt
Aug 19 2015 21:05
Oh, okay. Thanks!
CamperBot
@camperbot
Aug 19 2015 21:05
if you want to thank someone, put an @ before their name!
galacticfan
@galacticfan
Aug 19 2015 21:06
@dting that doesn't seem to work either :/
Owen
@owencampbell
Aug 19 2015 21:07
@CarlaBpt No problem.
DTing
@dting
Aug 19 2015 21:07
@galacticfan hmm you dont get the pop up?
galacticfan
@galacticfan
Aug 19 2015 21:07
@dting Nope
DTing
@dting
Aug 19 2015 21:07
@galacticfan are you on a mac
galacticfan
@galacticfan
Aug 19 2015 21:07
PC
wait
DTing
@dting
Aug 19 2015 21:08
hmm no idea. ctrl-enter works for me
galacticfan
@galacticfan
Aug 19 2015 21:08
different browser works
Krzysztof Miąsko
@kmiasko
Aug 19 2015 21:17
yeah ctrl+enter on firefox only
DTing
@dting
Aug 19 2015 21:18
im on osx chrome and ctrl enter worked
Balmes Tejeda
@BalmesTejeda
Aug 19 2015 21:18

Hello, I'm on waypoint 22 of html5 and css "Nest an Anchor Element within a Paragraph". The directions say, "Now nest your a element within a new p element so that the surrounding paragraph says "click here for cat photos", but where only "cat photos" is a link, and the rest of the text is plain text"
Here's the snippet of code. It says everything is correct except that the a element is not nested. Is this just a bug?

<p>click here for <a href="http://catphotoapp.com">cat photos</a> </p>
not sure how this is not nested

Krzysztof Miąsko
@kmiasko
Aug 19 2015 21:18
lol, chromium on Linux did not
DTing
@dting
Aug 19 2015 21:20
@BalmesTejeda take the space out from after the a
Jelani Thompson
@JelaniThompson
Aug 19 2015 21:20
Hey guys, dumb question. In HTML how can you align a text box?
DTing
@dting
Aug 19 2015 21:20
@BalmesTejeda err closing tag
Cody Bouscaren
@codybousc
Aug 19 2015 21:20
does anyone have any good resources for getting down object oriented JS. maybe it's just me, but i don't feel like the waypoints prepared me for the challenges.
Jelani Thompson
@JelaniThompson
Aug 19 2015 21:21
Right now I'm trying everything but it doesn't wanna move
However, floats work but too bad there isn't a float:center option
DTing
@dting
Aug 19 2015 21:21
@JelaniThompson can you be more specific?
Balmes Tejeda
@BalmesTejeda
Aug 19 2015 21:21
thanks @dting trying
CamperBot
@camperbot
Aug 19 2015 21:21
balmestejeda sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
DTing
@dting
Aug 19 2015 21:21
text inside the box?
CamperBot
@camperbot
Aug 19 2015 21:21
:star: 381 | @dting | http://www.freecodecamp.com/dting
Jelani Thompson
@JelaniThompson
Aug 19 2015 21:22
I have this
<input type="text" id="ascii-box">
And when I'm trying to center it in the CSS, it doesn't wanna move
ivanhnavi
@ivanhnavi
Aug 19 2015 21:22
@codybousc have you checked out CodeWars?
DTing
@dting
Aug 19 2015 21:23
css depends on the context if that input is in an element that spans the page you could do #ascii-box { margin: 0 auto; }
Cody Bouscaren
@codybousc
Aug 19 2015 21:23
@ivanhnavi i haven't. do they have tutorials as well as code challenges?
ivanhnavi
@ivanhnavi
Aug 19 2015 21:24
it helped me quite a bit, the difficulty of the exercises ranges from really basic to however hard people can come up with, what helped me the most was that after submitting your answers you get to see other peoples answers and see how they solved it. It's really helpful
Balmes Tejeda
@BalmesTejeda
Aug 19 2015 21:24
@dting still not working
Jelani Thompson
@JelaniThompson
Aug 19 2015 21:24
I think CodeWars takes less of a tutorial approach
Better for people who are good at self studying
ivanhnavi
@ivanhnavi
Aug 19 2015 21:24
not tutorials but the challenges start off very easy and then you just work your way up
Balmes Tejeda
@BalmesTejeda
Aug 19 2015 21:24

i copy paste the example

<p>Here's a <a href="http://freecodecamp.com"> link to Free Code Camp</a> for you to follow.</p>

and replace with what they are asking
DTing
@dting
Aug 19 2015 21:24
worked for me
@BalmesTejeda hmm try reloading the page
<p>click here for <a href="http://www.catphotoapp.com">cat photos</a></p>
Balmes Tejeda
@BalmesTejeda
Aug 19 2015 21:24
<p>click here for <a href='http://catphotoapp.com'> cat photos </a> </p>
Jelani Thompson
@JelaniThompson
Aug 19 2015 21:26
@dting yeah, that isn't working
He's my CP project if it's of any help
Balmes Tejeda
@BalmesTejeda
Aug 19 2015 21:26
reloaded and copy-pasted, now it passes. thanks!
CamperBot
@camperbot
Aug 19 2015 21:26
if you want to thank someone, put an @ before their name!
Cody Bouscaren
@codybousc
Aug 19 2015 21:26
@ivanhnavi how do they differ in difficulty to the challenges here?
Jelani Thompson
@JelaniThompson
Aug 19 2015 21:26
DTing
@dting
Aug 19 2015 21:26
@BalmesTejeda i think it's using regex, you needed the www in the url
Jelani Thompson
@JelaniThompson
Aug 19 2015 21:26
I have the basic functionality of the program down and just want to make it prettier now
Balmes Tejeda
@BalmesTejeda
Aug 19 2015 21:26
ah, ok. thanks again @dting
CamperBot
@camperbot
Aug 19 2015 21:26
balmestejeda sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: balmestejeda already gave dting points
ivanhnavi
@ivanhnavi
Aug 19 2015 21:29
@codybousc i would say the range in difficulty is a lot greater, if you want to ease your way up into harder stuff you can do that there because of all the different challenges. whereas in CFC I feel like the exercises changed in difficulty pretty quickly and fast.
ivanhnavi
@ivanhnavi
Aug 19 2015 21:32
@codybousc Also what helped me the most was getting to see other peoples code after I had submitted my own. Sometimes your code will be a lot longer than the really elegant solutions some people come up with but then then at other times you look at your code and you see that other people overthought it or made it way more complicated than it had to be. That's kind of what helped push me, if i struggled I can see that I didn't struggle as much as other people, as bad as that may sound
but at the end of the day we are all working towards the same goal!
Cody Bouscaren
@codybousc
Aug 19 2015 21:32
@ivanhnavi ok, i'll definitely check it out! thank you!
CamperBot
@camperbot
Aug 19 2015 21:32
codybousc sends brownie points to @ivanhnavi :sparkles: :thumbsup: :sparkles:
:star: 269 | @ivanhnavi | http://www.freecodecamp.com/ivanhnavi
Jelani Thompson
@JelaniThompson
Aug 19 2015 21:34
Thanks again! @dting
CamperBot
@camperbot
Aug 19 2015 21:34
jelanithompson sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 382 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 19 2015 21:35
@codybousc i agree with @ivanhnavi I think when learning your first language looking at other people's code isnt even a bad thing if you dont know where to start. The important thing is to go and read up and try to understand what that code is doing. not punch it in and move on. But looking at and understanding other people's solutions to see different tools they use is a great way learn a language.
different people ahve different approaches to learning of course.
@JelaniThompson np
RC Maples
@rcmaples
Aug 19 2015 21:57
Hello, has anyone succesfully made a call to the forismatic api on the quotes zipline?
DTing
@dting
Aug 19 2015 21:58
@rcmaples ya it's a bit confusing.
@rcmaples are you using jquery?
RC Maples
@rcmaples
Aug 19 2015 21:59
@dting Yes, was trying to do it with XHMLHttpRequest(); …
one sec and I can grab my code.
Randy Goldsmith
@Dueldrawer8
Aug 19 2015 21:59
var str = str.replace(/[^a-zA-Z0-9]+/gi, '').toLowerCase();
does this code replace all the letters, numbers and punctuation taking them out and then making them all lowercase?
DTing
@dting
Aug 19 2015 22:00
@Dueldrawer8 you dont need a plus there in the regex but it looks like it will replace anything that isnt a letter or number with "" and then lowercase the result
RC Maples
@rcmaples
Aug 19 2015 22:02

@dting

function getQuote(){

    var xhr = new XMLHttpRequest();
    xhr.open("GET","http://api.forismatic.com/api/1.0/?method=getQuote?format=json?lang=en");
    xhr.send();
    //alert(xhr.status);
    alert(xhr.response);
    }

I’m using the alert right now as a sort of console.log().

Randy Goldsmith
@Dueldrawer8
Aug 19 2015 22:02
im doing the beg algorithm palindrome and had no idea where to start so i cheated and looked up answer
DTing
@dting
Aug 19 2015 22:02
@rcmaples is this in codepen?
Moisés Man
@moigithub
Aug 19 2015 22:03
RC Maples
@rcmaples
Aug 19 2015 22:03
The alert, however comes back empty. @dting yes it is: http://codepen.io/rcmaples/pen/JdQYEJ @moigithub I’ll give that a try. Chrome console keeps coming back with an error about not being https to forismatic.
(the only working button right now is “new quote” it calls the function.
DTing
@dting
Aug 19 2015 22:04
@rcmaples I would suggest using jquery's $.ajax
but one sec i'll take a look
RC Maples
@rcmaples
Aug 19 2015 22:05
@dting Ok. I’ll dig in to the docs for that then.
DTing
@dting
Aug 19 2015 22:08
@rcmaples your current code is always empty because XMLHttpRequest are asyncronous. you are executing the alert before it returns. The other problem is you are going to need to use jsonp
Moisés Man
@moigithub
Aug 19 2015 22:09
@rcmaples yes.. it return blank cuz its (by default) async request...
mean u send a server petition... and ur code keep execute,, then server back with response.. so when u alert.. it return empty cuz server still processing
RC Maples
@rcmaples
Aug 19 2015 22:10
@dting @moigithub Ahh. Okay, that makes sense…
Moisés Man
@moigithub
Aug 19 2015 22:10
This message was deleted
This message was deleted
RC Maples
@rcmaples
Aug 19 2015 22:12
Alright.. I’ll read up on xmlhttp and .ajax some more and see which one I can make work. Thanks @moigithub & @dting
CamperBot
@camperbot
Aug 19 2015 22:12
rcmaples sends brownie points to @moigithub and @dting :sparkles: :thumbsup: :sparkles:
:star: 3 | @moigithub | http://www.freecodecamp.com/moigithub
:star: 384 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 19 2015 22:14
@rcmaples https://learn.jquery.com/ajax/working-with-jsonp/ if you use $.ajax the jsonp property of the object needs to be "jsonp" it looks weird jsonp: "jsonp"
a lot of people get tied up on that when using that api i think
Mahtab
@RoadToCode822
Aug 19 2015 22:24
How come my progress got wiped out
Monoxide27
@Monoxide27
Aug 19 2015 22:24
@RoadToCode822 I thought the same thing man; they added their own lessons for JQ and JS, so we don't need to go to codecademy anymore
our waypoints from before are still completed, unles sthey've changed them (like CSS hex codes)
Mahtab
@RoadToCode822
Aug 19 2015 22:25
I did around 106 waypoints or more and none of them show
Right now i only have 3 completed, the ones I just did
DTing
@dting
Aug 19 2015 22:26
@RoadToCode822 are you loggin in the same way?
Monoxide27
@Monoxide27
Aug 19 2015 22:26
^ was just going to ask that
Mahtab
@RoadToCode822
Aug 19 2015 22:28
what do you mean by “the same way”?
I’m logging into the correct account, if that’s what your asking
you’re*
Jamie King
@king0120
Aug 19 2015 22:56
bonfire Exact Change
CamperBot
@camperbot
Aug 19 2015 22:56

:fire:Bonfire: Exact Change :link:

function drawer(price, cash, cid) {
  var change;
  // Here is your change, ma'am.
  return change;
}

// Example cash-in-drawer array:
// [['PENNY', 1.01],
// ['NICKEL', 2.05],
// ['DIME', 3.10],
// ['QUARTER', 4.25],
// ['ONE', 90.00],
// ['FIVE', 55.00],
// ['TEN', 20.00],
// ['TWENTY', 60.00],
// ['ONE HUNDRED', 100.00]]

drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);

Design a cash register drawer function that accepts purchase price as the first argument, payment as the second argument, and cash-in-drawer (cid) as the third argument.

more info:  bf details | bf links | hint

Jamie King
@king0120
Aug 19 2015 22:56
hint
CamperBot
@camperbot
Aug 19 2015 22:56
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Monoxide27
@Monoxide27
Aug 19 2015 23:00
woah, didn't know you could do that
DTing
@dting
Aug 19 2015 23:03
camperbot is pretty awesome
dc
@dcsan
Aug 19 2015 23:08
@dting camperbot needs some love and new features tho hint hint :heart_eyes:
DTing
@dting
Aug 19 2015 23:09
i'm removing whoami haha
dc
@dcsan
Aug 19 2015 23:10
haha. baby steps!
have you got it running locally?
DTing
@dting
Aug 19 2015 23:13
ya.
dc
@dcsan
Aug 19 2015 23:15
what about the retweet thing then?
was that something you're interested in? @dting ?
twitter link is cool and all, just not sure how much FCC account tweets...
DTing
@dting
Aug 19 2015 23:15
@dcsan I was thinking about it.
dc
@dcsan
Aug 19 2015 23:16
but crossposting other stuff to social media
or @QuincyLarson quora feed in here... he's pretty active on various other media
DTing
@dting
Aug 19 2015 23:16
@dcsan It tweets a fair bit. I think when the servers were down it was tweeting thats why i was thinking about adding it.
dc
@dcsan
Aug 19 2015 23:16
or a digest of new wiki pages to camperNews
ah sure. at times of crisis. the EBN
hopefully we won't have too many of those!
DTing
@dting
Aug 19 2015 23:17
lol ya. It usually just tweets like people's ziplines and some interesting links. could ask quincy if he wants it echoed here first.
we have wiki updates too
"whats new today" on wiki could be interesting daily news
@danraley was talking about sth like that
AaronOoooo
@AaronOoooo
Aug 19 2015 23:45
I am having trouble with Waypoint: Target a Specific Child of an Element Using jQuery. Looking for help with completing the first task. Code coming...
<script>
  $(document).ready(function() {
    $("#target1").css("color", "red");
    $("#target1").prop("disabled", true);
    $("#target4").remove();
    $("#target2").appendTo("#right-well");
    $("#target5").clone().appendTo("#left-well");
    $("#target1").parent().css("background-color", "red");
    $("#right-well").children().css("color", "green");
    $(".well:nth-child(2)").addClass("animated bounce");

  });
</script>

<!-- You shouldn't need to modify code below this line -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <h4>#left-well</h4>
      <div class="well" id="left-well">
        <button class="btn btn-default target" id="target1">#target1</button>
        <button class="btn btn-default target" id="target2">#target2</button>
        <button class="btn btn-default target" id="target3">#target3</button>
      </div>
    </div>
    <div class="col-xs-6">
      <h4>#right-well</h4>
      <div class="well" id="right-well">
        <button class="btn btn-default target" id="target4">#target4</button>
        <button class="btn btn-default target" id="target5">#target5</button>
        <button class="btn btn-default target" id="target6">#target6</button>
      </div>
    </div>
  </div>
</div>
DTing
@dting
Aug 19 2015 23:47
@AaronOoooo put a space between well and :nth-child
AaronOoooo
@AaronOoooo
Aug 19 2015 23:48
@dting THANK YOU!
CamperBot
@camperbot
Aug 19 2015 23:48
aaronooooo sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 389 | @dting | http://www.freecodecamp.com/dting
YI JIANG
@meet999
Aug 19 2015 23:50
how to send pic?
00000000000000000000000000000.jpg