These are chat archives for FreeCodeCamp/Help

16th
Nov 2015
Rahul Roy
@Roy1990
Nov 16 2015 00:07
@hansinla But a 'new Boolean();' will hava a Premetive Value false for [false, null, 0, NaN, undefined, ""] values. though its boolean value is true.

function bouncer(arr) {
// Don't show a false ID to this bouncer.

var arr1=arr.filter(function(f){
var x=new Boolean(f); console.log(f, x.valueOf());
return x.valueOf();

});
return arr1;
}

bouncer([7, "ate", "", false, 9]);

Hans van Riet
@hansinla
Nov 16 2015 00:08
@Roy1990 But it’s an object not a primitive. You could do
var myBool = new Boolean();
myBool.anotherProp = “See?”;
Eric James
@LyteTec
Nov 16 2015 00:11
How do I add a i element? Add an i element with the classes fa and fa-thumbs-up.
Nest your i element within your button element.
Make sure your i element has a closing tag.
Shannon
@smckinney1
Nov 16 2015 00:12
I'm having trouble understanding what's going on in Bring your JavaScript Slot Machine to Life. It seems like the first jQuery segment near the top is accessing the array that doesn't exist until the end of the function in the "return" statement. Am I correct; does it not matter within a function if the array isn't created till the end?
alt
Hans van Riet
@hansinla
Nov 16 2015 00:12
@LyteTec These are opening and closing i tags
<i></i>
Eric James
@LyteTec
Nov 16 2015 00:13
ah I see, thanks @hansinla
CamperBot
@camperbot
Nov 16 2015 00:13
lytetec sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 584 | @hansinla | http://www.freecodecamp.com/hansinla
Eric James
@LyteTec
Nov 16 2015 00:20
How do I solve this? I am stuck. I know how to do the <i></i> closing tags. Not sure how to nest this inside a button element
dwitjes89
@dwitjes89
Nov 16 2015 00:20
Good evening everyone. Go Lions!
Eric James
@LyteTec
Nov 16 2015 00:20
Add an i element with the classes fa and fa-thumbs-up.
Nest your i element within your button element.
Make sure your i element has a closing tag.
Cosimo Bressi
@cbressijr
Nov 16 2015 00:20
var ourArray = ["Stimpson", "J", ["cat"]];

ourArray.pop(); // ourArray now equals ["Stimpson", "J"]

ourArray.push(["happy", "joy"]); // ourArray now equals ["Stimpson", "J", ["happy", "joy"]]

var myArray = ["John", 23, ["cat", 2]];

myArray.pop();

// Only change code below this line.

myArray.push(["dog"], 3);

// Only change code above this line.

(function(z){return 'myArray = ' + JSON.stringify(z);})(myArray);
Craig Morrison
@frogmorton
Nov 16 2015 00:20
@LyteTec do you know how to nest any other kind of tag?
Eric James
@LyteTec
Nov 16 2015 00:21
Yes
Cosimo Bressi
@cbressijr
Nov 16 2015 00:21
ON the array with push and its not giving me a move ahead or an error is there a bug or something I missed in the code?
Eric James
@LyteTec
Nov 16 2015 00:21
class="btn btn-block btn-danger"
<div class="col-xs-4">
<button class="btn btn-block btn-danger">Delete</button>
</div>
Craig Morrison
@frogmorton
Nov 16 2015 00:22
Ok, great. That's it. Same concept, different tags
Eric James
@LyteTec
Nov 16 2015 00:22
I am still a bit confused.
I have to close the i tag
Alexander Køpke
@alexanderkopke
Nov 16 2015 00:23
Delete is the text of button
could you put the i tags around that?
Eric James
@LyteTec
Nov 16 2015 00:23
Let me check
Craig Morrison
@frogmorton
Nov 16 2015 00:23
You have the text delete inside the button tags, right? Not around delete, to the left of it.
There will be nothing between the i tags
Alexander Køpke
@alexanderkopke
Nov 16 2015 00:24
oO
Eric James
@LyteTec
Nov 16 2015 00:24
Hmm, let me try.
Hans van Riet
@hansinla
Nov 16 2015 00:24
@LyteTec And don’t forget to add the fa classes to the <i> tag
Eric James
@LyteTec
Nov 16 2015 00:25
class="fa fa-thumbs-up" is this it?
Craig Morrison
@frogmorton
Nov 16 2015 00:25
The I tags with the appropriate classes are how you get your icons
Alexander Køpke
@alexanderkopke
Nov 16 2015 00:25
ok I must have misunderstood what nesting means then
Hans van Riet
@hansinla
Nov 16 2015 00:25
@LyteTec yes
Eric James
@LyteTec
Nov 16 2015 00:25
THanks
@frogmorton and @hansinla
Craig Morrison
@frogmorton
Nov 16 2015 00:27
@alexanderkopke it's still nested if both opening and closing tags are inside another pair of different element's tags, right?
Alexander Køpke
@alexanderkopke
Nov 16 2015 00:27
I thought this was nesting.. <button>text</button> so now I nest the <i> tags inside the button tags.. <button><i></i></button>
Craig Morrison
@frogmorton
Nov 16 2015 00:27
That IS nesting, you're right.
Hans van Riet
@hansinla
Nov 16 2015 00:28
@alexanderkopke correct
Craig Morrison
@frogmorton
Nov 16 2015 00:28
It's just, they didn't ask for text "Delete" to be nested in the <i> tags
Alexander Køpke
@alexanderkopke
Nov 16 2015 00:29
ah now I understand
Craig Morrison
@frogmorton
Nov 16 2015 00:29
Multiple items can be nested side by side
Eric James
@LyteTec
Nov 16 2015 00:29
So what did I do wrong?
<button <i> class="fa fa-thumbs-up" >Like</i></button>
Craig Morrison
@frogmorton
Nov 16 2015 00:30
Class belongs within the i tag's >
Eric James
@LyteTec
Nov 16 2015 00:30
Ah I see
Craig Morrison
@frogmorton
Nov 16 2015 00:31
And like to the right of the closing tag
Eric James
@LyteTec
Nov 16 2015 00:31
Thanks that worked @frogmorton
CamperBot
@camperbot
Nov 16 2015 00:31
lytetec sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:star: 328 | @frogmorton | http://www.freecodecamp.com/frogmorton
Craig Morrison
@frogmorton
Nov 16 2015 00:31
Great job!
Eric James
@LyteTec
Nov 16 2015 00:31
Thanks
Hans van Riet
@hansinla
Nov 16 2015 00:32
@LyteTec Your <i> tag is INSIDE the button tag, that’s not correct.
Craig Morrison
@frogmorton
Nov 16 2015 00:32
Which was meant to be nested inside of which?? (According to the waypoint?)
Hans van Riet
@hansinla
Nov 16 2015 00:33
@frogmorton He has this: <button <i> class="fa fa-thumbs-up” >He’ll need to close the button tag first
Craig Morrison
@frogmorton
Nov 16 2015 00:34
He already fixed that
Hans van Riet
@hansinla
Nov 16 2015 00:34
@frogmorton He didn’t post that
Craig Morrison
@frogmorton
Nov 16 2015 00:34
The assignment said "Nest your i element within your button element."
You're right, he didn't. But he said it worked, when I mentioned the appropriate syntax fixes
Hans van Riet
@hansinla
Nov 16 2015 00:36
@frogmorton I just want to make sure he understands the syntax
Craig Morrison
@frogmorton
Nov 16 2015 00:37
@LyteTec did it pass? Show us your final code
@hansinla I'm sorry if either I stepped on your toes or assumed he understood without confirming. I just reacted to his comment "That worked"
Hans van Riet
@hansinla
Nov 16 2015 00:40
@frogmorton no problem no toes were stepped on.
wahooie
@wahooie
Nov 16 2015 00:40
@smckinney1 are you still here? i'm stuck on that waypoint as well
Hans van Riet
@hansinla
Nov 16 2015 00:41
@wahooie Can I help you?
wahooie
@wahooie
Nov 16 2015 00:41
@hansinla i'm on the bring your slot to life waypoint and can't figure out what it's asking for
Alexander Køpke
@alexanderkopke
Nov 16 2015 00:42
<button class="btn btn-block btn-danger"><i class="fa fa-trash"></i>Delete</button>
here is LyteTec's code :)
CaffeineQueen
@CaffeineQueen
Nov 16 2015 00:42
"arr.filter(callback[, thisArg])" What does it mean by callback? What can I put there?
Hans van Riet
@hansinla
Nov 16 2015 00:42
@wahooie Show us what you have so far
Alexander Køpke
@alexanderkopke
Nov 16 2015 00:43
I think callback means you have to use a function.. meaning it has to return something thus callback
wahooie
@wahooie
Nov 16 2015 00:43
@hansinla how do I share my code with you?
Craig Morrison
@frogmorton
Nov 16 2015 00:43
Explain format
CamperBot
@camperbot
Nov 16 2015 00:43

:point_right: code format [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 and then press [shift + enter ⏎]

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

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

How to Code

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

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

wahooie
@wahooie
Nov 16 2015 00:46
<script>
  function runSlots() {
    var slotOne;
    var slotTwo;
    var slotThree;

    var images = ["http://i.imgur.com/9H17QFk.png", "http://i.imgur.com/9RmpXTy.png", "http://i.imgur.com/VJnmtt5.png"];

    slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
    slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
    slotThree = Math.floor(Math.random() * (3 - 1 + 1)) + 1;


    // Only change code below this line.

    $($(".slot")[0].html(slotOne));
    $($(".slot")[1].html(slotTwo));
    $($(".slot")[2].html(slotThree));

    // Only change code above this line.
Craig Morrison
@frogmorton
Nov 16 2015 00:46
If you wish to share snippets in the room, well-formatted, follow these instructions, @wahooie
wahooie
@wahooie
Nov 16 2015 00:46
thank you @frogmorton
CamperBot
@camperbot
Nov 16 2015 00:46
wahooie sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:star: 329 | @frogmorton | http://www.freecodecamp.com/frogmorton
Hans van Riet
@hansinla
Nov 16 2015 00:46
@CaffeineQueen a callback function is an anonymous function
arr.filter(function(x){
//do something with x

});
Craig Morrison
@frogmorton
Nov 16 2015 00:47
I see, you worked it out! Good
CaffeineQueen
@CaffeineQueen
Nov 16 2015 00:47
but what can I put there??
If I have two arrays and I need to remove the items present in the second array from the first array... how?
Hans van Riet
@hansinla
Nov 16 2015 00:47
@wahooie Your ) brackets are a bit off. Look carefully at the example they gave you
Alexander Køpke
@alexanderkopke
Nov 16 2015 00:48
filter iterates the arr array... the x in function(x) represents the present item in the arr array
so inside the function you can find out if one item of one array is found in the other.. the result is then returned
Brett
@Brettb2k8
Nov 16 2015 00:50
I'm having a hard time understanding this." The property nickname of myCar should be a string."
wahooie
@wahooie
Nov 16 2015 00:50
@hansinla got it thank you!!
CamperBot
@camperbot
Nov 16 2015 00:50
wahooie sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 585 | @hansinla | http://www.freecodecamp.com/hansinla
Alexander Køpke
@alexanderkopke
Nov 16 2015 00:50
I recommend using the indexOf inside the function to do this
Hans van Riet
@hansinla
Nov 16 2015 00:50
@Brettb2k8 Do you know how to make a nickname property?
CaffeineQueen
@CaffeineQueen
Nov 16 2015 00:50
a string is a word
Brett
@Brettb2k8
Nov 16 2015 00:50
No
CaffeineQueen
@CaffeineQueen
Nov 16 2015 00:51
well, string =/= array
Hans van Riet
@hansinla
Nov 16 2015 00:51
@hansinla Do you understand how to make any property?
Brett
@Brettb2k8
Nov 16 2015 00:52
Yesi set wheels and other for a property using this.xxxx
CaffeineQueen
@CaffeineQueen
Nov 16 2015 00:52
"CaffieneQueen" would be a string. ["Caffiene", "Queen"] would be an array.
Hans van Riet
@hansinla
Nov 16 2015 00:52
@Brettb2k8 Great so here it will be myCar.nickname
Thomas Manchester
@Eruditious
Nov 16 2015 01:05
hey guys
i have a problem - i completed a bonfire but i think it was so slow it timed out
it marked everything as passing, but didnt get the thing saying i completed it lol
Hans van Riet
@hansinla
Nov 16 2015 01:07
@Eruditious Which bonfire?
Thomas Manchester
@Eruditious
Nov 16 2015 01:07
sum all odd fibonacci

``
function sumFibs(num) {
var fibArr = 1;

for(i=0,j=1,k=0; k<num;i=j,j=x,k++ ){
    x=i+j;
  if (x % 2 !== 0 && x <=num) {
    fibArr.push(x);
  }
    console.log(x);
}

console.log(fibArr);

return fibArr.reduce(function(a,b){
return a+b;
});
}
```

function sumFibs(num) {
  var fibArr = [1];

    for(i=0,j=1,k=0; k<num;i=j,j=x,k++ ){
        x=i+j;
      if (x % 2 !== 0 && x <=num) {
        fibArr.push(x);
      }
        console.log(x);
    }

  console.log(fibArr);

  return fibArr.reduce(function(a,b){
    return a+b;
  });
}
marked everything as correct
Hans van Riet
@hansinla
Nov 16 2015 01:08
@Eruditious Take your console.log() out, that’ll speed it up
Thomas Manchester
@Eruditious
Nov 16 2015 01:08
hardly
its mainly the huge numbers on the tests
like 40000000
okay, but i got it to give me the message now
Hans van Riet
@hansinla
Nov 16 2015 01:10
@Eruditious Yes, but you’re calling it thousands of times.
daniel9012
@daniel9012
Nov 16 2015 01:30
boooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooob
JonthueM
@JonthueM
Nov 16 2015 01:43

Having a hard time nestling a text input element in the form on Waypoint:Create a Form Element. This is my current: <input type="text" placeholder="cat photo URL">

<form action="/submit-cat-photo" type="input" placeholder="cat photo URL">cat photo URL</form>

I tried combining the input tag on the form tag but nothing
I am running chromium for linux
Abhisek Pattnaik
@abhisekp
Nov 16 2015 01:48
@BerkeleyTrue :point_up: November 16, 2015 7:00 AM
Matt Yamamoto
@MattYamamoto
Nov 16 2015 01:48
@JonthueM you want the input inbetween the form tags
DJ
@qualitymanifest
Nov 16 2015 01:49
thanks @BerkeleyTrue
CamperBot
@camperbot
Nov 16 2015 01:49
qualitymanifest sends brownie points to @berkeleytrue :sparkles: :thumbsup: :sparkles:
:star: 164 | @berkeleytrue | http://www.freecodecamp.com/berkeleytrue
JonthueM
@JonthueM
Nov 16 2015 01:51
i.e <form> input="blah" </form>?
Matt Yamamoto
@MattYamamoto
Nov 16 2015 01:51
yeah,
<form>
   <input>
</form>
with the appropriate attributes inside each element of course
JonthueM
@JonthueM
Nov 16 2015 01:52
ok
I see
seonajoo26
@seonajoo26
Nov 16 2015 02:01
hi @xeoneux, saw that you were helping with the Palindromes exercise. I am confused with the /\W|_/g. Could you break this down?! thank you!
Matt Yamamoto
@MattYamamoto
Nov 16 2015 02:03
@seonajoo26 that's a regular expression. Paste it in on the site, https://regex101.com/ , and it will tell you what each part does. And you can play around with it more there.
seonajoo26
@seonajoo26
Nov 16 2015 02:20
@MattYamamoto cool site! thank you!
CamperBot
@camperbot
Nov 16 2015 02:21
seonajoo26 sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 510 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Jonathan
@jonathantimm
Nov 16 2015 02:41
hey all, anybody able to help with this?
function factorialize(num) {
  for (i=1; i < num; i++) {
    var newNum = num * i;
    return newNum;
  }

}
i'm stumped, i know i'm close-ish but something is conceptually off
Stephen Kinnison
@slkinnison
Nov 16 2015 02:42
Hint: look where the return is in reference to the for loop...
CamperBot
@camperbot
Nov 16 2015 02:42
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
DJ
@qualitymanifest
Nov 16 2015 02:43
@jonathantimm you do want to initialize i, you don't want to initialize anything inside the loop body, and when you return inside a loop it ends the loop
Jonathan
@jonathantimm
Nov 16 2015 02:45
that makes sense
let me try to work it
Jonathan
@jonathantimm
Nov 16 2015 02:50
man

function factorialize(num) {
  for (i=1; i < num; i++) {
     i * ( i + 1 );
    return i; 
  }

}
closer?
DJ
@qualitymanifest
Nov 16 2015 02:52
@jonathantimm still not initializing i, still returning inside your for loop
Jonathan
@jonathantimm
Nov 16 2015 02:54
what does it mean to initialize?
i feel like i had no trouble with for loops as i was learning it so i should get this :-)
DJ
@qualitymanifest
Nov 16 2015 02:54
for (var i... instead of for (i
there are other problems with the logic, but i figured i would bring things up a couple at a time
Jonathan
@jonathantimm
Nov 16 2015 02:55
oh right ha!
DJ
@qualitymanifest
Nov 16 2015 02:57
when you return inside your loop it immediately ends the loop. so that only runs once.
This message was deleted
Jonathan
@jonathantimm
Nov 16 2015 02:59
var i = 0 is what i would start with i think right?
DJ
@qualitymanifest
Nov 16 2015 02:59
@jonathantimm think about what happens when you multiply by 0
Phillip R
@o0elvis0o
Nov 16 2015 03:02
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
The above makes no sense to me :(
Jonathan
@jonathantimm
Nov 16 2015 03:03
i dont get why this isn't working
```
function factorialize(num) {
for (var i = 1; i < num; i++) {
i * (i + 1);
}
return i;
}
oops
function factorialize(num) {
  for (var i = 1; i < num; i++) {
         i * (i + 1);
       }
 return i; 
}
because i'm trying to get it to look at i, and if i is less than num, it should multiply i by the next number up
DJ
@qualitymanifest
Nov 16 2015 03:05
i * (i + 1)does nothing. see here https://repl.it/B0RR
you need to assign it to something
Jonathan
@jonathantimm
Nov 16 2015 03:05
oh this is a useful tool
DJ
@qualitymanifest
Nov 16 2015 03:06
@o0elvis0o i don't think you need to worry too much about that right now. they're just having you lightly modify the code in those waypoints
Phillip R
@o0elvis0o
Nov 16 2015 03:06
ok. thanks @qualitymanifest
CamperBot
@camperbot
Nov 16 2015 03:06
o0elvis0o sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 384 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
Nov 16 2015 03:06
@jonathantimm you can run console.log in FCC as well. just need to open developer tools
which, if you're using chrome, is easy. just hold ctrl+shift+i. can't speak for other browsers.
Jonathan
@jonathantimm
Nov 16 2015 03:10
hmmm
i feel silly because conceptually this is very simple but i'm having so much trouble hah
should i be using an array?
thatsharone
@thatsharone
Nov 16 2015 03:24
Hey there - I'm stuck on a code from the Responsively Style Radio Buttons exercise - can't see to figure out how to nest the radio buttons inside the div with the "class col-xs-6"...can anyone help me out and find my error?
<div class="row">
<div class="col-xs-6"><button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i>Like</button></div>
<div class="col-xs-6"><button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i>Info</button></div>
<div class="col-xs-6"><button class="btn btn-block btn-danger"><i class="fa fa-trash"></i>Delete</button></div>
</div>
DJ
@qualitymanifest
Nov 16 2015 03:24
@jonathantimm nope
@thatsharone those aren't your radio buttons
Jonathan
@jonathantimm
Nov 16 2015 03:24
function factorialize(num) {
  for (var i = num; i > 0; i--) {
    num *= (i - 1);

       }
}
that should work! but it doesnt!
hehe
DJ
@qualitymanifest
Nov 16 2015 03:26
@jonathantimm you're not returning anything... and you're multiplying by 0
Jonathan
@jonathantimm
Nov 16 2015 03:28
function factorialize(num) {
  for (var i = num; i > 0; i--) {
    num *= (i - 1);
    return num;   
       }
}

factorialize(5);
at least that returns something :-)
Jose E. Pimentel
@jedpimentel
Nov 16 2015 03:28
@jonathantimm the return should be after the loop,
(else the function will just return on the first loop)
David Hignett
@hignatious
Nov 16 2015 03:29
I just did that one
I don't want to ruin the ending for you
Jonathan
@jonathantimm
Nov 16 2015 03:30
@hignatious haha thank you
CamperBot
@camperbot
Nov 16 2015 03:30
jonathantimm sends brownie points to @hignatious :sparkles: :thumbsup: :sparkles:
:star: 12 | @hignatious | http://www.freecodecamp.com/hignatious
Jonathan
@jonathantimm
Nov 16 2015 03:30
and thank you @jedpimentel and @qualitymanifest
CamperBot
@camperbot
Nov 16 2015 03:30
jonathantimm sends brownie points to @jedpimentel and @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 432 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
:star: 385 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Jonathan
@jonathantimm
Nov 16 2015 03:30
for all your help so far
Jose E. Pimentel
@jedpimentel
Nov 16 2015 03:31
get a pencil (or use your finger) and go over the code's steps one by one (use a notepad if necessary), try to follow what the code will do when you cal that function for a specific value, up until when the "return" happens (that's just one way to debug it)
thatsharone
@thatsharone
Nov 16 2015 03:32
thanks duh :worried:
Jonathan
@jonathantimm
Nov 16 2015 03:32
that's what i'm going to do in the morning. my girlfriend wants to watch netflix and is sick of me doing this!
thanks for all your help everyone
thatsharone
@thatsharone
Nov 16 2015 03:33
now I feel silly
Jonathan
@jonathantimm
Nov 16 2015 03:33
good suggestion @jedpimentel
DJ
@qualitymanifest
Nov 16 2015 03:33
@thatsharone nah, i see tons of people make that mistake on that waypoint
Jason
@Jauble
Nov 16 2015 03:35
Anyone know if there
Anyone know if there's a way to put '>=' into a variable and use the variable in a for loop?
David Hignett
@hignatious
Nov 16 2015 03:36
I wouldn't think so no
since its an operator
why would you want to do that?
thatsharone
@thatsharone
Nov 16 2015 03:38
@qualitymanifest thanks1
!
Jason
@Jauble
Nov 16 2015 03:38
I was trying to change a for loop based on the arguments passed in instead of creating an additional for loop
David Hignett
@hignatious
Nov 16 2015 03:39
you could change the maximum value of the for loop based on a variable
Jason
@Jauble
Nov 16 2015 03:40
function range(start, end, step) {
  var arr = [];
  if (step < 0) {
    for (var i = end; i >= start; i += step) {
      arr.push(i);
    }
  }
  else {
    for (var i = start; i <= end; i += step) {
      arr.push(i);
    }
  }
  return arr;
}
console.log(range(1, 10, -2));
Jose E. Pimentel
@jedpimentel
Nov 16 2015 03:44
This message was deleted
David Hignett
@hignatious
Nov 16 2015 03:47
@Jauble there might be a more elegant way to do that, but I can't be bothered figuring it out. In the end its better to have readable code than it is to have code that is so "clever" that nobody else can maintain or read it.
Jose E. Pimentel
@jedpimentel
Nov 16 2015 03:47
@Jauble at least in that case, you could also use Math.abs() to work with an absolute value, if both loops do the same thing it's preferable to only have one of them. That way, if you need to modify the loop, you won't have to make the change twice in case there are any changes in the code
Jason
@Jauble
Nov 16 2015 03:57
@jedpimentel Thanks, I'll look into Math.abs()
CamperBot
@camperbot
Nov 16 2015 03:57
jauble sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 433 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
Cosimo Bressi
@cbressijr
Nov 16 2015 03:58
Any thought on why this is not letting me move forward? I tried all the refreshes and different browsers but nothing is working.
var ourArray = ["Stimpson", "J", ["cat"]];

ourArray.pop(); // ourArray now equals ["Stimpson", "J"]

ourArray.push(["happy", "joy"]); // ourArray now equals ["Stimpson", "J", ["happy", "joy"]]

var myArray = ["John", 23, ["cat", 2]];

myArray.pop();

// Only change code below this line.

myArray.push(["dog", 3]);

// Only change code above this line.

(function(z){return 'myArray = ' + JSON.stringify(z);})(myArray);
Sukrit Aursakcharoenkul
@m3n6gy
Nov 16 2015 03:58
Hi all,
Could you please tell me what wrong with my code
<p>View more
<a href="http://www.freecatphotoapp.com">
cat photos
</a>
</p>
Cosimo Bressi
@cbressijr
Nov 16 2015 03:59
What Waypoint is this?
Sukrit Aursakcharoenkul
@m3n6gy
Nov 16 2015 04:00
Waypoint: Nest an Anchor Element within a Paragraph
I had add View more in p element
but it not pass
Cosimo Bressi
@cbressijr
Nov 16 2015 04:01
@m3n6gy One sec pulling that up looks good from what I see.
Stephen Kinnison
@slkinnison
Nov 16 2015 04:02
@m3n6gy The checker is probably picking up the extra newline characters. Try putting everything on one line.
Sukrit Aursakcharoenkul
@m3n6gy
Nov 16 2015 04:02
@slkinnison the result is same with new line
Stephen Kinnison
@slkinnison
Nov 16 2015 04:04

@m3n6gy you mean that

<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>

didn't work?

Sukrit Aursakcharoenkul
@m3n6gy
Nov 16 2015 04:04
yep didn't work
Stephen Kinnison
@slkinnison
Nov 16 2015 04:05
@m3n6gy which check is marked red?
Sukrit Aursakcharoenkul
@m3n6gy
Nov 16 2015 04:05
@slkinnison
This one
Your p element should have the text "View more " (with a space after it).
Stephen Kinnison
@slkinnison
Nov 16 2015 04:07
@m3n6gy Can you post the line above and below the "View more" line (all three together)?
Cosimo Bressi
@cbressijr
Nov 16 2015 04:07
This worked for me:
<p>View more <a href="http://www.freecatphotoapp.com"></a></p>
@m3n6gy Any luck yet?
Sukrit Aursakcharoenkul
@m3n6gy
Nov 16 2015 04:11
bad luck
:worried:
@slkinnison <p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p> did you mean this one?
Cosimo Bressi
@cbressijr
Nov 16 2015 04:12
Yes.
Stephen Kinnison
@slkinnison
Nov 16 2015 04:12
@m3n6gy What is the line above that one?
Sukrit Aursakcharoenkul
@m3n6gy
Nov 16 2015 04:12
@cbressijr Why it not working like you?

<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;
}
</style>

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

<a href="http://www.freecatphotoapp.com">cat photos</a>

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

Cosimo Bressi
@cbressijr
Nov 16 2015 04:13
I am not fully sure. Where do you have it located in the code?
Lorenzo Tortorici
@Lorenzo611
Nov 16 2015 04:13
So im very sure im completing a challenge but its insisting that my code doesnt run
Sukrit Aursakcharoenkul
@m3n6gy
Nov 16 2015 04:14
It pass now
Stephen Kinnison
@slkinnison
Nov 16 2015 04:14
@m3n6gy You didn't wrap the cat photos line in <p>. Check what you just pasted.
Sukrit Aursakcharoenkul
@m3n6gy
Nov 16 2015 04:14
because of <a> tag above
Thank you @slkinnison and @cbressijr
CamperBot
@camperbot
Nov 16 2015 04:14
:star: 191 | @cbressijr | http://www.freecodecamp.com/cbressijr
m3n6gy sends brownie points to @slkinnison and @cbressijr :sparkles: :thumbsup: :sparkles:
:star: 202 | @slkinnison | http://www.freecodecamp.com/slkinnison
Lorenzo Tortorici
@Lorenzo611
Nov 16 2015 04:14
I need help
Stephen Kinnison
@slkinnison
Nov 16 2015 04:15
@Lorenzo611 Where are you stuck?
Lorenzo Tortorici
@Lorenzo611
Nov 16 2015 04:16
Resising the width of a picture
I know how to do it but it still refuses to work
Logan Bickmore
@loganbickmore
Nov 16 2015 04:16
share code?
Stephen Kinnison
@slkinnison
Nov 16 2015 04:16
@Lorenzo611 Which of the checks is failing?
Lorenzo Tortorici
@Lorenzo611
Nov 16 2015 04:16
Both
Phillip R
@o0elvis0o
Nov 16 2015 04:17
This message was deleted
Lorenzo Tortorici
@Lorenzo611
Nov 16 2015 04:17
.smaller-image {
width-:100px;
}
Stephen Kinnison
@slkinnison
Nov 16 2015 04:18
@Lorenzo611 You have an extra character after the word width
@Lorenzo611 It should be width: not width-:
Lorenzo Tortorici
@Lorenzo611
Nov 16 2015 04:18
Thats not there in my actual code it keeps popping up when i copy and paste
Cosimo Bressi
@cbressijr
Nov 16 2015 04:19

@m3n6gy
your code listed was off from what I see if you do this:

<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>

it should go.

Stephen Kinnison
@slkinnison
Nov 16 2015 04:19
@Lorenzo611 It might be in the editor. I would suggest trying to delete the line and retyping it.
Lorenzo Tortorici
@Lorenzo611
Nov 16 2015 04:20
.smaller-image {
woops ^
Phillip R
@o0elvis0o
Nov 16 2015 04:21
I am having trouble with a waypoint. I need to remove all elements which are greater than 5. I am using this code but it is wrong. Could you help me understand how to set this up? var newArray = oldArray.filter(function(val) { return val < 5; }); This returns 1, 2, 3, 4 but apparently not what the editor is looking for
CamperBot
@camperbot
Nov 16 2015 04:21
:bulb: to format code use backticks! ``` more info
Sukrit Aursakcharoenkul
@m3n6gy
Nov 16 2015 04:21
@cbressijr Thank you I just pass it Thank you for your help.
CamperBot
@camperbot
Nov 16 2015 04:21
m3n6gy sends brownie points to @cbressijr :sparkles: :thumbsup: :sparkles:
:warning: m3n6gy already gave cbressijr points
Rex Schrader
@SaintPeter
Nov 16 2015 04:22
@o0elvis0o Remember that you need to return true to keep an element. Think if x < 5, what is the largest x can be?
Lorenzo Tortorici
@Lorenzo611
Nov 16 2015 04:23
.smaller-image {
width:100px;
}
Why doesnt this work... any suggestions?
Stephen Kinnison
@slkinnison
Nov 16 2015 04:24
@Lorenzo611 Can you post your entire solution?
Phillip R
@o0elvis0o
Nov 16 2015 04:25
@SaintPeter 4, but I don't know how to set it up. var newArray = oldArray.filter(function(val) { return val <= 4; }); I a believe I am not grasping the lesson on this one. :)
Rex Schrader
@SaintPeter
Nov 16 2015 04:25
@o0elvis0o How about <= 5?
Phillip R
@o0elvis0o
Nov 16 2015 04:26
Ah... I kept excluding 5! I was removing five and above and kept looking for results that gave me 1, 2,3, 4. Duh... Thank you!
Rex Schrader
@SaintPeter
Nov 16 2015 04:27
@o0elvis0o :D
Lorenzo Tortorici
@Lorenzo611
Nov 16 2015 04:29

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

<style>
.red-text {
color: red;
}
.smaller-image {
width: 100px;
}

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}
</style>

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

<img src="https://bit.ly/fcc-relaxing-cat">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

my image width isnt working
Stephen Kinnison
@slkinnison
Nov 16 2015 04:30
@Lorenzo611 You didn't assign the smaller-image CSS rule to your image.
Lorenzo Tortorici
@Lorenzo611
Nov 16 2015 04:31
how do I do that @slkinnison
Stephen Kinnison
@slkinnison
Nov 16 2015 04:31
@Lorenzo611
<img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat">
@Lorenzo611 make sure that your CSS rules are being used as classes (if starting with a period) or assigned to a tag with an id (if the rule starts with a hash).
Sharon
@srinky4730
Nov 16 2015 04:36
Need some help with css style.
Hans van Riet
@hansinla
Nov 16 2015 04:37
@srinky4730 What do you need help with
Lorenzo Tortorici
@Lorenzo611
Nov 16 2015 04:38
Your awesome @slkinnison
I had a brainfart i guess, turns out I was looking at the link for the font instead of the link of the cat picture. But still I needed that help THANKS SOO MUCH @slkinnison
CamperBot
@camperbot
Nov 16 2015 04:39
lorenzo611 sends brownie points to @slkinnison :sparkles: :thumbsup: :sparkles:
:star: 203 | @slkinnison | http://www.freecodecamp.com/slkinnison
Stephen Kinnison
@slkinnison
Nov 16 2015 04:39
@Lorenzo611 You're welcome
Sharon
@srinky4730
Nov 16 2015 04:40

Supposed to change h2 to blue. Followed these directions but it's not working: <style>

h2 {color: blue;}

</style>

Hans van Riet
@hansinla
Nov 16 2015 04:41
@srinky4730 what is the rest of your code?
Is this: Waypoint: Change the Color of Text
Sharon
@srinky4730
Nov 16 2015 04:42
<h2>CatPhotoApp</h2></style>
Hans van Riet
@hansinla
Nov 16 2015 04:43

@srinky4730 I don’t know which waypoint you’re on but doesn’t it say to change the style inline like this

<h2 style="color: blue">CatPhotoApp</h2>

and to change the color to RED?

Sharon
@srinky4730
Nov 16 2015 04:45

No, it told me to delete that and change to CSS. See directions pasted below: At the top of your code, create a style element like this:

<style>

</style>

Inside that style element, you can create a CSS selector for all h2 elements. For example, if you wanted all h2 elements to be red, your style element would look like this:

<style>

h2 {color: red;}

</style>

Hans van Riet
@hansinla
Nov 16 2015 04:47
@srinky4730 Which waypoint?
Sharon
@srinky4730
Nov 16 2015 04:47
Waypoint: Use CSS Selectors to Style Elements
hectormo
@hectormo
Nov 16 2015 04:48
hi

can someone help me out with this?

<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">

</div>
<div class="col-xs-6">

</div>
</div>
</div>

Add a div element with the class well inside each of your div elements with the class "col-xs-6"
im a little rusty, i
Hans van Riet
@hansinla
Nov 16 2015 04:50
@srinky4730I think you’re on the right way, but you have to paste all your code for me to find the bug.

@hectormo inside

<div class="col-xs-6">

</div>

make another <div></div> with a class=“well"

Craig Morrison
@frogmorton
Nov 16 2015 04:51
@hectormo you are familiar with nesting HTML elements inside of each other...?
Sharon
@srinky4730
Nov 16 2015 04:52
<style>
h2 {color: blue;} <h2>CatPhotoApp</h2></style>
Hans van Riet
@hansinla
Nov 16 2015 04:53
@srinky4730 okay your <h2> tags should be after the closing </style> tag
hectormo
@hectormo
Nov 16 2015 04:53
@frogmorton atm i cant remember
i thought it was something like this: <div class= "col-xs-6 well"
Sharon
@srinky4730
Nov 16 2015 04:54
My opening h2 tag or closing?
Phillip R
@o0elvis0o
Nov 16 2015 04:55
How do you create the black code box?
Hans van Riet
@hansinla
Nov 16 2015 04:55
@srinky4730 all. you declare the style first with <style> … </style> and then your other tags
CaffeineQueen
@CaffeineQueen
Nov 16 2015 04:55
This message was deleted
CamperBot
@camperbot
Nov 16 2015 04:55
:bulb: to format code use backticks! ``` more info
Hans van Riet
@hansinla
Nov 16 2015 04:56
This message was deleted
Craig Morrison
@frogmorton
Nov 16 2015 04:56
@hectormo you just added an additional class to an existing div, which is not nesting
Nesting is putting one "inside" (i.e. Between the opening & closing tags) of the other
Pranav Doshi
@pranavdoshi
Nov 16 2015 04:58
hey guys got stuck on bonfire title case a string though on internet found solution using splice and char at but i tried other method using split and char t so plzz help i m stuck.
function test(str){
    str = str.toLowerCase();

    var tests = str.split(" ");
    for(var i=0;i<tests.length;i++)
    {

     tests[i].charAt(0).toUpperCase();

    }
    alert(tests);
}

test("hello brother my name is pranav");
how to add the chara which i get in for loop back to array.
Phillip R
@o0elvis0o
Nov 16 2015 04:59

In this waypoint, whenever I type the word function it crashes my browser

```var array = [1,2,3,4,5,6,7];

// Only change code below this line.

var newArray = array;```

Hans van Riet
@hansinla
Nov 16 2015 05:00
@pranavdoshi This line is correct tests[i].charAt(0).toUpperCase(); but you have to assign the result to something and then append the rest of the word to it.
hectormo
@hectormo
Nov 16 2015 05:00
oh i got it already
Craig Morrison
@frogmorton
Nov 16 2015 05:00
Great @hectormo
hectormo
@hectormo
Nov 16 2015 05:00
thanks @frogmorton wasn't really grasping the concept of nesting
CamperBot
@camperbot
Nov 16 2015 05:00
hectormo sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:star: 330 | @frogmorton | http://www.freecodecamp.com/frogmorton
Craig Morrison
@frogmorton
Nov 16 2015 05:01
Yw
Pranav Doshi
@pranavdoshi
Nov 16 2015 05:02
@hansinla hey so is it possible becoz when i tried assigning it to test array the whole content got replaced how to append the rest?
ioio1o
@ioio1o
Nov 16 2015 05:08
help me please, got stuck in generate random fractions with javascript, totally dont know what to do, try doing this
var random = Math.random();
function myFunction() {

  return math.random();
CamperBot
@camperbot
Nov 16 2015 05:08
no wiki entry for: me please got stuck in generate random fractions with javascript totally dont know what to do try doing this var random mathrandomfunction myfunction return mathrandom
:pencil: click here to create one now!after creating your page type update to reload it here
ioio1o
@ioio1o
Nov 16 2015 05:09
but not work
Joel Jensen
@jcjensenjr
Nov 16 2015 05:13
need help with my code. I got the correct output with my javascript but it will not pass me
Pranav Doshi
@pranavdoshi
Nov 16 2015 05:15
@ioio1o hey u cannot return math.random() like the way u hav typed
@ioio1o try adding the variable declaration within the function and return the variable den see if if works den.
Hans van Riet
@hansinla
Nov 16 2015 05:17
@pranavdoshi Yes you have to create a new array with the words with first letter capitalized and then join the array elements to a string again.
Pranav Doshi
@pranavdoshi
Nov 16 2015 05:17
@hansinla how to append dat i am not understanding
@jcjensenjr can be precise abt wat issue u r facing?
Hans van Riet
@hansinla
Nov 16 2015 05:20
@pranavdoshi You change the first character of the word to Uppercase like word[0].toUpperCase() and then append + the rest of the word. To append everything BUT the first character you can use word.slice(1).
Pranav Doshi
@pranavdoshi
Nov 16 2015 05:24
hey @hansinla
function test(str){
    str = str.toLowerCase();
    var testarray = [];
    var tests = str.split(" ");
    for(var i=0;i<tests.length;i++)
    {

     testarray[i] = tests[i].charAt(0).toUpperCase();
    tests[i].charAt(0)=testarray[i];    
    }
    alert(testarray);
    alert(tests);

}

test("hello brother my name is pranav");
getting error in this @hansinla
Hans van Riet
@hansinla
Nov 16 2015 05:26
@pranavdoshi what are you trying to do with this tests[i].charAt(0)=testarray[i];
Pranav Doshi
@pranavdoshi
Nov 16 2015 05:27
i m trying to assign the uppercase characters which i got added to new array to be assigned to and replaced with first char of array.
@hansinla
Hans van Riet
@hansinla
Nov 16 2015 05:30
@pranavdoshi You can not do this. This line is correct testarray[i] = tests[i].charAt(0).toUpperCase() you just have to append the rest of the word like this:
+ tests[i].slice(1); Then you’ll get an array testarray withg capitalized words. You’ll have to join(‘ ‘) the to create a sentence again.
ioio1o
@ioio1o
Nov 16 2015 05:31
@pranavdoshi ive done like you've suggest but still won't work
@pranavdoshi it said "math is not defined"
Hans van Riet
@hansinla
Nov 16 2015 05:33
@pranavdoshi If you want we can do this line by line toi give you a better understanding of the code.
Casaun
@NaturalWonder007
Nov 16 2015 05:34
Im on Waypoint: Use CSS Selectors to Style Elements…and I changed the color to blue but a red X still shows on the "Your h2 element should be blue". Please help.
Hans van Riet
@hansinla
Nov 16 2015 05:35
@NaturalWonder007 Show ALL of your code please
Keith Grout
@keithGrout
Nov 16 2015 05:35
Can someone explain how this evaluates, so to speak. I'm on waypoint 44 in basic Javascript.
$($(".slot")[0]).html(slotOne);
Mateus Felipe Pereira da Cunha Tavares
@elviradoipiranga
Nov 16 2015 05:36
Hi guys! i got stuck
Keith Grout
@keithGrout
Nov 16 2015 05:36
So $(".slot")returns an array like object which we can access using bracket notation
Mateus Felipe Pereira da Cunha Tavares
@elviradoipiranga
Nov 16 2015 05:36
it says Your h1 element should have the class blue-text.
Your h1 element should be blue.
Rex Schrader
@SaintPeter
Nov 16 2015 05:36
@keithGrout There are 3 HTML elements with the slot class. The selector $('.slot') returns an array of all 3. By adding the [0] or [1], we select one of them.
Pranav Doshi
@pranavdoshi
Nov 16 2015 05:36
@hansinla i m okay wid it can we go by that way? plzz
Mateus Felipe Pereira da Cunha Tavares
@elviradoipiranga
Nov 16 2015 05:37

body {
background-color: black;
font-family: Monospace;
color: green;
}
.pink-text {
color: pink;
}
.blue-text {
color: blue;
}
</style>

<h1 class="pink-text" class="blue-text">Hello World!</h1>

Pranav Doshi
@pranavdoshi
Nov 16 2015 05:37
@ioio1o hey its Math and not math
Rex Schrader
@SaintPeter
Nov 16 2015 05:37
@keithGrout Then we pass that as a selector so we can access the html element of that specifc one.
Hans van Riet
@hansinla
Nov 16 2015 05:37
@elviradoipiranga If you want multiple classes then you do
class=“className1 className2”
Casaun
@NaturalWonder007
Nov 16 2015 05:38
<style>
Mateus Felipe Pereira da Cunha Tavares
@elviradoipiranga
Nov 16 2015 05:39
@hansinla thank you so much! i guess i need some rest after getting addicted to this site :D
CamperBot
@camperbot
Nov 16 2015 05:39
elviradoipiranga sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 586 | @hansinla | http://www.freecodecamp.com/hansinla
ioio1o
@ioio1o
Nov 16 2015 05:39
@pranavdoshi lol, you are right, barely noticed
Keith Grout
@keithGrout
Nov 16 2015 05:39
Oh yeah duh @SaintPeter. Thanks a bunch.
CamperBot
@camperbot
Nov 16 2015 05:39
keithgrout sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
ioio1o
@ioio1o
Nov 16 2015 05:39
@pranavdoshi thanks alot
CamperBot
@camperbot
Nov 16 2015 05:39
:star: 1555 | @saintpeter | http://www.freecodecamp.com/saintpeter
ioio1o
@ioio1o
Nov 16 2015 05:39
@pranavdoshi it works now
Rex Schrader
@SaintPeter
Nov 16 2015 05:39
@keithGrout NP. FYI, I hate those challenges and they're going to go away very soon.
Pranav Doshi
@pranavdoshi
Nov 16 2015 05:40
@ioio1o np dude.
Hans van Riet
@hansinla
Nov 16 2015 05:40
@pranavdoshi Took our chat private
Casaun
@NaturalWonder007
Nov 16 2015 05:47
hansinla

<style>

h2 {color: blue;}

</style>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

Robert Richey
@0x0936
Nov 16 2015 05:48

I hate those challenges and they're going to go away very soon.

rejoice!

Casaun
@NaturalWonder007
Nov 16 2015 05:49
it keeps saying the element is not blue
Patrick
@patleezy
Nov 16 2015 05:50
jQuery Waypoint #1: Learn how Script Tags and Document Ready Work, need to add a script element. how do i do this? haven't been on for a week so i forgot lol...
Hans van Riet
@hansinla
Nov 16 2015 05:50
@NaturalWonder007 because there’s no <h2> element anymore in your code
Robert Richey
@0x0936
Nov 16 2015 05:50
@NaturalWonder007 can you link the waypoint you're working on?
Robert J. Domingo
@robdom
Nov 16 2015 05:51
@o0elvis0o Experiment with your return statement. Is 5 < 5?
Robert Richey
@0x0936
Nov 16 2015 05:52
@patleezy
<script>
  // add JS/jQuery here
</script>
Patrick
@patleezy
Nov 16 2015 05:52
@0x0936 appreciate it
Robert Richey
@0x0936
Nov 16 2015 05:52
:)
Patrick
@patleezy
Nov 16 2015 05:54
@0x0936 got through the waypoint - thank you!
CamperBot
@camperbot
Nov 16 2015 05:54
patleezy sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 343 | @0x0936 | http://www.freecodecamp.com/0x0936
Casaun
@NaturalWonder007
Nov 16 2015 05:54
How do I link a waypoint?
Rex Schrader
@SaintPeter
Nov 16 2015 05:54
@NaturalWonder007 Just copy and paste from the URL
Thanks SaintPeter
Hans van Riet
@hansinla
Nov 16 2015 06:01
@NaturalWonder007 You need to color it blue
Casaun
@NaturalWonder007
Nov 16 2015 06:02
I did, I changed red to blue but wouldn't show passed.
Robert Richey
@0x0936
Nov 16 2015 06:03
@NaturalWonder007 the code you posted is missing this line: <h2>CatPhotoApp</h2>
Pranav Doshi
@pranavdoshi
Nov 16 2015 06:07
@hansinla u der
Casaun
@NaturalWonder007
Nov 16 2015 06:07
where does that line go? After line: h2 {color; blue;}?
Robert Richey
@0x0936
Nov 16 2015 06:08
@NaturalWonder007 press the blue reset button on the left and try again. it will give you the <h2> element in the correct place
Patrick
@patleezy
Nov 16 2015 06:15
Screen Shot 2015-11-15 at 10.13.51 PM.png
Jquery waypoint #6: Target the same element with multiple jQuery Selectors, getting this error message "missing ) after argument list"
any thoughts on what's wrong?
Robert Richey
@0x0936
Nov 16 2015 06:16
@patleezy class names should be in quotes. .addClass("animated shake btn-primary"); etc
Patrick
@patleezy
Nov 16 2015 06:16
ok
@0x0936 thank you again
CamperBot
@camperbot
Nov 16 2015 06:17
patleezy sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:warning: patleezy already gave 0x0936 points
Robert Richey
@0x0936
Nov 16 2015 06:17
@patleezy certainly :)
Casaun
@NaturalWonder007
Nov 16 2015 06:22
I'm so happy….Thanks 0x0936!!!!! I finally finished that waypoint. Needed to put that line at the top of my code.
Robert Richey
@0x0936
Nov 16 2015 06:22
@NaturalWonder007 awesome!
skyeline786
@skyeline786
Nov 16 2015 06:29
Hi there, having issues adding a class to resize and image and applying it. Any tips?
h4r1m4u
@h4r1m4u
Nov 16 2015 06:46
@skyeline786
<style>
   /* define a class in your CSS, using the width attribute to set the width of the element the class will be applied to */
   .some-class {
       width: 200px;
}
</style>

<!-- apply the class to your element --> 
<img class="some-class" src="http://example.com/image.jpg">
Mason Shin
@minsooshin
Nov 16 2015 06:46
@patleezy you missed quotation marks for all class names.
ipaddr
@ipaddr
Nov 16 2015 07:51
Hi guys, I got stok on finding the thirdLetterOfLastName
I add code below
thirdLetterOfLastName2
but it not working
Kasun Weerasinghe
@kasunw310
Nov 16 2015 07:53
Hey everyone , how can I pass an array of numbers into a function and return the largest value from the array?
ipaddr
@ipaddr
Nov 16 2015 07:56
Sorry I got the solution, thank you
Sree Harsha Subraveti
@gasperno
Nov 16 2015 08:00
did you try JS reduce() function?
@kasunw310 it takes an input and returns a single value.
Devin Alvaro
@devinalvaro
Nov 16 2015 08:01
what IDE is most similar with FreeCodeCamp's environment?
sorry wrong room
Steven M
@Smorano1224
Nov 16 2015 08:06
Im curious, what is the reasoning for using the jQuery function .parent to change an element instead of just calling out the element you actually want to change?
Marwen
@marwenrojbi
Nov 16 2015 08:18
<p>"View more
<a href="http://www.freecatphotoapp.com">cat photos</a>" </p> Your p element should have the text "View more " (with a space after it)
what can i do please help!
h4r1m4u
@h4r1m4u
Nov 16 2015 08:19

@Smorano1224 consider this:

<div>
  <button id="button1" type="button">Button</button>
</div>
<div>
  <button id="button2" type="button">Button</button>
</div>

<script>
$('button').click(function() {
  $(this).parent('div').css("background", "red");
});
</script>

a simple script - you click a button and it changes the button's div container background to red. how would you target the container div without the .parent() method?

@marwenrojbi i don't think you need to include the double quotes before View and after the </a> closing tag
the text of the paragraphs should only be: View more cat photos
Michelle.Everywhere
@MichelleEverywhere
Nov 16 2015 08:22

Hey guys, I keep running into what I assume is a bug in the Object Oriented and Functional Programming : Reverse arrays with .reverse.

The moment I type the word function into the editor the site freezes then crashes.

h4r1m4u
@h4r1m4u
Nov 16 2015 08:26
@MichelleEverywhere it doesn't happen to me. have you tried a different browser? on a side note, you don't need to write a custom function to pass that waypoint
Michelle.Everywhere
@MichelleEverywhere
Nov 16 2015 08:28
@h4r1m4u Thanks for the heads up. I'm not quite sure what to do for that section, I just got to it and it keeps crashing. I'm using chrome, I'll try it with firefox.
CamperBot
@camperbot
Nov 16 2015 08:28
michelleeverywhere sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 671 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 16 2015 08:29
@MichelleEverywhere strange. i'm using chrome too and don't have that problem. i also hang around in these forums a lot and haven't encountered that issue before (which is not so say that it might not be happening)
Steven M
@Smorano1224
Nov 16 2015 08:34
@h4r1m4u Thanks. I think I understand. Assuming the div container was a class couldnt you just target it directly by the class name instead of using .parent? Sorry if this is silly I just started learning about the parent children functions. It seemed weird to do $("#target1").parent().css("background-color", "red"); when I could just do $(".left-well").css("background-color", "red"); so I'm guessing it makes more sense for more advanced stuff.
CamperBot
@camperbot
Nov 16 2015 08:34
smorano1224 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 672 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Michelle.Everywhere
@MichelleEverywhere
Nov 16 2015 08:35
@h4r1m4u I just tried it again to make sure I wasn't just doing something stupid. It not only crashes that page, it also crashes this help page as well. None of the other tabs I have open in my Chrome were affected though.
h4r1m4u
@h4r1m4u
Nov 16 2015 08:39

@Smorano1224 there are no silly questions, only silly answers. you're absolutely right - if the container div had an id, you could target it directly. with classes it gets trickier as classes are often re-used throughout your page. for example, the HTML could look like this:

<div class="panel">
  <button id="button1" type="button">Button</button>
</div>
<div class="panel">
  <button id="button2" type="button">Button</button>
</div>

often in a page you will have blocks of code that represent a repeated visual feature - think panels, boxes, widgets, lists, etc. if you did $(".panel").css("background-color", "red");with the code above, it would change the background of both the divs, not only the one in which you pressed the button

@MichelleEverywhere that's really bizarre. what happens in firefox?
Mark August
@WritesAugust
Nov 16 2015 08:40

hello, i'm stuck in waypoint: next an anchor element within a paragraph. Here's my code, what's wrong with it?

<p>View more
<a href='http://www.freecatphotoapp.com'>
cat photos
</a>
</p>

Steven M
@Smorano1224
Nov 16 2015 08:40
@h4r1m4u Ah ok that makes more sense. Thanks again.
CamperBot
@camperbot
Nov 16 2015 08:40
smorano1224 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: smorano1224 already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Nov 16 2015 08:41
you're welcome
Liviu Damian
@liviudm
Nov 16 2015 08:41
@WritesAugust put everything on the same line
Steven M
@Smorano1224
Nov 16 2015 08:42
Also is there an easy way to save responses on this chat or just copy paste?
Mark August
@WritesAugust
Nov 16 2015 08:42
@liviudm okay, i will give that a go. thank you.
CamperBot
@camperbot
Nov 16 2015 08:42
writesaugust sends brownie points to @liviudm :sparkles: :thumbsup: :sparkles:
:star: 31 | @liviudm | http://www.freecodecamp.com/liviudm
Liviu Damian
@liviudm
Nov 16 2015 08:43
you’re welcome @WritesAugust
Mark August
@WritesAugust
Nov 16 2015 08:44
<p>View more <a href="http://www.freecatphotoapp.com"> cat photos. </a> </p>
it still didn't work after i put it all on the same line, the part that's wrong is 'your p element should have the text "view more " (with a space after it)
everything else is ticked
h4r1m4u
@h4r1m4u
Nov 16 2015 08:45
@Smorano1224 if you click on the time of the message (on the right side), it'll change your browser's URL and give you direct link to the message. so you can archive/bookmark that URL
Liviu Damian
@liviudm
Nov 16 2015 08:45
I think you have an extra space before cat @WritesAugust
h4r1m4u
@h4r1m4u
Nov 16 2015 08:46
@WritesAugust is there supposed to be a period at the end?
Mark August
@WritesAugust
Nov 16 2015 08:46
yea
h4r1m4u
@h4r1m4u
Nov 16 2015 08:46
...photos. vs ...photos?
Liviu Damian
@liviudm
Nov 16 2015 08:46
@WritesAugust you must have one space after more, and no spaces before cat or photos and I don’t think you must put that period there
Michelle.Everywhere
@MichelleEverywhere
Nov 16 2015 08:46
Screen Shot 2015-11-16 at 12.43.50 AM.png
@h4r1m4u I was able to move past that particular section since it didn't necessitate the use of 'function', but I got the same result when I tried it in Firefox. page completely crashed
It may be only by specifically when 'function' is placed after the word 'array'
Mark August
@WritesAugust
Nov 16 2015 08:48
there's nothing wrong with the other parts, only the "View more " is crossed wrong except I have left a space
h4r1m4u
@h4r1m4u
Nov 16 2015 08:48
try to remove the period at the end
Mark August
@WritesAugust
Nov 16 2015 08:48
didn't work =S
h4r1m4u
@h4r1m4u
Nov 16 2015 08:49
can you post your code?
@MichelleEverywhere well, i'm puzzled. i don't see why that'd be happening. i'd suggest you try to report it and have the FCC folks look into it
Mark August
@WritesAugust
Nov 16 2015 08:49
<p>View more <a href="http://www.freecatphotoapp.com">cat photos.</a> </p>
Michelle.Everywhere
@MichelleEverywhere
Nov 16 2015 08:49
@h4r1m4u Thanks! will do
CamperBot
@camperbot
Nov 16 2015 08:49
michelleeverywhere sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: michelleeverywhere already gave h4r1m4u points
Liviu Damian
@liviudm
Nov 16 2015 08:50
remove the period after photos @WritesAugust
Mark August
@WritesAugust
Nov 16 2015 08:50
i've tried
Your p element should have the text "View more " (with a space after it).
this part is marked wrong
everything else is ticked
h4r1m4u
@h4r1m4u
Nov 16 2015 08:51
@MichelleEverywhere oh wait, you deleted the tester function at the bottom. i think that's cause of the issue, not writing the word 'function' in your code
@WritesAugust can you post your entire code?
Steven M
@Smorano1224
Nov 16 2015 08:53
@h4r1m4u perfect. thanks again.
CamperBot
@camperbot
Nov 16 2015 08:53
smorano1224 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: smorano1224 already gave h4r1m4u points
kiran beethoju
@kiranchary
Nov 16 2015 08:53

You can use the reverse method to reverse the elements of an array.

reverse is another array method that alters the array in place, but it also returns the reversed array.

Use reverse to reverse the array variable and assign it to newArray.?

You should reverse the array.

var array = [1,2,3,4,5,6,7];

// Only change code below this line.

var newArray= array;
array.reverse();
array.reverse(function(array){
;
});
// Only change code above this line.

(function() { return array; })();
// Only change code above this line.

Mark August
@WritesAugust
Nov 16 2015 08:55

<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;
}
</style>

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

<a href="http://www.freecatphotoapp.com">cat photos</a>

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a> </p>

h4r1m4u
@h4r1m4u
Nov 16 2015 08:56
@WritesAugust ah, that explains it. you added a new <a> element at the bottom and nested that one. instead, you need to nest the existing <a>, just under the main <h2>
Mark August
@WritesAugust
Nov 16 2015 08:56
okay, thank you @h4r1m4u
CamperBot
@camperbot
Nov 16 2015 08:56
writesaugust sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 673 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 16 2015 08:57
delete the <a> you added and nest the <a> provided to you by the waypoint instead and you'll pass
khushbu
@khushbuparakh
Nov 16 2015 09:07
So I have found a bug
when I try to scroll down with arrow keys while writing code in idea my arrow goes down but it did not synchronously scroll down my side bar
kiran beethoju
@kiranchary
Nov 16 2015 09:09
how to use reverse function?
in java?
to reverse whole array
h4r1m4u
@h4r1m4u
Nov 16 2015 09:09
@kiranchary java or javascript?
kiran beethoju
@kiranchary
Nov 16 2015 09:10
sry Object Oriented and Functional Programming  
h4r1m4u
@h4r1m4u
Nov 16 2015 09:10
i'm assuming you're talking about javascript then: someArray.reverse();
Nick Lennox
@nicklennox
Nov 16 2015 09:10
can you guys help with resizing an image?
I created a new style
<style>
kiran beethoju
@kiranchary
Nov 16 2015 09:11
ok i'll try with that
Nick Lennox
@nicklennox
Nov 16 2015 09:11
.smaller-image {
width: 100 px;
}
</style>
any help?
kiran beethoju
@kiranchary
Nov 16 2015 09:11
you can use width:some size with pixels @nicklennox
h4r1m4u
@h4r1m4u
Nov 16 2015 09:11
@nicklennox if you use shift + enter, it'll allow you to write multiline posts
Nick Lennox
@nicklennox
Nov 16 2015 09:12
gotcha
<style>
kiran beethoju
@kiranchary
Nov 16 2015 09:12
<style>?
h4r1m4u
@h4r1m4u
Nov 16 2015 09:13
as to your question, remove the space between 100 and px. @nicklennox
Nick Lennox
@nicklennox
Nov 16 2015 09:13
<style>
.smaller-image {
h4r1m4u
@h4r1m4u
Nov 16 2015 09:13
the number and units should be together
Nick Lennox
@nicklennox
Nov 16 2015 09:13
I did that
still nothing
<style>
.smaller-image {
width: 100px;
}
</style>
h4r1m4u
@h4r1m4u
Nov 16 2015 09:13
did you apply the .smaller-image class to your html element?
Nick Lennox
@nicklennox
Nov 16 2015 09:14
no
how do I do that?
kiran beethoju
@kiranchary
Nov 16 2015 09:14
u do that
for example you have to add to h2 tag
then use
h4r1m4u
@h4r1m4u
Nov 16 2015 09:14
for example: <div class="some-class"></div>
kiran beethoju
@kiranchary
Nov 16 2015 09:14
<h2 class=".smaller-iameg"></h2>
h4r1m4u
@h4r1m4u
Nov 16 2015 09:14
that applies 'some-class' class to a div
@kiranchary that's actually wrong
kiran beethoju
@kiranchary
Nov 16 2015 09:15
ok @h4r1m4u
im just saying example ...
h4r1m4u
@h4r1m4u
Nov 16 2015 09:15
you don't use the . (period) in the class when you apply them to HTML elements. the period is used in CSS definitions only
@nicklennox look at my <div> example above. the class application is the same for any HTML element. so do the same for your <img> element
Nick Lennox
@nicklennox
Nov 16 2015 09:17
ok
when I write my <img element
do I put <img size=smaller-size>
?
h4r1m4u
@h4r1m4u
Nov 16 2015 09:18
@nicklennox not 'size', but 'class'
'smaller-size' is the name of your class, the same as 'some-class' in my example above
Dustin Frank
@DustInCompetent
Nov 16 2015 09:23
also, better put it in quotation marks
Harpner
@Harpner
Nov 16 2015 09:24
Hi guys.. I think I've found a bug in http://www.freecodecamp.com/challenges/waypoint-save-your-code-revisions-forever-with-git challenge, GitHubbin step, could anybody help me?
khushbu
@khushbuparakh
Nov 16 2015 09:24
Use the jQuery addClass() function to give the classes animated and shake to all your elements with the class well.
how to do that
h4r1m4u
@h4r1m4u
Nov 16 2015 09:25
@khushbuparakh what have you tried?
khushbu
@khushbuparakh
Nov 16 2015 09:25
$(".well").addclass("animated");
Dustin Frank
@DustInCompetent
Nov 16 2015 09:25
.addClass("animated");
It's case-sensitive
h4r1m4u
@h4r1m4u
Nov 16 2015 09:25
addclass != addClass
khushbu
@khushbuparakh
Nov 16 2015 09:25
in my document read function
I capitalised the class
still showing same erroe
erroe
Dustin Frank
@DustInCompetent
Nov 16 2015 09:26
paste the code here
h4r1m4u
@h4r1m4u
Nov 16 2015 09:26
:point_up:
khushbu
@khushbuparakh
Nov 16 2015 09:27
<script>
$(document).ready(function() {
$("button").addClass("animated bounce");
$(".well").addClass("animated");
$(".text-primary").addClass("animated shake");
});
</script>
h4r1m4u
@h4r1m4u
Nov 16 2015 09:27
what's the waypoint?
khushbu
@khushbuparakh
Nov 16 2015 09:28
Use the jQuery addClass() function to give the classes animated and shake to all your elements with the class well.
ok
h4r1m4u
@h4r1m4u
Nov 16 2015 09:28
so well should have both animated and shake class?
khushbu
@khushbuparakh
Nov 16 2015 09:28
it's done
thamks
Harpner
@Harpner
Nov 16 2015 09:29
is there something wrong with "git config --global user.username Harpner" as adding my github global username? Can't get past GitHubbin part of Git Challenge
h4r1m4u
@h4r1m4u
Nov 16 2015 09:34
@Harpner did you try git config --global user.name Harpner?
Harpner
@Harpner
Nov 16 2015 09:37
@h4r1m4u tried that, doesn't work either
h4r1m4u
@h4r1m4u
Nov 16 2015 09:37
any errors?
Harpner
@Harpner
Nov 16 2015 09:38
during adding the config setting - no errors, during verifying solution first one (detect on user.username setting) is ok, 3 others are not
"" != "You're on GitHub!"
null != "Git config!"
null != ""
h4r1m4u
@h4r1m4u
Nov 16 2015 09:46
@Harpner bear with me as i haven't done this challenge yet (but i've worked with git in the past). so i'm just stumbling in the dark here. from that error message, it seems like there are some other settings in the config that you need to set, not just the username? have you done that?
Harpner
@Harpner
Nov 16 2015 09:47
Dustin Frank
@DustInCompetent
Nov 16 2015 09:47
seems you haven't installed the GitHub client
Harpner
@Harpner
Nov 16 2015 09:47
and that says to only change the user.username setting
Dustin Frank
@DustInCompetent
Nov 16 2015 09:47
or just aren't logged in or something
...
oh.
did you misspell your username in the terminal?
"" != "You're on GitHub!"
probably means git-it didn't find a user with the username you entered
Harpner
@Harpner
Nov 16 2015 09:51
i already checked that, username is fine https://api.github.com/users/Harpner
with git config user.username i verified that it is indeed set to Harpner
and still, verify on this step doesn't work :(
h4r1m4u
@h4r1m4u
Nov 16 2015 09:55
i'm looking at the verify.js for the challenge https://github.com/jlord/git-it/blob/master/problems/githubbin/verify.js. it almost looks to me like the script is not executing correctly rather than you not completing the step
Harpner
@Harpner
Nov 16 2015 09:57
well, that is unfortunate... should i report a bug on this challenge via fcc?
h4r1m4u
@h4r1m4u
Nov 16 2015 10:04
@Harpner i just tried to do the challenge and passed the githubbing step without any issues
i'm not sure what might have gone for you :(
codebubb
@codebubb
Nov 16 2015 10:10

Hi all, i'm doing the Bonfire: Falsy Bouncer and accidentally solved it with this code: ```function bouncer(arr) {
// Don't show a false ID to this bouncer.
return arr.filter(function(elem){
return (elem);
});
}

bouncer([7, "ate", "", false, 9]);
Could someone explain how this works? All the tests passed but i've not specified any filtering? Thanks! :)

h4r1m4u
@h4r1m4u
Nov 16 2015 10:15
filter returns an array of elements from the original array for which the callback function evaluates to true. so when you do return (elem), the result of the filter will exclude all elements that evaluate to false (which what the bouncer() is supposed to do) @codebubb
codebubb
@codebubb
Nov 16 2015 10:18
Cheers @h4r1m4u I was just expecting to have to do things like if(elem !== 0 || elem.length >0 ... ) etc to test each of those conditions. Turns out they all evaluate to false anyhow so no need to do anymore checking. Thanks for getting back to me :)
CamperBot
@camperbot
Nov 16 2015 10:18
codebubb sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 674 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 16 2015 10:20
yeah, by wrapping the elem in () JS already performs the evaluation and since you're doing it inside the filter, it removes all the falsey values. no need to do all the individual checks, JS already does it for you. it's a great solution
@codebubb
Angelo C. IGITEGO
@AngeloRwanda
Nov 16 2015 10:21
Hello, everyone.
codebubb
@codebubb
Nov 16 2015 10:22
@h4r1m4u Yep, suprised me when it worked! :smile:
Hi @AngeloRwanda !
h4r1m4u
@h4r1m4u
Nov 16 2015 10:22
always great when that happens :D
codebubb
@codebubb
Nov 16 2015 10:23
A 'happy accident' I believe it's called.
Harpner
@Harpner
Nov 16 2015 10:33
@h4r1m4u Somehow, the Githubbin challenge verified correctly now, i didn't do anything so it's fine for now. Thank you for your help!
CamperBot
@camperbot
Nov 16 2015 10:33
harpner sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 675 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 16 2015 10:34
@Harpner bizarre! but glad you managed to get through it
Ethan Leyden
@Darksmurf
Nov 16 2015 11:30
Is developer.mozilla.org working for you guys, it won't load here...
h4r1m4u
@h4r1m4u
Nov 16 2015 11:40
@Darksmurf yep, no issues
Ethan Leyden
@Darksmurf
Nov 16 2015 11:41
hmm, thanks @h4r1m4u
Alexander Køpke
@alexanderkopke
Nov 16 2015 11:42
works fine here too
you can use http://devdocs.io/javascript/ also.. it has the same info I think
Ethan Leyden
@Darksmurf
Nov 16 2015 11:44
Thanks again!
Guled Omer
@guledomer
Nov 16 2015 11:56
problem.pdf
can anyone see where the problem is i thought i added the right jquery selectors but it is still giving me an error on the target1 selector
h4r1m4u
@h4r1m4u
Nov 16 2015 11:58
@guledomer the classes inside the .addClass() method need to be wrapped in quotes
Ethan Leyden
@Darksmurf
Nov 16 2015 11:58
You can post code like this:
```
code
```
h4r1m4u
@h4r1m4u
Nov 16 2015 11:58
e.g. .addClass("my-class");
wiki format
CamperBot
@camperbot
Nov 16 2015 11:58

:point_right: code format [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 and then press [shift + enter ⏎]

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

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

How to Code

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

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

h4r1m4u
@h4r1m4u
Nov 16 2015 11:58
@guledomer :point_up:
Guled Omer
@guledomer
Nov 16 2015 11:59
ah ok thanks people ill give it a try
@h4r1m4u thanks
CamperBot
@camperbot
Nov 16 2015 12:01
guledomer sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 677 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 16 2015 12:01
no problem
Aviran Avraham Swissa
@aaswissa
Nov 16 2015 12:36
Hi all

What's wrong with this?

<style>
.red-text {
color: red;
}
.16-size {
font-size: 16px;
}
</style>

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

Tnx
Alexander Køpke
@alexanderkopke
Nov 16 2015 12:39
class="red-text 16-size"
<h2 class="firstclass nextclass thirdclass etcclass">CatPhotoApp</h2>
khushbu
@khushbuparakh
Nov 16 2015 12:41
hello
facing an issue
Alexander Køpke
@alexanderkopke
Nov 16 2015 12:41
yes?
khushbu
@khushbuparakh
Nov 16 2015 12:41
<script>
$(document).ready(function() {
$("button").addClass(animated);
$(".btn").addClass(shake);
$("#target1").addClass(animated, shake and btn-primary);
});
</script> in this code I am missing parenthesis
after argument list
Alexander Køpke
@alexanderkopke
Nov 16 2015 12:42
(animated shake btn-primary)
khushbu
@khushbuparakh
Nov 16 2015 12:43
so comma doesn't effect
my error is related to )
")"
missing ) after argument list
Jason Wood
@catapixel
Nov 16 2015 12:44
@khushbuparakh you need to have quotes around your classes "animated" etc
David
@c-restha
Nov 16 2015 12:44
it wont happen
Alexander Køpke
@alexanderkopke
Nov 16 2015 12:44
I don't know if comma is allowed but you also used 'and' which is not a class I think
Alexander Schuneman
@AxSch
Nov 16 2015 12:44
no you’ve typed it incorretcly
khushbu
@khushbuparakh
Nov 16 2015 12:44
ok
David
@c-restha
Nov 16 2015 12:44
i too have same problem
Alexander Schuneman
@AxSch
Nov 16 2015 12:44
your code should look like this
David
@c-restha
Nov 16 2015 12:44

<script>
$(document).ready(function() {
$("button").addclass("animated");
$(".btn").addclass("shake");
$("#target1").addClass("animated shake btn-primary");
});
</script>

<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-primary 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>

Alexander Schuneman
@AxSch
Nov 16 2015 12:45
‘''
Jason Wood
@catapixel
Nov 16 2015 12:45
wiki format
CamperBot
@camperbot
Nov 16 2015 12:45

:point_right: code format [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 and then press [shift + enter ⏎]

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

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

How to Code

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

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

Alexander Schuneman
@AxSch
Nov 16 2015 12:45
This message was deleted
script>
$(document).ready(function() {
$("button").addClass(“animated");
$(".btn").addClass(“shake");
$("#target1").addClass(“animated” “shake" "btn-primary");
});
</script>
Jason Wood
@catapixel
Nov 16 2015 12:46
@AxSch you need backticks. They are above your tab key on the top left of your keyboard.
next to the number one
Alexander Schuneman
@AxSch
Nov 16 2015 12:46
im on a mac :S I cant find them haha
khushbu
@khushbuparakh
Nov 16 2015 12:46
no
Jason Wood
@catapixel
Nov 16 2015 12:46
look for the key with the tilde ~
khushbu
@khushbuparakh
Nov 16 2015 12:46
I can't use double invered comma inside a class
ok I get it
Classes
Alexander Schuneman
@AxSch
Nov 16 2015 12:47
script>
$(document).ready(function() {
$("button").addClass(animated);
$(".btn").addClass(shake);
$("#target1").addClass(animated shake btn-primary);
});
</script>
Jason Wood
@catapixel
Nov 16 2015 12:47
:thumbsup:
@alexanderkopke your double quotes are missing around your classes $("button").addClass("animated bounce");
khushbu
@khushbuparakh
Nov 16 2015 12:48
ok
Alexander Schuneman
@AxSch
Nov 16 2015 12:48
I found it but I havent used JQuery in a while,
Yeah I realised haha
but thanks for spotting
Alexander Køpke
@alexanderkopke
Nov 16 2015 12:48
@c-restha the code you postet.. you already added btn-primary to the button with id="target1"
@catapixel you're right or single quotes
Jason Wood
@catapixel
Nov 16 2015 12:49
Yes, but the "preferred" method here for readability is double but either will work
David
@c-restha
Nov 16 2015 12:49
eventhough i removed it i still have problem
Alexander Schuneman
@AxSch
Nov 16 2015 12:50
@c-restha whats the error?
khushbu
@khushbuparakh
Nov 16 2015 12:50
thanks
David
@c-restha
Nov 16 2015 12:50
i can't figure it out AxSch
@AxSch
Alexander Schuneman
@AxSch
Nov 16 2015 12:51
post your code
David
@c-restha
Nov 16 2015 12:51
how did you did it @khushbuparakh

<script>
$(document).ready(function() {
$("button").addclass("animated bounce");
$(".btn").addclass("shake");
$("#target1").addClass("animated shake btn-primary");
});
</script>

<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>

Alexander Schuneman
@AxSch
Nov 16 2015 12:51
use ```
David
@c-restha
Nov 16 2015 12:52
where to use
Jason Wood
@catapixel
Nov 16 2015 12:52
on their own lines. Three before your code ``` and three after your code
Alexander Schuneman
@AxSch
Nov 16 2015 12:53
This^^
Alexander Køpke
@alexanderkopke
Nov 16 2015 12:57
@c-restha I think the instruction is to only add btn-primary to the #target1.
David
@c-restha
Nov 16 2015 12:59
@alexanderkopke no we should add animated shake as well as btn-primary..isn't it
Jason Wood
@catapixel
Nov 16 2015 12:59
@c-restha this is the correct code which seems to match what you have...
<script>
  $(document).ready(function() {
    $("button").addClass("animated");
    $(".btn").addClass("shake");
    $("#target1").addClass("animated shake 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>
That's for "Waypoint: Target the same element with multiple jQuery Selectors" to make sure we are talking about the same one
Alexander Køpke
@alexanderkopke
Nov 16 2015 13:01
@c-restha animated and shake are already added to the button element because of $("button").addClass("animated") and $(".btn").addClass("shake")
the button with #target1 already is animated and shaked
@catapixel why do you add animated and shake to #target1? that is redundant
Jason Wood
@catapixel
Nov 16 2015 13:05
@alexanderkopke is correct. They changed the waypoint since I completed it. The code can be simplified to the following after you use the "reset" button..
<script>
  $(document).ready(function() {
    $("button").addClass("animated");
    $(".btn").addClass("shake");
    $("#target1").addClass("btn-primary");
  });
</script>
Aviran Avraham Swissa
@aaswissa
Nov 16 2015 13:05
@alexanderkopke Thank you!
CamperBot
@camperbot
Nov 16 2015 13:05
aviranswissa sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 235 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Alexander Køpke
@alexanderkopke
Nov 16 2015 13:05
but anyways the code should work in any case
David
@c-restha
Nov 16 2015 13:15
yes guys the spelling of class(C) was at lower case .
thank you all
Jason Wood
@catapixel
Nov 16 2015 13:17
@c-restha that was a good catch on the previous classes.
sagar
@sagarbhaila
Nov 16 2015 13:19
hello
Jason Wood
@catapixel
Nov 16 2015 13:19
@sagarbhaila hello. Did you need help with something?
sagar
@sagarbhaila
Nov 16 2015 13:20
how to reamove the greater number by useing filter
yes
Jason Wood
@catapixel
Nov 16 2015 13:23
@sagarbhaila The example section here Documentation shows how to filter numbers. You can just change the example code to < (less than) to do what you want...
David
@c-restha
Nov 16 2015 13:23
yea! i got it
Jason Wood
@catapixel
Nov 16 2015 13:23
:thumbsup:
@sagarbhaila Their example code is
Example: Filtering out all small values

The following example uses filter() to create a filtered array that has all elements with values less than 10 removed.

function isBigEnough(value) {
  return value >= 10;
}
var filtered = [12, 5, 8, 130, 44].filter(isBigEnough);
// filtered is [12, 130, 44]
sagar
@sagarbhaila
Nov 16 2015 13:37
@catapixel sorry not working
@catapixel thank YOU
CamperBot
@camperbot
Nov 16 2015 13:38
sagarbhaila sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 583 | @catapixel | http://www.freecodecamp.com/catapixel
Jorine Bryan Agua
@mongos134
Nov 16 2015 13:40
where do I put this? <h2 id="cat-photo-app">
David
@c-restha
Nov 16 2015 13:41
@mongos134 send your code
it should be below your </style>
Jorine Bryan Agua
@mongos134
Nov 16 2015 13:42
thank you:)
thank you @c-restha :)
CamperBot
@camperbot
Nov 16 2015 13:42
mongos134 sends brownie points to @c-restha :sparkles: :thumbsup: :sparkles:
:star: 118 | @c-restha | http://www.freecodecamp.com/c-restha
Anthony
@Guzko
Nov 16 2015 14:08
What's wrong with my script
<script>
  $(button).ready(animated bounce) {

  });
</script>
Alexander Køpke
@alexanderkopke
Nov 16 2015 14:09
use ready on (document)
Anthony
@Guzko
Nov 16 2015 14:10
?
Alexander Køpke
@alexanderkopke
Nov 16 2015 14:11
<script>
  $(document).ready(function) {
$("button").addClass("animated bounce");

  });
</script>
I made mistake
Jeffrey
@rendermanGL
Nov 16 2015 14:12

var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;

function myFunction() {

// Only change code below this line.
var myHeads = "Heads";
var myTails = "Tails";
if(flip === 0) {
return myHeads;
} else {
return myTails;
}

what's wrong here

Alexander Køpke
@alexanderkopke
Nov 16 2015 14:12
the code should look like this
<script>
  $(document).ready(function() {
$('button').addClass('animated bounce')
  });
</script>
Jeffrey
@rendermanGL
Nov 16 2015 14:13

my errors say that it should return heads and tails

and it actually does

Anthony
@Guzko
Nov 16 2015 14:13
What is wrong with mine
$(document).ready(function) {
$("button").btn("animated bounce");
  });
</script>
Alexander Køpke
@alexanderkopke
Nov 16 2015 14:14
you have Tails and Heads capitalized.. could it be that?
Jeffrey
@rendermanGL
Nov 16 2015 14:14
oh ! let me try
thank you @alexanderkopke
Alexander Køpke
@alexanderkopke
Nov 16 2015 14:14
@Guzko function()
CamperBot
@camperbot
Nov 16 2015 14:14
rendermangl sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 237 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Anthony
@Guzko
Nov 16 2015 14:14
Ok thanks
Thanks alexanderkopke
Alexander Køpke
@alexanderkopke
Nov 16 2015 14:15
@Guzko but also instead of .btn it should be : .addClass("animated bounce");
Jeffrey
@rendermanGL
Nov 16 2015 14:15
Yes ! that was it @alexanderkopke it worked ^^ :smile:
Alexander Køpke
@alexanderkopke
Nov 16 2015 14:15
:+1:
saurav
@sauravkarki2
Nov 16 2015 14:43

function findLongestWord(str) {
var result = str.split(" ").sort( function(a,b){
return b.length - a.length;
} );

return result[0].length;
}
findLongestWord("The quick brown fox jumped over the lazy dog");
finally completed bonfire: find the longest word in a string independently.... :)

Rafael J. Rodriguez
@Rafase282
Nov 16 2015 14:47
I need help
ronaldrdguez
@ronaldrdguez
Nov 16 2015 14:49
Has anyone gone through Eloquent JavaScript book? I'm trying to implement deepEqual and is getting ugly.
Dale
@Dale-R
Nov 16 2015 14:50
@Rafase282 what do you need help with?
Rafael J. Rodriguez
@Rafase282
Nov 16 2015 14:51
@Dale-R I'm trying to get back to the node waypoints but I have been watchign these funy anime vine compilations and I just can't get productive for long >.<
Herman Fassett
@HermanFassett
Nov 16 2015 14:52
Just think about how much more awesome and meaningful the waypoints are
Markus Kiili
@Masd925
Nov 16 2015 14:52
@ronaldrdguez I started reading it but quite soon changed to another book. Maybe later.
Rafael J. Rodriguez
@Rafase282
Nov 16 2015 14:55
I'll try, and I been thinking of reading some books, but they are usually in pdf form and if I 'm onteh pc i wont read them. So I guess is time to get the old nexus 7 out
ronaldrdguez
@ronaldrdguez
Nov 16 2015 14:58

Need to do a deep comparison of a and b

function deepEqual(a, b) {
  if (typeof a == 'object' && typeof b == 'object' &&
      a != null && b != null &&
      Object.keys(a).length == Object.keys(b).length) {
    for (var p in a) {
      if (!(b[p] && deepEqual(a[p], b[p]))) {
        return false;
      }
    }
    return true;
  }

  return a === b;
}

I don't like that if, and I still need to throw in an extra check for arrays because a comparison of {'0': 1} and [1] will return true. Any hints?

webdevelnode
@webdevelnode
Nov 16 2015 14:59
Hello everyone
Rafael J. Rodriguez
@Rafase282
Nov 16 2015 15:01
hi
renren89
@renren89
Nov 16 2015 15:03
  if (a === b) return true;

  if (a == null || typeof a != "object" ||
      b == null || typeof b != "object")
    return false;
would be a lot easier to reason about
Robert J. Domingo
@robdom
Nov 16 2015 15:09
@ronaldrdguez I feel your pain! I battled with that problem over four days and still couldn’t get the right answer. The solutions are here: http://eloquentjavascript.net/code/ Gordon Zhu has also created an annotated version of the first 8 chapters of Eloquent JavaScript: http://watchandcode.com/courses/eloquent-javascript-the-annotated-version
abasar
@abasar
Nov 16 2015 15:12

Hey guys, I have a problem in jQuery.
I try to change the inner html of two objects in one click event but it only changes the inner html of the first object that i wrote:

$(document).ready(function() {
  $("#generate").click(function() {   
    $("#quote").html(quotes[generate()]);
    $("#person").html("hey");
});
});

it only changes the innerHtml of #quote and not of #person

CamperBot
@camperbot
Nov 16 2015 15:12
:bulb: to format code use backticks! ``` more info
Jorine Bryan Agua
@mongos134
Nov 16 2015 15:14
hello @Rafase282
where to put these?
Your green-box class should give the top of the elements 40px of padding.
Your green-box class should give the left of the elements 40px of padding.
Your green-box class should give the right of the elements 20px of padding.
Your green-box class should give the bottom of the elements 20px of padding.
shubheksha
@shubheksha
Nov 16 2015 15:15
http://codepen.io/shubheksha/pen/bVzdJL?editors=110
Cannot get the plus button to work for some reason. help?
Jorine Bryan Agua
@mongos134
Nov 16 2015 15:15
I tried putting it in the green-box class, didnt work
shubheksha
@shubheksha
Nov 16 2015 15:15
Should I use something else other than a span tag for numbers?
@mongos134 , which exercise are you talking about?
Jorine Bryan Agua
@mongos134
Nov 16 2015 15:17
waypoint: add different padding to each side of an element
ronaldrdguez
@ronaldrdguez
Nov 16 2015 15:17
@renren89 Thanks for the input. I'll try that way.
@robdom I'd rather not look at any solutions yet but thanks for the input.
Oh JS, how I hate your type coercion rules.
CamperBot
@camperbot
Nov 16 2015 15:17
ronaldrdguez sends brownie points to @renren89 and @robdom :sparkles: :thumbsup: :sparkles:
Jorine Bryan Agua
@mongos134
Nov 16 2015 15:17
which by the way is easy but im missing something here.
CamperBot
@camperbot
Nov 16 2015 15:17
:star: 17 | @renren89 | http://www.freecodecamp.com/renren89
:star: 188 | @robdom | http://www.freecodecamp.com/robdom
Coira Ellison
@Coira
Nov 16 2015 15:22
@shubhekshajalan looks like you're getting classes and ids mixed up?
Jorine Bryan Agua
@mongos134
Nov 16 2015 15:22
anybody?:)
Coira Ellison
@Coira
Nov 16 2015 15:23
@shubhekshajalan and maybe text() rather than html()
shubheksha
@shubheksha
Nov 16 2015 15:23
I switched the elements, that's why they got messed up @Coira
I used ids for stuff that needs to changed dynamically, classes for the rest
What exactly has been mixed up?
Coira Ellison
@Coira
Nov 16 2015 15:24
@shubhekshajalan check plus id/class
ramonfabrega
@ramonfabrega
Nov 16 2015 15:25
hey, im in the first slide/thingy of jQuery, where I'm asked to open up script and put document ready
for some reason its not letting me submit it, although i think its correc
<script>
$(document).ready(function() {
});
</script>
shubheksha
@shubheksha
Nov 16 2015 15:26
@Coira , ah fixed that, thanks
CamperBot
@camperbot
Nov 16 2015 15:26
shubhekshajalan sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 311 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Nov 16 2015 15:26
@ramonfabrega it looks ok, are you getting an error msg?
shubheksha
@shubheksha
Nov 16 2015 15:27
Also, this isn't working properly. It's making one disappear and not updating the other as well
ramonfabrega
@ramonfabrega
Nov 16 2015 15:27
when i press ctrl+enter nothing happens
Coira Ellison
@Coira
Nov 16 2015 15:27
@shubhekshajalan np :). have a look at where you're using .html() too, if you haven't already
ramonfabrega
@ramonfabrega
Nov 16 2015 15:27
and the part that says what I should do for the assignent dissapears
the X / checkmark list
Coira Ellison
@Coira
Nov 16 2015 15:28
@ramonfabrega what's the waypoint called?
ramonfabrega
@ramonfabrega
Nov 16 2015 15:28
@Coira Waypoint: Learn how Script Tags and Document Ready Work
shubheksha
@shubheksha
Nov 16 2015 15:28
@Coira , can I use the same function to update both the values as the ids are different?
Chris Wilson
@blockbeard
Nov 16 2015 15:29
help make unique objects
CamperBot
@camperbot
Nov 16 2015 15:29
no wiki entry for: make unique objects
:pencil: click here to create one now!after creating your page type update to reload it here
Rafael J. Rodriguez
@Rafase282
Nov 16 2015 15:29
@mongos134 that is css you style a class with .classname but then if I remember correctly youare styling on the html no?
shubheksha
@shubheksha
Nov 16 2015 15:29
Right now it's updating value of session if I press the other plus button
Coira Ellison
@Coira
Nov 16 2015 15:30
@shubhekshajalan i think so, but won't the session time and break time both get 1 minute added on?
@ramonfabrega i copied and pasted your code and it worked ok for me. did you change anything else?
shubheksha
@shubheksha
Nov 16 2015 15:31
@Coira , they can be set individually, I think
ramonfabrega
@ramonfabrega
Nov 16 2015 15:31
nope, nothing at all
shubheksha
@shubheksha
Nov 16 2015 15:31
Right now, it's updating both simultaneously
ramonfabrega
@ramonfabrega
Nov 16 2015 15:31
its wierd, because it does nto tell me its incorrect, it just doesnt seem to be processing it
i'll try on another browser
Coira Ellison
@Coira
Nov 16 2015 15:31
@ramonfabrega try reset waypoint and redo it? or different browser?
shubheksha
@shubheksha
Nov 16 2015 15:32
I want updating based on the corresponding button that's pressed
Coira Ellison
@Coira
Nov 16 2015 15:32
@ramonfabrega yeah it is weird, could just be some browser funkiness
@shubhekshajalan if i were doing it, i would give the plus buttons different ids based on whether it's updating session or break
ramonfabrega
@ramonfabrega
Nov 16 2015 15:32
@Coira worked in Safari. Thanks
CamperBot
@camperbot
Nov 16 2015 15:32
ramonfabrega sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 312 | @coira | http://www.freecodecamp.com/coira
shubheksha
@shubheksha
Nov 16 2015 15:33
@Coira , they've different ids, class is the same
As they needed to be styled the same way
Coira Ellison
@Coira
Nov 16 2015 15:33
@shubhekshajalan i only see this for your plus buttons <button class="plus btn">
shubheksha
@shubheksha
Nov 16 2015 15:36
I added them to the span tags
Should I add to the buttons as well?
I'll have to make 4 functions for the four buttons?
Coira Ellison
@Coira
Nov 16 2015 15:36
@shubhekshajalan yeah, then you can write another click event for it
@shubhekshajalan i can't think of any other way of doing it, each button has to do something different
perhaps there is a simpler way tho?
shubheksha
@shubheksha
Nov 16 2015 15:38
That's what I've been wondering, @Coira
Koushik Das
@koushik72
Nov 16 2015 15:56
Hi
I need help
Can anyone please help me out with this?
How do I check if anything exists twice in an array?
[1,2,3,5,1,2,3,4,5]
In this array I want to find out which exists more than once?
How do I do that?
Coira Ellison
@Coira
Nov 16 2015 15:58
@koushik72 if you had to do it on paper, how would you do it?
Koushik Das
@koushik72
Nov 16 2015 15:59
Sorry! I forgot to mention. I wanted to find a solution in javascript. @coira
Coira Ellison
@Coira
Nov 16 2015 16:00
@koushik72 i know, but good way of working it out, think about how you would do it on paper first
8001268
@8001268
Nov 16 2015 16:01
;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;;.;..;.;.;.;.;
sorry
Koushik Das
@koushik72
Nov 16 2015 16:02
@Coira I think I have to use filter method.
@Coira But I am really confused on how to remove the ones which exist more than once?
@Coira Please help.
NewCareer
@NewCareer
Nov 16 2015 16:04
CSS question: why does the instruction always have the CSS style going over several lines?
Hans van Riet
@hansinla
Nov 16 2015 16:04
@koushik72 Make an empty help array. Go through the array and check if the element already exists in the help array. If not put the elements you encounter in a help array.
Coira Ellison
@Coira
Nov 16 2015 16:04
@koushik72 do you understand the code from stackoverflow?
Michael Randell
@MichaelRandell
Nov 16 2015 16:05

var Car = function(wheels, seats, engines) {
//Change this constructor
this.wheels = 4;
this.seats = 1;
this.engines = 1;
};

//Try it out here
var myCar = new Car(3,1,2);

// Only change code above this line

hey guys, I'm not sure why this constructor isn't working...Trying to assign new values to the parameters
Koushik Das
@koushik72
Nov 16 2015 16:06
@Coira Yes
Markus Kiili
@Masd925
Nov 16 2015 16:06
@MichaelRandell Use the constructor parameters instead of 4, 1, and 1.
Michael Randell
@MichaelRandell
Nov 16 2015 16:07
so delete the values 4,1,1?
Coira Ellison
@Coira
Nov 16 2015 16:07
@koushik72 i would have a look at .filter() and .indexOf() on mdn, and see how they work
Hans van Riet
@hansinla
Nov 16 2015 16:07

@MichaelRandell Because with this:

this.wheels = 4;
this.seats = 1;
this.engines = 1;

you assign the constants 4, 1, 1 to the properties. You need to assign the values that are passed as arguments wheels, seats, engines.

Koushik Das
@koushik72
Nov 16 2015 16:08
I think there is some solution using filter
Coira Ellison
@Coira
Nov 16 2015 16:08
@koushik72 yep, i would use filter and indexOf to do it
Michael Randell
@MichaelRandell
Nov 16 2015 16:09
hmm...I'm not sure...
Harvey S
@harveysanders
Nov 16 2015 16:09
yep that would work
Hans van Riet
@hansinla
Nov 16 2015 16:09
@MichaelRandell These are the parameters passed
function(wheels, seats, engines)
8001268
@8001268
Nov 16 2015 16:09
@hansinla how do you do that?
Hans van Riet
@hansinla
Nov 16 2015 16:10

null@8001268 I’ll you one example

this.wheels = wheels;

the other two parameters are similar

8001268
@8001268
Nov 16 2015 16:11
no i mean like copy and paste your whole thing
Andrei Kiselev
@gitkiselev
Nov 16 2015 16:11

Make the second child in each of your well elements bounce. You must target the children of element with the target class.
jquery Waypoint: Target a Specific Child of an Element Using jQuery

<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>
Please help me with it!

8001268
@8001268
Nov 16 2015 16:11
@hansinla
Michael Randell
@MichaelRandell
Nov 16 2015 16:11
oooo ok. that was a tricky one. thanks @hansinla
CamperBot
@camperbot
Nov 16 2015 16:11
michaelrandell sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 587 | @hansinla | http://www.freecodecamp.com/hansinla
Michael Randell
@MichaelRandell
Nov 16 2015 16:12
thank you @Masd925
CamperBot
@camperbot
Nov 16 2015 16:12
michaelrandell sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star: 290 | @masd925 | http://www.freecodecamp.com/masd925
Dustin Frank
@DustInCompetent
Nov 16 2015 16:12
<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>
ftfy
Koushik Das
@koushik72
Nov 16 2015 16:13
@Coira Can you please post your solution?
8001268
@8001268
Nov 16 2015 16:13
@DustInCompetent how do u do that
Dustin Frank
@DustInCompetent
Nov 16 2015 16:13
null@8001268 wiki format
CamperBot
@camperbot
Nov 16 2015 16:13

:point_right: code format [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 and then press [shift + enter ⏎]

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

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

How to Code

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

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

Dustin Frank
@DustInCompetent
Nov 16 2015 16:15
gtg
8001268
@8001268
Nov 16 2015 16:15
that did not help at al
Coira Ellison
@Coira
Nov 16 2015 16:17
null@8001268 type three backticks, then shift+enter, then paste in your code. then press ctrl-enter
null@8001268 try it out!
8001268
@8001268
Nov 16 2015 16:18
what are backticks
Coira Ellison
@Coira
Nov 16 2015 16:18
hm, on my keyboard it's the key to the left of 1
@koushik72 do you have any code?
null@8001268 why is there null in front of your name?
8001268
@8001268
Nov 16 2015 16:19
i have no clue lol
Koushik Das
@koushik72
Nov 16 2015 16:20
@Coira No
Coira Ellison
@Coira
Nov 16 2015 16:20
about null@8001268
CamperBot
@camperbot
Nov 16 2015 16:20
you need to ask about @someone!
Coira Ellison
@Coira
Nov 16 2015 16:20
null@8001268 weird :p
8001268
@8001268
Nov 16 2015 16:21
how do u do emojies!!
Coira Ellison
@Coira
Nov 16 2015 16:21
@koushik72 have a go at writing it, you have some of the code from stackoverflow already
Jorine Bryan Agua
@mongos134
Nov 16 2015 16:21

Can someone tell me how to do this?
Give your body element the color property of green.
Your h1 element should inherit the color green from your body element.

whats the meaning of inherit?

8001268
@8001268
Nov 16 2015 16:21

```

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

p {
font-size: 16px;
}
</style>

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

8001268
@8001268
Nov 16 2015 16:21
it dident work
Coira Ellison
@Coira
Nov 16 2015 16:22
null@8001268 type : and a list will come up. smiley faces are the same as in normal text messages
Andrei Kiselev
@gitkiselev
Nov 16 2015 16:22
Please help link above
Koushik Das
@koushik72
Nov 16 2015 16:22
I want to find which ones exist twice and stackoverflow one shows how to eliminate the duplicates @Coira
Coira Ellison
@Coira
Nov 16 2015 16:22
null@8001268 your code should be inside the backticks
8001268
@8001268
Nov 16 2015 16:22
:smile:
oh ok
Coira Ellison
@Coira
Nov 16 2015 16:23
:)
8001268
@8001268
Nov 16 2015 16:23
<style>
  .red-text {
    color: red;
  }

  p {
    font-size: 16px;
  }
</style>

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Koushik Das
@koushik72
Nov 16 2015 16:23
@Coira Wait
8001268
@8001268
Nov 16 2015 16:23
i did it
Coira Ellison
@Coira
Nov 16 2015 16:23
:thumbsup:
8001268
@8001268
Nov 16 2015 16:24
i need help
Koushik Das
@koushik72
Nov 16 2015 16:24
@Coira I didn't even think about it properly
I think I have a clue
Coira Ellison
@Coira
Nov 16 2015 16:24
@koushik72 ok, have a go and see how you do :)
null@8001268 what do you need help with? also, have you linked your account with github?
8001268
@8001268
Nov 16 2015 16:26
yea thats how im talking to yall know and on the thing i just sent u
Andrei Kiselev
@gitkiselev
Nov 16 2015 16:26
I desided my problem.
Hans van Riet
@hansinla
Nov 16 2015 16:27
@gitkiselev Try it with a 2, it’s not zero indexed
Coira Ellison
@Coira
Nov 16 2015 16:28
null@8001268 hm, i can access your github account, but not your fcc account (http://www.freecodecamp.com/8001268)
8001268
@8001268
Nov 16 2015 16:29
ok
Coira Ellison
@Coira
Nov 16 2015 16:29
null@8001268 what's the waypoint called?
8001268
@8001268
Nov 16 2015 16:29
Waypoint: Set the Font Family of an Element
Coira Ellison
@Coira
Nov 16 2015 16:30
null@8001268 have a look at how to use font-family in the instructions
8001268
@8001268
Nov 16 2015 16:30
wym
Coira Ellison
@Coira
Nov 16 2015 16:31
wym?
Kristina Benson
@KriBenson
Nov 16 2015 16:33
Hey there- I'm struggling with the Waypoint: Check the Length Property of a String Variable. I don't know if I just don't understand what they are asking or what, but I added the line "lastNameLength = lastName.length;" and tried to change the number of lastName from 0 to 8, which gives me an error message. I also tried adding a new line "var lastNameLength = 8;" but that doesn't solve it either. Is the order important? Do I need to write a new last name with 8 characters? The directions are confounding me.
Nyamjargal Purevhuu
@nyamjargal
Nov 16 2015 16:35
pls help me how did it? "You should be using Math.random to generate the random decimal number."
Kristina Benson
@KriBenson
Nov 16 2015 16:35
@gitkiselev you need to change your nth number to 2
Coira Ellison
@Coira
Nov 16 2015 16:36
@KriBenson you only need this line lastNameLength = lastName.length
@KriBenson ah ok, i guess you're confused about this lastNameLength should be equal to eight. ?
Kristina Benson
@KriBenson
Nov 16 2015 16:40

@mongos134 Inherit means that your element will have the properties you define for it. So for that waypoint, your solve looks like this, where your h1 element inherits the body color property that you defined above: <style>
body {
background-color: black;
color: green;
font-family: Monospace
}

</style>

<h1>Hello World</h1>

Nyamjargal Purevhuu
@nyamjargal
Nov 16 2015 16:40
pls help me? how to generate math.random function to the random decimal number?
Kristina Benson
@KriBenson
Nov 16 2015 16:41

@Coira exactly! I just did the line lastNameLength=lastNameLength, but it told me "undefined is not an object (evaluating 'lastName.length')

Program Execution Failure"

Coira Ellison
@Coira
Nov 16 2015 16:42
@KriBenson lastNameLength = lastName.length (don't forget the . !)
Mateus Felipe Pereira da Cunha Tavares
@elviradoipiranga
Nov 16 2015 16:43
HI guys! Got stuck here
Coira Ellison
@Coira
Nov 16 2015 16:43
@KriBenson then hopefully, the value of lastNameLength will be 8, as that's how many letters are in "Lovelace"
@KriBenson actually, that line was correct in the code you posted a bit further up
Mateus Felipe Pereira da Cunha Tavares
@elviradoipiranga
Nov 16 2015 16:44
The challenge is: Nest your first image and your h2 element within a single <div class="row"> element. Nest your h2 text within a <div class="col-xs-8"> and your image in a <div class="col-xs-4"> so that they are on the same line.
Kristina Benson
@KriBenson
Nov 16 2015 16:44
@Coira and the semi-colon at the end too, right? But it's giving me the failure message. Maybe it's a bug and it's not me?
Coira Ellison
@Coira
Nov 16 2015 16:44
@KriBenson copy and paste your code here
Mateus Felipe Pereira da Cunha Tavares
@elviradoipiranga
Nov 16 2015 16:44
<div class="row>" <div class="col-xs-8" <h2 class="text-primary text-center">CatPhotoApp</h2></div>
   <a href="#"><div class="col-xs-4"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></div></a></div>
Kristina Benson
@KriBenson
Nov 16 2015 16:44
This message was deleted
Mateus Felipe Pereira da Cunha Tavares
@elviradoipiranga
Nov 16 2015 16:44
is it wrong?
Coira Ellison
@Coira
Nov 16 2015 16:45
@KriBenson this bit
// Only change code below this line.
lastNameLength = lastName;
Kristina Benson
@KriBenson
Nov 16 2015 16:45

@Coira var firstNameLength = 0;
var lastNameLength = 0;
var firstName = "Ada";

firstNameLength = firstName.length;

lastNameLength = lastName.length;

var lastName = "Lovelace";

// Only change code below this line.

lastNameLength = lastName;

// Only change code above this line.

if(typeof(lastNameLength) !== "undefined"){(function(){return lastNameLength;})();}

Coira Ellison
@Coira
Nov 16 2015 16:46
@KriBenson you only need to change the line below // Only change code below this line.
Kristina Benson
@KriBenson
Nov 16 2015 16:46
@Coira Ah, so it was where I was putting it! Thank you!
CamperBot
@camperbot
Nov 16 2015 16:46
kribenson sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 313 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Nov 16 2015 16:46
:thumbsup:
Miikka
@mkktvl
Nov 16 2015 16:47
@elviradoipiranga <a> shoud be inside of <div> i think
Mateus Felipe Pereira da Cunha Tavares
@elviradoipiranga
Nov 16 2015 16:47
@mkktvl i've tried like this and it didn't work :/
Miikka
@mkktvl
Nov 16 2015 16:49
did u noticed that the end tag of <a> is also out of div?
Mateus Felipe Pereira da Cunha Tavares
@elviradoipiranga
Nov 16 2015 16:49
I found out!!
Miikka
@mkktvl
Nov 16 2015 16:50
:clap:
what was it? :)
Gabriel RiCharde
@gabericharde
Nov 16 2015 16:53
having some issues with responsive div and font awesome it seems
mandoflat
@mandoflat
Nov 16 2015 16:54

Hello, I am stuck on this and need to add 3 to each value in this array but am not sure how to write it. this is what i have so far:
Id appreciate any help. :smile:

var oldArray = [1,2,3,4,5];

// Only change code below this line.

var newArray = oldArray;
oldArray.map(function(array){
return array + 3;
});
// Only change code above this line.

Mateus Felipe Pereira da Cunha Tavares
@elviradoipiranga
Nov 16 2015 16:58
@mkktvl i wrote the code like this <div class="row>"
TheProjectMarch
@TheProjectMarch
Nov 16 2015 16:59

Bit of a problem here as I'm running through this beginner stuff and it's the challenge where they're introducing the basics of CSS. I've done the proper CSS to change the0h2 tags to blue, however, it's still saying "your h2 element should be blue".

I'm guesing the issue is with the whole "delete your h2 element's style attribute and instead..."

The original html where they have you insert the inline styling is no longer visible soooo...

ronaldrdguez
@ronaldrdguez
Nov 16 2015 16:59

@mandoflat map will take care of the iteration, the argument you pass to the function is not the array itself but an element

oldArray.map(function(element) { 
   return element + 3;
});

That will return a new array, you need to assign that result to your newArray

Gabriel RiCharde
@gabericharde
Nov 16 2015 17:00
@ronaldrdguez how do you display pieces of formatted code?
ronaldrdguez
@ronaldrdguez
Nov 16 2015 17:01
Three back ticks (usually to the left of 1)
TheProjectMarch
@TheProjectMarch
Nov 16 2015 17:01
^^ read that bud
Gabriel RiCharde
@gabericharde
Nov 16 2015 17:02
@elviradoipiranga i'm in the same exercise i think, only it's not accepting my <div class="row"> or <div class="col-xs-6"> though I have very clearly followed instructions.
gracias @TheProjectMarch @ronaldrdguez
TheProjectMarch
@TheProjectMarch
Nov 16 2015 17:03
nevermind, I just used the clear code button and it reset the code which NOW shows the orignal HTML. For some reason, it didn't show that upon the start of the challenge.
I'll let you know when I get there, @gabericharde :)
mandoflat
@mandoflat
Nov 16 2015 17:03
@ronaldrdguez, thank you i will give it a try.
CamperBot
@camperbot
Nov 16 2015 17:03
mandoflat sends brownie points to @ronaldrdguez :sparkles: :thumbsup: :sparkles:
:star: 367 | @ronaldrdguez | http://www.freecodecamp.com/ronaldrdguez
Gabriel RiCharde
@gabericharde
Nov 16 2015 17:04
@TheProjectMarch no rush ;)
Jimmy
@jimmydwitts83
Nov 16 2015 17:04
waypoint 85, Nest your i element within your button element. How do I do that?
Gabriel RiCharde
@gabericharde
Nov 16 2015 17:04
@jimmydwitts83 add the i element where your raw text goes for your button
<i class="fa fa-thumbs-up"></i>
i believe
Jimmy
@jimmydwitts83
Nov 16 2015 17:05
oh, simple of course
thank you gabe
Gabriel RiCharde
@gabericharde
Nov 16 2015 17:05
no prob :D
problematicone
@xhvrqlle
Nov 16 2015 17:05
I'm stuck on Palindromes, this is my code. Can someone help me find an error? It's always returning true
function palindrome(str) {
  // Good luck!
  var mmrrgrr = str.replace(/,/g,''); // mmrrgrr removes commas
  var mrrgrr = mmrrgrr.replace(/ /g,''); // mrrgrr removes whitespace
  mrrgrr.toLowerCase();

  var FirstArray = mrrgrr.split('');
  var SecondArray = FirstArray.reverse();

  almostFinal = FirstArray.join('');
  almostFinalToo = SecondArray.join('');

  if(almostFinal == almostFinalToo) {
    return true;
  } else return false;
}


palindrome("eye");
Gabriel RiCharde
@gabericharde
Nov 16 2015 17:10
<div class="row">
    <div class="col-xs-6">
      <button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
    </div>
    <div class="col-xs-6">
      <button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button>
    </div>
    <div class="col-xs-6">
      <button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button>
    </div> 
  </div>
Can't get the above to be recognized. It's asking for "Nest all of your radio buttons within a <div class="row"> element. Then nest each of them within a <div class="col-xs-6"> element." I think that's what I have.
Hans van Riet
@hansinla
Nov 16 2015 17:10
@xhvrqlle You have to assign the result of this, you cannot change a string or array in place
mrrgrr.toLowerCase();
problematicone
@xhvrqlle
Nov 16 2015 17:10
Let me try
Hans van Riet
@hansinla
Nov 16 2015 17:11
@xhvrqlle You’ll also have to remove more than just commas and whitespace.
problematicone
@xhvrqlle
Nov 16 2015 17:11
@hansinla which are?
Hans van Riet
@hansinla
Nov 16 2015 17:12
@xhvrqlle Everything but characters a-z, Best to use a regex for this.
Alexander Køpke
@alexanderkopke
Nov 16 2015 17:12
@gabericharde ok doesn't look like radio buttons to me or am I missing something?
Michael Randell
@MichaelRandell
Nov 16 2015 17:12
var singleVal = array.reduce(function(previousVal, currentVal){
return previousVal + currentVal;
}, 0); ----Hey guys...Just a quick question....Why is that 0 (zero) put in at the end there?
Gabriel RiCharde
@gabericharde
Nov 16 2015 17:12
hahaha, you're right @alexanderkopke ! i've been so focused on my font awesome icons, i mixed them in my head.
hahaha
thanks!
problematicone
@xhvrqlle
Nov 16 2015 17:13
@hansinla Ok. I should remove more than only whitespace and commas. But why code is returning true even when it's not a palindrome. Can't seem to find why it seems to be doing this
Coira Ellison
@Coira
Nov 16 2015 17:13
Michael Randell
@MichaelRandell
Nov 16 2015 17:14
thank you @Coira
CamperBot
@camperbot
Nov 16 2015 17:14
michaelrandell sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 314 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Nov 16 2015 17:15
:)
novlem
@m3lv0n
Nov 16 2015 17:15
newb question here I keep getting the error message expected and assignment or function call and instead saw expression. I get this from typing
"lastName".length;
TheProjectMarch
@TheProjectMarch
Nov 16 2015 17:17
not on that challenge but you shouldn't be wrapping that in quotes if that's the name of the variable
Coira Ellison
@Coira
Nov 16 2015 17:17
@m3lv0n you don't need the quotation marks
@m3lv0n if it's the waypoint i'm thinking of
Hans van Riet
@hansinla
Nov 16 2015 17:18
@xhvrqlle use this line var SecondArray = mrrgrr.split('').reverse(); then it will work
novlem
@m3lv0n
Nov 16 2015 17:18
After removing the quotes same thing
Coira Ellison
@Coira
Nov 16 2015 17:18
@m3lv0n post more code
novlem
@m3lv0n
Nov 16 2015 17:19
ok
TheProjectMarch
@TheProjectMarch
Nov 16 2015 17:19
Ok, are all these challenges buggy in firefox? Nearly every time I move on to a new challenge I have to click the reset button to make the previous code appear. Otherwise it's just the blank editor. Is this problem non-existent in chrome by any chance?
novlem
@m3lv0n
Nov 16 2015 17:20

var firstNameLength = 0;
var lastNameLength = 0;
var firstName = "Ada";

firstNameLength = firstName.length;

var lastName = "Lovelace";

// Only change code below this line.

lastName.length;

// Only change code above this line.

if(typeof(lastNameLength) !== "undefined"){(function(){return lastNameLength;})();}

problematicone
@xhvrqlle
Nov 16 2015 17:20
it still doesn't work :c
function palindrome(str) {
  // Good luck!
  var mmrrgrr = str.replace(/,/g,''); // mmrrgrr removes commas
  var mrrgrr = mmrrgrr.replace(/ /g,''); // mrrgrr removes whitespace
  var rrgrr = mrrgrr.toLowerCase();

  //rrgrr = str.replace(/[a-zA-Z]/,'');

  var FirstArray = rrgrr.split('');
  //var SecondArray = FirstArray.reverse();
  var SecondArray = rrgrr.split('').reverse();

  almostFinal = FirstArray.join('');
  almostFinalToo = SecondArray.join('');

  if(almostFinal === almostFinalToo) {
    return true;
  } else return false;
}
palindrome("eye");
novlem
@m3lv0n
Nov 16 2015 17:20
could it be Firefox issue
Coira Ellison
@Coira
Nov 16 2015 17:21
@m3lv0n ah ok, lastName.length fetches the length of "lovelace", but you need to store that value somewhere
TheProjectMarch
@TheProjectMarch
Nov 16 2015 17:21

It has no idea what you want to do with it.

lastName.length;

does nothing. You're not using it in any way. So the interpreter is saying "hey, assign this or use the value in a function... because it's useless right now" lol

Coira Ellison
@Coira
Nov 16 2015 17:21
@m3lv0n assign it to a variable
novlem
@m3lv0n
Nov 16 2015 17:22
please bear with me I thought that
var lastName = "Lovelace"; assigned the variable
Hans van Riet
@hansinla
Nov 16 2015 17:23
@xhvrqlle It works fo me on character only words, you can simplify your return to this return (almostFinal === almostFinalToo); what eror do you get?
TheProjectMarch
@TheProjectMarch
Nov 16 2015 17:23
right but the part that's giving you the trouble is lastName.length;
you haven't assigned that to anything.

I think you wanted

lastNameLength = lastName.length;

problematicone
@xhvrqlle
Nov 16 2015 17:24
palindrome("A man, a plan, a canal. Panama") should return true.
palindrome("My age is 0, 0 si ega ym.") should return true.
palindrome("0_0 (: /-\ :) 0-0") should return true.
These are the ones it's giving error for.
Coira Ellison
@Coira
Nov 16 2015 17:24
@xhvrqlle your variable naming is a little confusing :p
problematicone
@xhvrqlle
Nov 16 2015 17:25
so I will have to remove punctuation, numbers and slash/backslashes
Yes, I love murlocs
novlem
@m3lv0n
Nov 16 2015 17:25
duh, thanks guys
problematicone
@xhvrqlle
Nov 16 2015 17:25
MRRGRRRRR
TheProjectMarch
@TheProjectMarch
Nov 16 2015 17:25
lol no problem @m3lv0n
Coira Ellison
@Coira
Nov 16 2015 17:25
oh lol!
Hans van Riet
@hansinla
Nov 16 2015 17:26
@xhvrqlle Well, you didn’t remove the period . nor special characters and numbers.
problematicone
@xhvrqlle
Nov 16 2015 17:26
@hansinla Yeah so I will have to work on that. thanks for the help
CamperBot
@camperbot
Nov 16 2015 17:26
xhvrqlle sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 588 | @hansinla | http://www.freecodecamp.com/hansinla
problematicone
@xhvrqlle
Nov 16 2015 17:27
@hansinla By the way why did your line with reverse in it work?
Hans van Riet
@hansinla
Nov 16 2015 17:28
@xhvrqlle Because reverse changes the array IN PLACE, so you were also changing FirstArray. When debugging, you should use console.log() a lot to see what’s going on in your code if it’s not working as expected.
Mahadevan
@karthic2914
Nov 16 2015 17:29
hi all
Hans van Riet
@hansinla
Nov 16 2015 17:29
@karthic2914 hi
Mahadevan
@karthic2914
Nov 16 2015 17:29
does any body has the knowledge on reg exp
i am new to reg exp
Alexander Køpke
@alexanderkopke
Nov 16 2015 17:30
can never get console.log to work. I use return
Hans van Riet
@hansinla
Nov 16 2015 17:30
@karthic2914 This is a great resource regex101.com
problematicone
@xhvrqlle
Nov 16 2015 17:30
@hansinla Yeah, issue with that also. Where can I debug? Because on the site I can't really manipulate in a way like in a compiler. Any recommendation? I've thought I could open my file with notepad++ and save it while having it open in a browser and hitting F5?
Hans van Riet
@hansinla
Nov 16 2015 17:30
@alexanderkopke That’s something completely different. Which text editor do you use?
Mahadevan
@karthic2914
Nov 16 2015 17:30
i have a question reg exp
kindly please look this question
Alexander Køpke
@alexanderkopke
Nov 16 2015 17:31
@hansinla I don't.. I just use the one in on FCC
Chris Shank
@AmblingAlp
Nov 16 2015 17:31

hello, having some trouble understanding how to get the lastName.length to work.
var firstNameLength = 0;
var lastNameLength = 0;
var firstName = "Ada";

firstNameLength = firstName.length;

var lastName = "Lovelace";

// Only change code below this line.

lastNameLength = lastName;
lastName.length

// Only change code above this line.

if(typeof(lastNameLength) !== "undefined"){(function(){return lastNameLength;})();}

Alexander Køpke
@alexanderkopke
Nov 16 2015 17:31
it has a little black "terminal" kinda sorta window that shows the return of the function
Hans van Riet
@hansinla
Nov 16 2015 17:31
@alexanderkopke Okay and when you open developer tools in your browser, you don’t see the console?
Logan Bickmore
@loganbickmore
Nov 16 2015 17:32

On a separate note: Waypoint: Make Unique Objects by Passing Parameters to our Constructor

I am struggling to finish this Waypoint. It requests
Calling new Car(3,1,2) should produce an object with a wheels property of 3, a seats property of 1, and an engines property of 2.
which I do by stating
var myCar = new Car(3,1,2);
But for some reason it is still returning the original constructors values.. :(

Alexander Androsyuk
@alex2sat
Nov 16 2015 17:32
@xhvrqlle open in your brouser dev panel (f12 usually) and your saw console.log() http://prntscr.com/93gj50
Alexander Køpke
@alexanderkopke
Nov 16 2015 17:32
my browser has dev tools? oO
Coira Ellison
@Coira
Nov 16 2015 17:32
@alexanderkopke what browser you using?
Alexander Køpke
@alexanderkopke
Nov 16 2015 17:32
chrome
TheProjectMarch
@TheProjectMarch
Nov 16 2015 17:32
Oh nice, I just realized they have Emmet in the editor XD
Alexander Androsyuk
@alex2sat
Nov 16 2015 17:32
all browser have dev tools
Hans van Riet
@hansinla
Nov 16 2015 17:32
@lbickmore What code do you have so far?
Coira Ellison
@Coira
Nov 16 2015 17:33
@alexanderkopke press f12, does that bring the console up?
Logan Bickmore
@loganbickmore
Nov 16 2015 17:33
var Car = function() {
  //Change this constructor
  this.wheels = 4;
  this.seats = 1;
  this.engines = 1;
};

//Try it out here

var myCar = new Car(3,1,2);

// Only change code above this line

(function() {return JSON.stringify(myCar);})();
problematicone
@xhvrqlle
Nov 16 2015 17:33
@alex2sat I know Russian (just a bit) it says "For site" in Russian, doesn't it? :P and thanks!
CamperBot
@camperbot
Nov 16 2015 17:33
xhvrqlle sends brownie points to @alex2sat :sparkles: :thumbsup: :sparkles:
:star: 32 | @alex2sat | http://www.freecodecamp.com/alex2sat
Alexander Køpke
@alexanderkopke
Nov 16 2015 17:33
yeah something pops up
Hans van Riet
@hansinla
Nov 16 2015 17:34
@lbickmore in this piece of code var myCar = new Car(3,1,2); you’re passing three parameters to your function, but you don’t use those in your function.
Alexander Androsyuk
@alex2sat
Nov 16 2015 17:34
@xhvrqlle your right :) "For site"\
Alexander Køpke
@alexanderkopke
Nov 16 2015 17:34
hmm I click console it says cannot load
maybe I try firefox
Coira Ellison
@Coira
Nov 16 2015 17:34
@alexanderkopke you'll see along the top, "Elements Network .... Console". click on console. when you put in a console.log("something") in your code, that's where it'll show up
Alexander Køpke
@alexanderkopke
Nov 16 2015 17:35
ahh ok thx
I just thought it printed out any output
Alexander Androsyuk
@alex2sat
Nov 16 2015 17:35
or in console your can run some js code
Coira Ellison
@Coira
Nov 16 2015 17:35
@alexanderkopke it also shows other stuff, like GET and POST etc, you can turn that off using the "All Errors etc". but useful to see 404 errors later on for ziplines
oh yeah, that too
Alexander Køpke
@alexanderkopke
Nov 16 2015 17:36
@Coira @alex2sat thanks :)
CamperBot
@camperbot
Nov 16 2015 17:36
alexanderkopke sends brownie points to @coira and @alex2sat :sparkles: :thumbsup: :sparkles:
:star: 33 | @alex2sat | http://www.freecodecamp.com/alex2sat
:star: 315 | @coira | http://www.freecodecamp.com/coira
Alexander Androsyuk
@alex2sat
Nov 16 2015 17:36
@alexanderkopke np
Chris Shank
@AmblingAlp
Nov 16 2015 17:36
im confused abut where to put the fucntion
lastname.length
Coira Ellison
@Coira
Nov 16 2015 17:36
super useful
Hans van Riet
@hansinla
Nov 16 2015 17:37
@AmblingAlp Did you try a few places?
Chris Shank
@AmblingAlp
Nov 16 2015 17:38
i did but i get an error
Alexander Køpke
@alexanderkopke
Nov 16 2015 17:38
any hints when starting ziplines? I feel like I don't remember any of the bootstrap material
Hans van Riet
@hansinla
Nov 16 2015 17:38
@AmblingAlp Show us your code.
Chris Shank
@AmblingAlp
Nov 16 2015 17:38

var firstNameLength = 0;
var lastNameLength = 0;
var firstName = "Ada";

firstNameLength = firstName.length;

var lastName = "Lovelace";

// Only change code below this line.

lastNameLength = lastName;

// Only change code above this line.

if(typeof(lastNameLength) !== "undefined"){(function(){return lastNameLength;})();}

TheProjectMarch
@TheProjectMarch
Nov 16 2015 17:39

@lbickmore

You're not using any arguments in your constructor. You're using set values. So it will always build that object with 4 wheels, 1 seats and 1 engine. To pass in the values, you need parameters in the actual constructor function that will allow you to pass it some arguments.

var Car = function(wheels, seats, engines) { //Change this constructor 
   this.wheels = wheels; 
   this.seats = seats; 
   this.engines = engines; }; //Try it out here 

var myCar = new Car(3,