These are chat archives for FreeCodeCamp/Help

6th
Nov 2015
Randy Goldsmith
@Dueldrawer8
Nov 06 2015 00:00
took me a while to figure out how to make the background image go as i scroll down and then move into another background image
Kyle Biancardi
@KyleBiancardi
Nov 06 2015 00:00

We are now going to try and combine some of the stuff we've just learned and create the logic for a slot machine game.

For this we will need to generate three random numbers between 1 and 3 to represent the possible values of each individual slot.

Store the three random numbers in slotOne, slotTwo and slotThree.

Generate the random numbers by using the system we used earlier (an explanation of the formula can be found here):

Math.floor(Math.random() * (3 - 1 + 1)) + 1;

Randy Goldsmith
@Dueldrawer8
Nov 06 2015 00:00
basically had to look at someones else code and figure it out from there
Kyle Biancardi
@KyleBiancardi
Nov 06 2015 00:00
anybody have any ideas
Matt Yamamoto
@MattYamamoto
Nov 06 2015 00:00
@Dueldrawer8 but it's looking good so far.
@KyleBiancardi are you just asking what's going on in that code?
Randy Goldsmith
@Dueldrawer8
Nov 06 2015 00:02
@MattYamamoto thanks means alot
CamperBot
@camperbot
Nov 06 2015 00:02
dueldrawer8 sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:warning: dueldrawer8 already gave mattyamamoto points
aguaca
@aguaca
Nov 06 2015 00:07
the property engines of myCar should be a number... any help
Matt Yamamoto
@MattYamamoto
Nov 06 2015 00:08
@aguaca paste in your code.
wiki format
CamperBot
@camperbot
Nov 06 2015 00:08

: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

Matt Yamamoto
@MattYamamoto
Nov 06 2015 00:09
@KyleBiancardi maybe you figured it out already, but you had a closing parens in the wrong spot. You should think about how all that floor/random stuff is working there.
Kyle Biancardi
@KyleBiancardi
Nov 06 2015 00:17
well i repeated the random number function three times and the numbers came up random i just cant figure out why its telling me to use the function three times which i did
Kyle Biancardi
@KyleBiancardi
Nov 06 2015 00:24
ok thank you @MattYamamoto
CamperBot
@camperbot
Nov 06 2015 00:24
kylebiancardi sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 470 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Kyle Biancardi
@KyleBiancardi
Nov 06 2015 00:30
hey @Dueldrawer8 where did you get into that text editor i like it. portfolio looks good man keep it up. what waypoint are u on?
Randy Goldsmith
@Dueldrawer8
Nov 06 2015 00:34
@KyleBiancardi its called codepen.. and thanks! Im
CamperBot
@camperbot
Nov 06 2015 00:34
dueldrawer8 sends brownie points to @kylebiancardi :sparkles: :thumbsup: :sparkles:
:star: 168 | @kylebiancardi | http://www.freecodecamp.com/kylebiancardi
Enraemichele
@Enraemichele
Nov 06 2015 00:34
Help! I'm on the "Use CSS Selectors to Style Elements", and I can't understand what I'm doing wrong. I've got all the check marks checked ecxept the one that says "your h2 element should be blue", but I changed the coding to blue (instead of red).
CamperBot
@camperbot
Nov 06 2015 00:34
no wiki entry for: im on the use css selectors to style elements and i cant understand what im doing wrong ive got all the check marks checked ecxept the one that says your h2 element should be blue but i changed the coding to blue instead of red
:pencil: click here to create one now!after creating your page type update to reload it here
Randy Goldsmith
@Dueldrawer8
Nov 06 2015 00:34
@KyleBiancardi I'm on the first waypoint building your own portfolio
Chris
@Aoxom
Nov 06 2015 00:35
@Enraemichele can you link your code?
wiki format
CamperBot
@camperbot
Nov 06 2015 00:35

: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

Enraemichele
@Enraemichele
Nov 06 2015 00:37
Eh, how?
Chris
@Aoxom
Nov 06 2015 00:38
just copy and paste between 3 backticks
Enraemichele
@Enraemichele
Nov 06 2015 00:38
h2 {color: blue;}
Bo Sanders
@Biletnikoff
Nov 06 2015 00:39
how do i unbreak a challenge?
Enraemichele
@Enraemichele
Nov 06 2015 00:39
<style>
  h2 {color: blue;}

<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>
</style>
there.
It says my h2 element should be blue, but I followed the instructions... Or so I thought. Am I missing something?
Chris
@Aoxom
Nov 06 2015 00:40
@Enraemichele where is the h2 item? you set h2 to be blue, but i dont see any h2 lines
DJ
@qualitymanifest
Nov 06 2015 00:43
@Enraemichele also you need to get your <p> element outside of your css (<style>)
Enraemichele
@Enraemichele
Nov 06 2015 00:44
This is what it started with. It shows what a CSS code should look like, but when I try to add the semi-colon and the curly braces, it doesn't work.
<h2 style="color: red">CatPhotoApp</h2>

<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>
so I add the style on the ends, and then that just leaves the braces and semi-colon.
<style>
<h2 style="color: red">CatPhotoApp</h2>
</style>
But when I try to add them, it doesn't work. I know I must be missing something.
DJ
@qualitymanifest
Nov 06 2015 00:46
@Enraemichele style elements go at the top, leave your HTML below it
h2, for example, is html. it doesn't belong in <style>
Enraemichele
@Enraemichele
Nov 06 2015 00:48
Got it! Thanks.
Jeremy Gunn
@Jermgunn
Nov 06 2015 00:52
hello, I am kinda having the same problem with my class/style lines

<style>.red-text {color: red;}</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>

paragraph is not coming up red, h2 is though
DJ
@qualitymanifest
Nov 06 2015 00:52
@Jermgunn you closed <p> too early
Radhika Kapoor
@kapoorradhika
Nov 06 2015 00:54
@qualitymanifest Hi, I'm having trouble with the conditional logic of "if and else statements".
I need to create a coin-flip game
this is the code i have written
if (1 === 2) {
return heads;
} else {
return tails;
}
DJ
@qualitymanifest
Nov 06 2015 00:55
@kapoorradhika 1 will never be equal to 2
Colin McQuillan
@cbearmcquillanisawsome
Nov 06 2015 00:55
shut the fuck up!
Radhika Kapoor
@kapoorradhika
Nov 06 2015 00:55
I am not quite sure about these boolean values
DJ
@qualitymanifest
Nov 06 2015 00:56
@cbearmcquillanisawsome ¯\(ツ)
Radhika Kapoor
@kapoorradhika
Nov 06 2015 00:56
@qualitymanifest okay, so could you help me figure out the code ? I am new here and don't know how this works
DJ
@qualitymanifest
Nov 06 2015 00:58
@kapoorradhika if you look at the top of your code, the math is stored in the variable flip. so you need to be comparing flip to something
Radhika Kapoor
@kapoorradhika
Nov 06 2015 00:59
@qualitymanifest The whole code is this -

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

function myFunction() {

// Only change code below this line.

if (heads === 0) {
return heads;
} else {
return tails;
}

// Only change code above this line.

}

var result = myFunction();if(typeof(flip) !== "undefined" && typeof(flip) === "number" && typeof(result) !== "undefined" && typeof(result) === "string"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}

Bill
@kirah1314
Nov 06 2015 00:59
This message was deleted
DJ
@qualitymanifest
Nov 06 2015 00:59
@kapoorradhika yep. see what i said above
Jeremy Gunn
@Jermgunn
Nov 06 2015 01:01
@qualitymanifest thank you!!
CamperBot
@camperbot
Nov 06 2015 01:01
jermgunn sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 335 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Randy Goldsmith
@Dueldrawer8
Nov 06 2015 01:02
need help with first waypoint, how do i get rid of that whitespace between both of my background images? Or how do I move my background image up?
Radhika Kapoor
@kapoorradhika
Nov 06 2015 01:03
@qualitymanifest variable flip is equal to finding a random whole number where the max value could be one and minimum value could be zero. Thats all i can understand from the top code
DJ
@qualitymanifest
Nov 06 2015 01:03
Create if and else statements to return the string "heads" if the flip variable is zero, or else return the string "tails" if the flip variable is not zero.
@kapoorradhika :point_up:
Radhika Kapoor
@kapoorradhika
Nov 06 2015 01:05
@qualitymanifest you mean this ?

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

function myFunction() {

// Only change code below this line.

if (flip === 0) {
return heads;
} else {
return tails;
}

// Only change code above this line.

}

var result = myFunction();if(typeof(flip) !== "undefined" && typeof(flip) === "number" && typeof(result) !== "undefined" && typeof(result) === "string"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}

DJ
@qualitymanifest
Nov 06 2015 01:05
@kapoorradhika yes
Radhika Kapoor
@kapoorradhika
Nov 06 2015 01:06
@qualitymanifest I am running tests on this and its showing program execution failure
DJ
@qualitymanifest
Nov 06 2015 01:07
@kapoorradhika oh, yeah. you need to put your returns in quotation marks, since they are strings
Boris
@boris-in-london
Nov 06 2015 01:07
This message was deleted
bot format code
CamperBot
@camperbot
Nov 06 2015 01:07
no wiki entry for: format code
:pencil: click here to create one now!after creating your page type update to reload it here
Boris
@boris-in-london
Nov 06 2015 01:07
This message was deleted
CamperBot
@camperbot
Nov 06 2015 01:07
no wiki entry for: formatting
:pencil: click here to create one now!after creating your page type update to reload it here
DJ
@qualitymanifest
Nov 06 2015 01:07
help format
CamperBot
@camperbot
Nov 06 2015 01:07

: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

Boris
@boris-in-london
Nov 06 2015 01:07
This message was deleted
Radhika Kapoor
@kapoorradhika
Nov 06 2015 01:07
@qualitymanifest Thank you :)
CamperBot
@camperbot
Nov 06 2015 01:08
kapoorradhika sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 336 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
MACELON LIMA
@macelonlima
Nov 06 2015 01:08
HELLO!
DJ
@qualitymanifest
Nov 06 2015 01:08
@kapoorradhika welcome
Chris
@Aoxom
Nov 06 2015 01:12
@Dueldrawer8 try adding "min-height: 120%;" to your #home and #about css classes?
@Dueldrawer8 probably not the right way, but it brought the first two background images together :/
Randy Goldsmith
@Dueldrawer8
Nov 06 2015 01:14
awesome thanks @Aoxom
CamperBot
@camperbot
Nov 06 2015 01:14
dueldrawer8 sends brownie points to @aoxom :sparkles: :thumbsup: :sparkles:
:star: 229 | @aoxom | http://www.freecodecamp.com/aoxom
Daniel Steffano
@Ubernaga
Nov 06 2015 01:15
How would I create a button element?
Chris
@Aoxom
Nov 06 2015 01:15
@Dueldrawer8 again im just a beginner too so its probably not the best way, just a quick fix maybe :)
Daniel Steffano
@Ubernaga
Nov 06 2015 01:16
I'm currently using: <label><input class="btn" type="button" name="like">Like</label>
Bill
@kirah1314
Nov 06 2015 01:17
@Dueldrawer8 add a height to #home and #about like height: 800px;
that'll fix the whitespaces
Fatty Cat
@codingisawsome
Nov 06 2015 01:22
I am stuck on level 22. I can't find where to put my image size.
Daniel Steffano
@Ubernaga
Nov 06 2015 01:22
Level 22 on what section?
Fatty Cat
@codingisawsome
Nov 06 2015 01:25
sorry, it's actually level 17 in HTML5 and CSS
Daniel Steffano
@Ubernaga
Nov 06 2015 01:26
@codingisawsome what it's asking you to do is to create a class named smaller-image. You'll need to do that in the CSS section <style> </style> and create the width to equal 100 pixel

@codingisawsome

.smaller-image{
width: 100px;
}

After you create the class, you can set the image to call the class "smaller-image" by adding inside: <img class="smaller-image" ..... >
<img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat"> in this case.
Christian Lemus
@clemus90
Nov 06 2015 01:29
rooms
CamperBot
@camperbot
Nov 06 2015 01:29

rooms

See all the FreeCodeCamp rooms at gitter.im/FreeCodeCamp/rooms
Or check this wiki article for a shortlist
Fatty Cat
@codingisawsome
Nov 06 2015 01:30
Thanks Ubernaga!(:
CamperBot
@camperbot
Nov 06 2015 01:30
if you want to thank someone, put an @ before their name!
Daniel Steffano
@Ubernaga
Nov 06 2015 01:30
@camperbot You're welcome. Make sure you put @*user's name so they get brownie points :) ;)
@codingisawsome *
Bill
@kirah1314
Nov 06 2015 01:32
help rooms
CamperBot
@camperbot
Nov 06 2015 01:32

:point_right: help rooms [wiki]

There are official help rooms for each major section of FCC content:

Chat Room Description
Help get help with our Waypoint challenges from your fellow campers
HelpBonfires get help with our Bonfire challenges from your fellow campers
HelpZiplines get help with our Zipline challenges from your fellow campers
HelpBasejumps get help with our Basejump challenges from your fellow campers
NonprofitProjects get help with your Nonprofit Projects from your fellow campers
CodeReview get constructive criticism and advice on finished code from your fellow campers
YouCanDoThis learning to code is hard - share your feelings and get moral support here

Choose the right room for your question!
:pencil: read more about help rooms on the FCC Wiki

Brad940
@Brad940
Nov 06 2015 01:37
Hi, I'm stuck on Basic Javascript Waypoint 44. I have the numbers displaying in the slots like it's supposed to but I can't advance to the next challenge because the second criterion "You should have used the selector given in the description..etc" is still crossed.
_jn33
@jn33
Nov 06 2015 01:40
@Brad940 it's easier for people to help if you can show us your code :)
Brad940
@Brad940
Nov 06 2015 01:40
Sorry, just realised myself it would probably help... Here it is:
$(".slot")
$($(".slot")
[0]).html(slotOne);
$($(".slot")
1).html(slotTwo);
$($(".slot")
[2]).html(slotThree);
_jn33
@jn33
Nov 06 2015 01:42
the positioning # in your slotTwo line isn't in brackets - i hope that makes sense to you because i'm still trying to grasp the correct terms to use
haha
Brad940
@Brad940
Nov 06 2015 01:43
Hi @jn33 I've changed the code as you suggested but still no change. Here's what it looks like now:
$(".slot")
$($(".slot")
[0]).html(slotOne);
$($(".slot")
1).html(slotTwo);
$($(".slot")
[2]).html(slotThree);
_jn33
@jn33
Nov 06 2015 01:45
still looks the same to me? also, can i ask you to format?
wiki format
CamperBot
@camperbot
Nov 06 2015 01: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

Brad940
@Brad940
Nov 06 2015 01:46
$(".slot")
    $($(".slot")
     [0]).html(slotOne);
    $($(".slot")
     [1]).html(slotTwo);
    $($(".slot")
     [2]).html(slotThree);
_jn33
@jn33
Nov 06 2015 01:48
@brad i think it's because you have the positioning brackets set as the next line
@Brad940 so if you make it a continuous line.. like so..
    $($(".slot")[0]).html(slotOne);
    $($(".slot")[1]).html(slotTwo);
    $($(".slot")[2]).html(slotThree);
that should do it, i think
OH, sorry, i also meant to tell you that you don't need the first line of $(".slot")
Brad940
@Brad940
Nov 06 2015 01:52
Thanks @jn33 that did the trick! Cheers :smile:
CamperBot
@camperbot
Nov 06 2015 01:52
brad940 sends brownie points to @jn33 :sparkles: :thumbsup: :sparkles:
:star: 199 | @jn33 | http://www.freecodecamp.com/jn33
_jn33
@jn33
Nov 06 2015 01:52
awesome! glad I was able to help :)
DJ
@qualitymanifest
Nov 06 2015 02:13
Anyone know of any jQuery alternatives to toggle now that it has been deprecated (err... removed?)? i have two different functions that i would like to alternate on click
i made this work on another zipline by using .click and an if statement but i'd like to avoid getting into that if possible
Matt Yamamoto
@MattYamamoto
Nov 06 2015 02:16
@qualitymanifest I wasn't aware that toggle could do that, but I think using and if statement is probably the easiest thing to do... why are you against that method?
DJ
@qualitymanifest
Nov 06 2015 02:17
@MattYamamoto here's a sample from the old docs on it
$( "#target" ).toggle(function() {
  alert( "First handler for .toggle() called." );
}, function() {
  alert( "Second handler for .toggle() called." );
});
@MattYamamoto and, idk, i'm not exactly "against" it, just seems like it can be done with less code that way
@MattYamamoto anyway, thanks
CamperBot
@camperbot
Nov 06 2015 02:19
qualitymanifest sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 472 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Nov 06 2015 02:19
@qualitymanifest ah, I was looking at, and familiar with, toggle used for animations.
DJ
@qualitymanifest
Nov 06 2015 02:20
@MattYamamoto yeah from my understanding you can still use it for that, they just made it so you can't alternate functions anymore
Matt Yamamoto
@MattYamamoto
Nov 06 2015 02:20
Well, I'm sure jQuery's implementation was just the same thing, just write your own method to be reused.
DJ
@qualitymanifest
Nov 06 2015 02:20
fair enough
Matt Yamamoto
@MattYamamoto
Nov 06 2015 02:21
haha.. but I realize that is not the simplest solution.
Kilitan
@Kilitan
Nov 06 2015 02:24

I'm hitting a wall with this challenge: Make Object Properties Private. Someone please help.


var myBike = function() {

  speed = 100;

  function addUnit(value) {
    return value + "KM/H";
  } };

  this.getSpeed = function() {
    return addUnit(speed);
  };

Supposed to keep myBike.speed and myBike.addUnit private while making myBike.getSpeed public, thanks for any help I can get. \

CamperBot
@camperbot
Nov 06 2015 02:24
if you want to thank someone, put an @ before their name!
Matt Yamamoto
@MattYamamoto
Nov 06 2015 02:24
@Kilitan you need to declare the speed variable, so do var speed = 100
Kilitan
@Kilitan
Nov 06 2015 02:26
True, thanks @MattYamamoto, but still getting error myBike.speed should be undefined and the method getSpeed of myBike should be accessible outside the object.
CamperBot
@camperbot
Nov 06 2015 02:26
kilitan sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 473 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Nov 06 2015 02:28
@Kilitan oh, I think I see the problem. . . although I can't be sure from just the snippet... but I think you moved getSpeed out of the constructor... that should still be in the Bike function.
wait, no i CAN tell from the snippet... that is the problem
Alvis Ng
@vizFlux
Nov 06 2015 02:42
Hi all, I'm just wondering why would setting body to height: 100% makes the contents within to jump out from a div when resizing browser vertically.
Phuc Le
@PhucLe1992
Nov 06 2015 02:54
hi Guys

var myArray = [];

// Only change code below this line.
for (var i=0; i < 10; i+= 3){
ourArray.push(i);
}

how can I push the odd number from 1 through 9
h4r1m4u
@h4r1m4u
Nov 06 2015 02:56
@PhucLe1992 you can start the for loop at the first odd number after 0 and then increase the value of i so that it iterates over odd numbers only
Phuc Le
@PhucLe1992
Nov 06 2015 02:57
oh thanks
CamperBot
@camperbot
Nov 06 2015 02:57
if you want to thank someone, put an @ before their name!
Phuc Le
@PhucLe1992
Nov 06 2015 02:57
@h4r1m4u thanks
CamperBot
@camperbot
Nov 06 2015 02:57
phucle1992 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 540 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Phuc Le
@PhucLe1992
Nov 06 2015 02:57
like this :D
h4r1m4u
@h4r1m4u
Nov 06 2015 02:57
:clap: :D
ByShadow
@ByShadow
Nov 06 2015 03:00
Hi
h4r1m4u
@h4r1m4u
Nov 06 2015 03:00
@ByShadow welcome
ByShadow
@ByShadow
Nov 06 2015 03:00
Thanks
CamperBot
@camperbot
Nov 06 2015 03:00
if you want to thank someone, put an @ before their name!
Phuc Le
@PhucLe1992
Nov 06 2015 03:00
trying i = 1 then i+= 2
ByShadow
@ByShadow
Nov 06 2015 03:00
Im nw
new*
Phuc Le
@PhucLe1992
Nov 06 2015 03:01
still does not work
is camperbot a bot? @@
h4r1m4u
@h4r1m4u
Nov 06 2015 03:02
can you post your entire code @PhucLe1992 ? yeah, he's the residential bot
Phuc Le
@PhucLe1992
Nov 06 2015 03:02
var myArray = [];
for (var i = 1; i < 10; i+= 2 ){
ourArray.push(i);
}
ByShadow
@ByShadow
Nov 06 2015 03:02
@h4r1m4u can you help me?
h4r1m4u
@h4r1m4u
Nov 06 2015 03:02
@ByShadow what seems to be the issue?
Phuc Le
@PhucLe1992
Nov 06 2015 03:03
should it be 1 and loop 3 and it would equal 3?
h4r1m4u
@h4r1m4u
Nov 06 2015 03:03
@PhucLe1992 which array are you pushing the elements into? wink wink
ByShadow
@ByShadow
Nov 06 2015 03:03
Im stuck here: Waypoint: Use CSS Selectors to Style Elements
Phuc Le
@PhucLe1992
Nov 06 2015 03:04
ah got it
wrong code with "ourArray"
ByShadow
@ByShadow
Nov 06 2015 03:04
And i have to do all this things:
Remove the style attribute from your h2 element.
Create a style element.
Your h2 element should be blue.
Ensure that your stylesheet h2 declaration is valid with a semicolon and closing brace
Make sure all your style elements are valid and have a closing tag.
h4r1m4u
@h4r1m4u
Nov 06 2015 03:04
@PhucLe1992 ;)
@ByShadow yeah, i'm familiar with that waypoint
ByShadow
@ByShadow
Nov 06 2015 03:05

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

<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>
This is the code

Phuc Le
@PhucLe1992
Nov 06 2015 03:05
you just nee to remove the "style" @ByShadow
erase it
ByShadow
@ByShadow
Nov 06 2015 03:06

I remove the style attribute from my h2 element:

<h2>CatPhotoApp</h2?

Phuc Le
@PhucLe1992
Nov 06 2015 03:06
yup
h4r1m4u
@h4r1m4u
Nov 06 2015 03:06
that's one of the steps, yes
ByShadow
@ByShadow
Nov 06 2015 03:06
Create a style element.
<style>
<h2 style="color: red">CatPhotoApp</h2>
</style>
?
Phuc Le
@PhucLe1992
Nov 06 2015 03:07
then you type style="color:blue"
mean you just need to remove red then replace by blue
h4r1m4u
@h4r1m4u
Nov 06 2015 03:08
nope
you're supposed to add the style element at the top of the page
not inside the <h2> element
ByShadow
@ByShadow
Nov 06 2015 03:09
1-<style>
Phuc Le
@PhucLe1992
Nov 06 2015 03:09
either way work I think?
h4r1m4u
@h4r1m4u
Nov 06 2015 03:09
like so:
<style>

  h2 {color: white;}

</style>

<h2>Some heading text<h2>
Phuc Le
@PhucLe1992
Nov 06 2015 03:10
@h4r1m4u true :D
h4r1m4u
@h4r1m4u
Nov 06 2015 03:10
@PhucLe1992 it'll do the same thing, but not pass the waypoint as it's not the requirement
Daniel Steffano
@Ubernaga
Nov 06 2015 03:10
You have to define h2 as the color
Shaquilletharris
@Shaquilletharris
Nov 06 2015 03:10
waypoint: Reverse Arrays with reverse.
Phuc Le
@PhucLe1992
Nov 06 2015 03:10
@ByShadow do as @h4r1m4u show you :D
Daniel Steffano
@Ubernaga
Nov 06 2015 03:10
Just as you would a class, when you define an element, such as h2, all h2s in the code will be set to what you define it as
ByShadow
@ByShadow
Nov 06 2015 03:12
Yeahhhh!!!!!!
Thanks @h4r1m4u , @Ubernaga , @PhucLe1992
CamperBot
@camperbot
Nov 06 2015 03:13
byshadow sends brownie points to @h4r1m4u and @ubernaga and @phucle1992 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for phucle1992
:star: 86 | @ubernaga | http://www.freecodecamp.com/ubernaga
:star: 541 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Daniel Steffano
@Ubernaga
Nov 06 2015 03:13
Np :)
Phuc Le
@PhucLe1992
Nov 06 2015 03:13
I hate the bot lol
Shaquilletharris
@Shaquilletharris
Nov 06 2015 03:13
i used code "newArray = array.reverse(array); and it reversed the array but it has x next to "you should use the reverse method." help what is the proper reverse method
h4r1m4u
@h4r1m4u
Nov 06 2015 03:14
@Shaquilletharris it is the proper method. it just doesn't take any arguments
ByShadow
@ByShadow
Nov 06 2015 03:19
All are you from U.S.A?
h4r1m4u
@h4r1m4u
Nov 06 2015 03:21
nope. there're people from all around the world here
ByShadow
@ByShadow
Nov 06 2015 03:21
Where you from?
Shuk
@BizShuk
Nov 06 2015 03:22
Really all around the world.
h4r1m4u
@h4r1m4u
Nov 06 2015 03:23
i'm originally from europe but live in asia
Phuc Le
@PhucLe1992
Nov 06 2015 03:24
@BizShuk sure
ByShadow
@ByShadow
Nov 06 2015 03:26
Im from Argentina
I'm not speak english very well
But I try
Shuk
@BizShuk
Nov 06 2015 03:27
cool place
ByShadow
@ByShadow
Nov 06 2015 03:27
Yeah, nice
Shuk
@BizShuk
Nov 06 2015 03:30
I'm in Asia, Taiwan. Join FreeCodeCamp for certification. :)
Craig Morrison
@frogmorton
Nov 06 2015 03:35
Asia in the hizzouse LOL
h4r1m4u
@h4r1m4u
Nov 06 2015 03:35
high five!
Craig Morrison
@frogmorton
Nov 06 2015 03:37
Lunchtime in Japan
kelvintantono
@kelvintantono
Nov 06 2015 03:39
hi hi everybody
Craig Morrison
@frogmorton
Nov 06 2015 03:40
@kelvintantono hey there
kelvintantono
@kelvintantono
Nov 06 2015 03:40
Greetings from Indonesia :) i am stuck right here on lesson 162 about Use Conditional Logic with If and Else Statements.
this is what i make
if (flip === 0) {
return heads;
} else {
return tails;
Create if and else statements to return the string "heads" if the flip variable is zero, or else return the string "tails" if the flip variable is not zero.
this is the requirement
need a suggestion :)
thanks
CamperBot
@camperbot
Nov 06 2015 03:41
if you want to thank someone, put an @ before their name!
kelvintantono
@kelvintantono
Nov 06 2015 03:41
@camperbot okay
Craig Morrison
@frogmorton
Nov 06 2015 03:42
Are heads and tails variables?
Phuc Le
@PhucLe1992
Nov 06 2015 03:42

Hi
var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();
I'm stuck here

how can I add properties engines with value number to myCar?
Craig Morrison
@frogmorton
Nov 06 2015 03:43
Why don't you assign a variable the appropriate string value
kelvintantono
@kelvintantono
Nov 06 2015 03:43
@frogmorton not sure :(
@frogmorton can you give me example?
@PhucLe1992 try
varMyCar = function(){
engines=1;
};
Craig Morrison
@frogmorton
Nov 06 2015 03:44
Declare an empty string var before the loop and in the two branches, assign it a new value, and return the variable name no matter which branch is followed
kelvintantono
@kelvintantono
Nov 06 2015 03:45
OMG what am i missing here. :( i really dont understand @frogmorton
Craig Morrison
@frogmorton
Nov 06 2015 03:45
*not loop, I meant before the if / else
kelvintantono
@kelvintantono
Nov 06 2015 03:46
oh okay
h4r1m4u
@h4r1m4u
Nov 06 2015 03:46
@kelvintantono the only issue is that you're returning variables, whereas you need to return strings: heads != "heads"
first is a variable, the second is a string
strings need to be wrapped in quotes
Lefty
@egalinou
Nov 06 2015 03:47
Hi everyone, my name is Lefty, I am from Seattle and first time using waypoint help. Oh and I am stuck. Trying to give a background color to a Div element. Not sure what I am doing wrong.
Craig Morrison
@frogmorton
Nov 06 2015 03:47
Or add the quotes around the things you're returning, like @h4r1m4u is saying
h4r1m4u
@h4r1m4u
Nov 06 2015 03:47
@egalinou welcome! what's the code you have so far?
Lefty
@egalinou
Nov 06 2015 03:47

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

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

thank you @h4r1m4u
CamperBot
@camperbot
Nov 06 2015 03:47
egalinou sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 543 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 06 2015 03:47
what does your html look like?
Lefty
@egalinou
Nov 06 2015 03:48
Excuse the questions I may ask in advance. Do you wan to see all of it ?
Phuc Le
@PhucLe1992
Nov 06 2015 03:49
@kelvintantono not working bro,
Craig Morrison
@frogmorton
Nov 06 2015 03:49
How about just the doc in question
*div
Lefty
@egalinou
Nov 06 2015 03:49
Create a class called gray-background with the background-color of gray. Assign this class to your div element.
kelvintantono
@kelvintantono
Nov 06 2015 03:49
@h4r1m4u @frogmorton do you mean this?
if (flip === 0) {
return heads !="heads";
} else {
return tails !="tails";
}
h4r1m4u
@h4r1m4u
Nov 06 2015 03:50
@egalinou yeah. the classes in your style look correct, so it's probably an issue with your HTML part. did you assign the gray-background class to your <div>?
Craig Morrison
@frogmorton
Nov 06 2015 03:50
No
h4r1m4u
@h4r1m4u
Nov 06 2015 03:50
@kelvintantono lol, no
Craig Morrison
@frogmorton
Nov 06 2015 03:50
Get rid of the exclamation points
h4r1m4u
@h4r1m4u
Nov 06 2015 03:50
what i mean is that heads is not the same as "heads"
Lefty
@egalinou
Nov 06 2015 03:51
My question is, do I assign it to the style or the div ? I have tried both and nothing works.
h4r1m4u
@h4r1m4u
Nov 06 2015 03:51
you need to return strings "heads" and "tails". not variables heads and tails
@egalinou first you create the class in your CSS (you've already done that). then you need to apply the class to your HTML element
kelvintantono
@kelvintantono
Nov 06 2015 03:51
lol
like this?
if (flip === 0) {
return "heads";
} else {
return "tails";
}
h4r1m4u
@h4r1m4u
Nov 06 2015 03:51
yes!
Craig Morrison
@frogmorton
Nov 06 2015 03:52
You need a class or id in your div, AND you need the CSS declaration, @egalinou
kelvintantono
@kelvintantono
Nov 06 2015 03:52
but failed @h4r1m4u :(
the message it said : heads is not defined
h4r1m4u
@h4r1m4u
Nov 06 2015 03:52
can we see the whole code?
Lefty
@egalinou
Nov 06 2015 03:52
I think I understand that @frogmorton . Let try it :)
kelvintantono
@kelvintantono
Nov 06 2015 03:52
okay2

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

function myFunction() {

// Only change code below this line.

if (flip === 0) {
return "heads";
} else {
return "tails";
}

// Only change code above this line.

}

var result = myFunction();if(typeof(flip) !== "undefined" && typeof(flip) === "number" && typeof(result) !== "undefined" && typeof(result) === "string"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}

Phuc Le
@PhucLe1992
Nov 06 2015 03:53

var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();

// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
this is the whole code? How can I add individually properties to myCar?

kelvintantono
@kelvintantono
Nov 06 2015 03:53
@PhucLe1992 okay let me try it again :)
h4r1m4u
@h4r1m4u
Nov 06 2015 03:54
@kelvintantono which waypoint is it? they might have changed something about it since i've done it
kelvintantono
@kelvintantono
Nov 06 2015 03:54
waypoint 162 bro
@PhucLe1992 which way point it is?
h4r1m4u
@h4r1m4u
Nov 06 2015 03:55
there's no 162. which section and waypoint in the section?
Craig Morrison
@frogmorton
Nov 06 2015 03:55
Obviously JS
kelvintantono
@kelvintantono
Nov 06 2015 03:55
yeap,, it is basic javascript
waypoint 37
Phuc Le
@PhucLe1992
Nov 06 2015 03:56
@kelvintantono waypoint 4 of Object Oriented and Functional Programming
h4r1m4u
@h4r1m4u
Nov 06 2015 03:56
@PhucLe1992
var myDog = new Dog(); // myDog is a Dog object
myDog.legs = 4; // myDog now has a property legs of value 4
Phuc Le
@PhucLe1992
Nov 06 2015 03:56
ah got it
h4r1m4u
@h4r1m4u
Nov 06 2015 03:57
@kelvintantono your code passes for me
kelvintantono
@kelvintantono
Nov 06 2015 03:57
@PhucLe1992 it turns out that i havent got there yet. :D
Phuc Le
@PhucLe1992
Nov 06 2015 03:57
@h4r1m4u passed yeah!
Lefty
@egalinou
Nov 06 2015 03:57
ok I added this <div>
div class="gray-background">
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
and still not working.
Phuc Le
@PhucLe1992
Nov 06 2015 03:57
@kelvintantono no problem bro
h4r1m4u
@h4r1m4u
Nov 06 2015 03:57
@egalinou <div class="some-class"></div>
that's the syntax
kelvintantono
@kelvintantono
Nov 06 2015 03:57
@h4r1m4u how to pass code?
Lefty
@egalinou
Nov 06 2015 03:58
oh!!! @h4r1m4u Thank you !!!!!
CamperBot
@camperbot
Nov 06 2015 03:58
egalinou sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: egalinou already gave h4r1m4u points
Craig Morrison
@frogmorton
Nov 06 2015 03:58
Lefty, what did you put in your CSS style sheet for that class?
h4r1m4u
@h4r1m4u
Nov 06 2015 03:58
@kelvintantono try to reset the code, reload the page and enter the same code. if that doesn't work, try a different browser. the code you posted above with return "heads" and return "tails" should work
Lefty
@egalinou
Nov 06 2015 03:59
YESSSS it worked! thank you. @h4r1m4u
CamperBot
@camperbot
Nov 06 2015 03:59
egalinou sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: egalinou already gave h4r1m4u points
kelvintantono
@kelvintantono
Nov 06 2015 03:59
@h4r1m4u okay i will try
Craig Morrison
@frogmorton
Nov 06 2015 04:00
Closing tags = very important;-)
h4r1m4u
@h4r1m4u
Nov 06 2015 04:00
@egalinou nice job
kelvintantono
@kelvintantono
Nov 06 2015 04:00
@h4r1m4u OMG it works. is it a bug?
h4r1m4u
@h4r1m4u
Nov 06 2015 04:00
what worked, the code reset?
kelvintantono
@kelvintantono
Nov 06 2015 04:01
yeah the code reset :smile:
code reset, put the same code again, and it works
Craig Morrison
@frogmorton
Nov 06 2015 04:01
The browser was remembering your previous attempt
h4r1m4u
@h4r1m4u
Nov 06 2015 04:01
cool. sometimes the waypoints can get stuck
kelvintantono
@kelvintantono
Nov 06 2015 04:01
i see
how to give your bronies?
h4r1m4u
@h4r1m4u
Nov 06 2015 04:02
you say 'thanks @someonesname`
CamperBot
@camperbot
Nov 06 2015 04:02
h4r1m4u sends brownie points to @someonesname :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for someonesname
Craig Morrison
@frogmorton
Nov 06 2015 04:02
Just say thank you and his name
kelvintantono
@kelvintantono
Nov 06 2015 04:02
thank you @h4r1m4u
CamperBot
@camperbot
Nov 06 2015 04:02
kelvintantono sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 544 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Craig Morrison
@frogmorton
Nov 06 2015 04:02
With @ symbol
kelvintantono
@kelvintantono
Nov 06 2015 04:02
thank you @frogmorton
CamperBot
@camperbot
Nov 06 2015 04:02
kelvintantono sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:star: 302 | @frogmorton | http://www.freecodecamp.com/frogmorton
Craig Morrison
@frogmorton
Nov 06 2015 04:02
np
Lefty
@egalinou
Nov 06 2015 04:03
@h4r1m4u spent sooo much time on it redoing it and redoing it. thanks !!
CamperBot
@camperbot
Nov 06 2015 04:03
egalinou sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: egalinou already gave h4r1m4u points
Craig Morrison
@frogmorton
Nov 06 2015 04:03
We've ALL been there
h4r1m4u
@h4r1m4u
Nov 06 2015 04:04
@egalinou my pleasure. generally, for all the waypoints, if you get stuck, re-read the sidebar. they pretty much give you the solution there
Lefty
@egalinou
Nov 06 2015 04:05
@h4r1m4u I did and I just could not figure if I had to put it in the style and the div. I tried seperately but not together. Now that you said that I do see how it was worded.
h4r1m4u
@h4r1m4u
Nov 06 2015 04:06
right. yeah, it's true, some of the waypoints could be worded a little better. i see similar questions pop up frequently
Lefty
@egalinou
Nov 06 2015 04:07
@frogmorton thank you. There is comfort in knowing that.
CamperBot
@camperbot
Nov 06 2015 04:07
egalinou sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:star: 303 | @frogmorton | http://www.freecodecamp.com/frogmorton
kelvintantono
@kelvintantono
Nov 06 2015 04:08
anybody know how to remove gitter notification on my right?
it seems stucked
i cant click the "x" button either
Craig Morrison
@frogmorton
Nov 06 2015 04:08
You're quite welcome, and yes, there is comfort in numbers... A community working on common problems
Lefty
@egalinou
Nov 06 2015 04:09
Looking forward to learning more so that SOMEDAY I can offer my assistance. On to the next one !!!
Craig Morrison
@frogmorton
Nov 06 2015 04:12
Good job, keep it up, you'll get there
kelvintantono
@kelvintantono
Nov 06 2015 04:15
I used to not remember the waypoint I have passed. Is that normal?
Matthew Mun
@mattmun
Nov 06 2015 04:16
hey guys
im having trouble with this way point
Waypoint: Construct JavaScript Objects with Functions
Craig Morrison
@frogmorton
Nov 06 2015 04:17
Well if it's new info, maybe one time won't stay in your memory... Doing things over and over helps
Matthew Mun
@mattmun
Nov 06 2015 04:17
oh sorry!
Waypoint: Make Object Properties Private
this one

var Bike = function() {

// Only change code below this line.

this.speed = 100;

function addUnit(value) {
return value + "KM/H";
}

getSpeed = function () {
return addUnit(speed);
};

};

// Only change code above this line.

do i just remove the get speed function and put it outside?
Craig Morrison
@frogmorton
Nov 06 2015 04:21
Did you try that?
Matthew Mun
@mattmun
Nov 06 2015 04:21
yes
not sure if im doing it right though
Phuc Le
@PhucLe1992
Nov 06 2015 04:22
change speed to private
mean this.speed is publicly
so remove this. by var it return speed to private
I just passed that way point
Lefty
@egalinou
Nov 06 2015 04:23
@kelvintantono I take notes on the waypoints. It might slow things a bit but I try to go back and reread them to refresh my memomry.
Matthew Mun
@mattmun
Nov 06 2015 04:24
okay that fixed one error
The method getSpeed of myBike should be accessible outside the object.
im still getting that error though
Phuc Le
@PhucLe1992
Nov 06 2015 04:24
@mattmun use this. for getSpeed
Matthew Mun
@mattmun
Nov 06 2015 04:25
oh okay so i change the this. to var to make it public
and add this. to make it public
got it thanks @PhucLe1992
CamperBot
@camperbot
Nov 06 2015 04:26
mattmun sends brownie points to @phucle1992 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for phucle1992
Phuc Le
@PhucLe1992
Nov 06 2015 04:26
sur @mattmun
@mattmun this. to var to make it private
Matthew Mun
@mattmun
Nov 06 2015 04:26
yup it worked thanks
CamperBot
@camperbot
Nov 06 2015 04:26
if you want to thank someone, put an @ before their name!
Matthew Mun
@mattmun
Nov 06 2015 04:30
i feel like im figuring out the solutions to these waypoints but im not grasping the big picture
Craig Morrison
@frogmorton
Nov 06 2015 04:32
That's just it... Waypoints by definition aren't the big picture
Phuc Le
@PhucLe1992
Nov 06 2015 04:33
it just help you to used to coding
Matthew Mun
@mattmun
Nov 06 2015 04:33
so just plow through them and it will come together eventually?
Phuc Le
@PhucLe1992
Nov 06 2015 04:33
sure
one step at a time
ByShadow
@ByShadow
Nov 06 2015 04:34
Hi
Matthew Mun
@mattmun
Nov 06 2015 04:34
gotcha
Craig Morrison
@frogmorton
Nov 06 2015 04:34
They are more like individual puzzle pieces... Yes, the bonfires are more involved, and the ziplines are even more and so on
Vishwanath Seshagiri
@thebrahminator
Nov 06 2015 04:53
Hi. Please help me with this problem
Make Object Properties Private
Herman Fassett
@HermanFassett
Nov 06 2015 04:54
@thebrahminator what have you tried?
Vishwanath Seshagiri
@thebrahminator
Nov 06 2015 04:54
According to the problem se, we've to set myBike.speed as undefined
Herman Fassett
@HermanFassett
Nov 06 2015 04:55
? Not undefined
Matt Yamamoto
@MattYamamoto
Nov 06 2015 04:55
@thebrahminator well, technically, but don't think of that way
you want to keep the property speed private to the constructor
Vishwanath Seshagiri
@thebrahminator
Nov 06 2015 04:56
Okay! Thanks a lot! :D
CamperBot
@camperbot
Nov 06 2015 04:56
if you want to thank someone, put an @ before their name!
Herman Fassett
@HermanFassett
Nov 06 2015 04:56
What they mean by undefined is it can't be accessed publicly
Vishwanath Seshagiri
@thebrahminator
Nov 06 2015 04:56
@MattYamamoto and @HermanFassett thanks a lot! :)
CamperBot
@camperbot
Nov 06 2015 04:56
thebrahminator sends brownie points to @mattyamamoto and @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 476 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
:star: 525 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Joshua Abu
@Absolutestunna
Nov 06 2015 05:10
Im not sure why this code doesn't pass for the last test. sumFibs(75025) is expected to equal 135721.
function sumFibs(num) {
  var total = 0;
  var num_array = [1, 1];

  while (total<num){
    var first_num = num_array[num_array.length-1];
    var second_num = num_array[num_array.length-2];

    total = first_num+second_num;
    if (total<num){
      num_array.push(total);
    }
  }

//check and remove even numbers from the sequence


  for (var i=0; i<num_array.length; i++){
    if (num_array[i]%2===0){
       num_array.splice(i, 1);     
    } 

//Add the total odd numbers in the sequence    

  }
  var total_array = num_array.reduce(function (a, b){
        return a+b;
      });
  return total_array;
}

sumFibs(75025);
But I'm not getting that.
Herman Fassett
@HermanFassett
Nov 06 2015 05:11
But you got it right for other test @Absolutestunna ?
Joshua Abu
@Absolutestunna
Nov 06 2015 05:11
yea
All of it except the last one. And to be honest, I am thinking FCC is wrong on this one. but idk
Herman Fassett
@HermanFassett
Nov 06 2015 05:12

@Absolutestunna if you remove the if statement surrounding push

if (total<num){
    num_array.push(total);
}

it returns 135721 not sure if that messes up other test though

Joshua Abu
@Absolutestunna
Nov 06 2015 05:12
Both sumFibs(75024) and sumFibs(75024) = 60696
Herman Fassett
@HermanFassett
Nov 06 2015 05:14

When I have

while (total<num){
  var first_num = num_array[num_array.length-1];
  var second_num = num_array[num_array.length-2];
  total = first_num+second_num;
  num_array.push(total);
}

I get sumFib(75024) = 135721

Joshua Abu
@Absolutestunna
Nov 06 2015 05:14
I got it. The "if" test should be "<=" not <
Herman Fassett
@HermanFassett
Nov 06 2015 05:14
But I think that messes up the other tests
Oh yeah that's it
;P
Nice work
Joshua Abu
@Absolutestunna
Nov 06 2015 05:15
@HermanFassett Thank you sir
CamperBot
@camperbot
Nov 06 2015 05:15
absolutestunna sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 527 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Nov 06 2015 05:15
Yep glad to be a rubber duck
sagar
@sagarbhaila
Nov 06 2015 06:02
what does it means?"Give elements with the red-text class a font-size of 16px.
"
h4r1m4u
@h4r1m4u
Nov 06 2015 06:28
@sagarbhaila it means you need to set a font-size CSS property for the red-text class to 16px (px stands for pixels). if i had a class my-class and wanted the font to be 25px, this is how i'd do it:
<style>
.my-class {
  font-size: 25px;
}
</style>
Michael Guest
@MichaelGuest
Nov 06 2015 06:29
Can someone help me with Waypoint: Iterate over Arrays with map?

h4r1m4u
@h4r1m4u
Nov 06 2015 06:31
@MichaelGuest what seems to be the issue and what's your code?
Michael Guest
@MichaelGuest
Nov 06 2015 06:31
var oldArray = [1,2,3,4,5];

// Only change code below this line.


var newArray = oldArray;
var array = [1,2,3,4,5];
array = array.map(function(val){
  return val + 3;

});

// Only change code above this line.

(function() {return newArray;})();
The issue is I need to add three to each value in the array.
I am not sure whats wrong because i thought return val + 3 adds 3 to the array?
h4r1m4u
@h4r1m4u
Nov 06 2015 06:32

@MichaelGuest this is the tester function for the waypoint:

(function() {return newArray;})();

can you see which which variable it's returning?

compare with which variable you save the result of your map() to. wink wink
Michael Guest
@MichaelGuest
Nov 06 2015 06:32
Its returning [1, 2, 3, 4,5] which is the array
h4r1m4u
@h4r1m4u
Nov 06 2015 06:33
what's the variable it returns called?
Michael Guest
@MichaelGuest
Nov 06 2015 06:33
val?
h4r1m4u
@h4r1m4u
Nov 06 2015 06:33
(function() {return newArray;})(); in this function
what variable does it use?
Michael Guest
@MichaelGuest
Nov 06 2015 06:34
ohh
newArray
h4r1m4u
@h4r1m4u
Nov 06 2015 06:34
yep.
which variable do you save the result of your map() to?
Michael Guest
@MichaelGuest
Nov 06 2015 06:34
I think I know what to change now haha
newArray
h4r1m4u
@h4r1m4u
Nov 06 2015 06:34
bingo!
:D
Michael Guest
@MichaelGuest
Nov 06 2015 06:34
Wow Sweet thanks @h4r1m4u
CamperBot
@camperbot
Nov 06 2015 06:34
michaelguest sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 545 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Michael Guest
@MichaelGuest
Nov 06 2015 06:34
you were really helpful!
h4r1m4u
@h4r1m4u
Nov 06 2015 06:34
you're welcome
Michael Guest
@MichaelGuest
Nov 06 2015 06:35
I need to pay more attention to the testers from now on.
h4r1m4u
@h4r1m4u
Nov 06 2015 06:35
yeah, most of them don't try to trick you this way. i think this one might be the only one
Michael Guest
@MichaelGuest
Nov 06 2015 06:35
I see
I had a redundant line of code in their too.
var array = [1,2,3,4,5];
h4r1m4u
@h4r1m4u
Nov 06 2015 06:37
yeah, that's not needed
Michael Guest
@MichaelGuest
Nov 06 2015 06:37
cool
MirkaG
@MirkaG
Nov 06 2015 06:43
Hey guys, mind if I ask for some help?
h4r1m4u
@h4r1m4u
Nov 06 2015 06:43
@MirkaG sure. what's the issue?
MirkaG
@MirkaG
Nov 06 2015 06:44
I'm on the lesson where I need to make a text input required and I can't seem to figure out how to do this correctly
h4r1m4u
@h4r1m4u
Nov 06 2015 06:44
what's your code?
MirkaG
@MirkaG
Nov 06 2015 06:44
I wrote out <input type="text" required>
h4r1m4u
@h4r1m4u
Nov 06 2015 06:45
did you make a new <input> element or edited the one provided to you by the waypoint?
MirkaG
@MirkaG
Nov 06 2015 06:45
HA nevermind I figured it out. Yeah, I added a new <input> instead of editing
h4r1m4u
@h4r1m4u
Nov 06 2015 06:45
;)
MirkaG
@MirkaG
Nov 06 2015 06:45
Thanks so much!
CamperBot
@camperbot
Nov 06 2015 06:45
if you want to thank someone, put an @ before their name!
MirkaG
@MirkaG
Nov 06 2015 06:46
@h4r1m4u Thank you <3
CamperBot
@camperbot
Nov 06 2015 06:46
mirkag sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 547 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 06 2015 06:46
my pleasure
Kofi A.
@iamkarsoft
Nov 06 2015 07:30
Good morning guys
stuck on this slotter machine session
have to make the if statement to return null
has anyone completed this section??
tva10
@tva10
Nov 06 2015 07:31
yep
@iamkarsoft show your code
Kofi A.
@iamkarsoft
Nov 06 2015 07:32
if(slotOne === slotTwo || slotTwo === slotThree || slotOne === slotThree
){
return Null;
}
tva10
@tva10
Nov 06 2015 07:35
@iamkarsoft Waypoint: Add your JavaScript Slot Machine Slots, this waypoint?
Kofi A.
@iamkarsoft
Nov 06 2015 07:36
yes @tva10
tva10
@tva10
Nov 06 2015 07:37
in this waypoint you need to retrun null if slotOne != slotTwo or slotTwo != slotThree
 // Only change code below this line.
    if(slotOne !== slotTwo || slotTwo !== slotThree){

      return null;

    }    
    // Only change code above this line.
Kofi A.
@iamkarsoft
Nov 06 2015 07:38
thanks @tva10 code work perfectly
CamperBot
@camperbot
Nov 06 2015 07:38
iamkarsoft sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 320 | @tva10 | http://www.freecodecamp.com/tva10
MirkaG
@MirkaG
Nov 06 2015 08:02
Can someone please remind me how to create a class that makes pink text?
Lance
@texas2010
Nov 06 2015 08:03
class="pink-text"?
Abhisek Pattnaik
@abhisekp
Nov 06 2015 08:04
@MirkaG why it's always pink? :P
MirkaG
@MirkaG
Nov 06 2015 08:04
@dwd2010 isn't it supposed to start with a . ?
Vanessa Vengco
@vanven
Nov 06 2015 08:04
yes
MirkaG
@MirkaG
Nov 06 2015 08:05
@abhisekp very good question! lol
Lance
@texas2010
Nov 06 2015 08:05
suppose to start with a? i dont understand?
MirkaG
@MirkaG
Nov 06 2015 08:06
@vanven I did .pinktext {class="pink text"} what am I forgetting?
Vanessa Vengco
@vanven
Nov 06 2015 08:06
.pink-text { color: "pink";}
MirkaG
@MirkaG
Nov 06 2015 08:06
@dwd2010 you missed the period "."
@vanven Thank you!
CamperBot
@camperbot
Nov 06 2015 08:06
mirkag sends brownie points to @vanven :sparkles: :thumbsup: :sparkles:
:star: 138 | @vanven | http://www.freecodecamp.com/vanven
Vanessa Vengco
@vanven
Nov 06 2015 08:07
the .pink-text is the class name you are targetting
Lance
@texas2010
Nov 06 2015 08:07
oh boy. i am helpless now. sorry. I cant sleep.
Abhisek Pattnaik
@abhisekp
Nov 06 2015 08:07
@MirkaG When you try to select using a pattern, then you use # or . but when implementing the class using class="some-class", you don't write the .
Lance
@texas2010
Nov 06 2015 08:08
I just assume about @MirkaG did learn it on FCC :S
MirkaG
@MirkaG
Nov 06 2015 08:08
@abhisekp Thank you :smile:
CamperBot
@camperbot
Nov 06 2015 08:08
mirkag sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 853 | @abhisekp | http://www.freecodecamp.com/abhisekp
MirkaG
@MirkaG
Nov 06 2015 08:09
@dwd2010 hahaha
Abhisek Pattnaik
@abhisekp
Nov 06 2015 08:09
@MirkaG in html, you are specifically writing that you're implementing a class using <div class="some-class"></div> or while implementing an id using <div id="unique-id"></div>.
So you don't need a . or #
Lance
@texas2010
Nov 06 2015 08:09
yeah, sorry. my brain is fried. @MirkaG
MirkaG
@MirkaG
Nov 06 2015 08:10
@abhisekp the module specifically asks me to create a class not id or div. Does that make a difference?
FYI, sorry if my question seems stupid. It's my first day
Abhisek Pattnaik
@abhisekp
Nov 06 2015 08:11
@MirkaG But in css, you've to specify what you're targeting. So you must specify the . for targeting a class using .some-class or # to target an id using #unique-id
MirkaG
@MirkaG
Nov 06 2015 08:11
@abhisekp got it. I'm going to try that now
Adole Samuel
@int-elligentSam
Nov 06 2015 08:11
@abhisekp please what's the advantage of a class over an Id?
Abhisek Pattnaik
@abhisekp
Nov 06 2015 08:12
writing...
@MirkaG classes can be implemented more than once. Hence, you can write style once and target many elements by implementing the class on them. E.g.
<div class="some-class"></div>
<p class="some-class"></p>
<span class="some-class"></span>
Lance
@texas2010
Nov 06 2015 08:14
yep. cant use id more than two in same html. id must be unique lol
Vanessa Vengco
@vanven
Nov 06 2015 08:14
@samconnor it's not that it's better but used differently. you can apply a class to more than one element as @abhisekp explained, but an id can only be used on one unique element.
MirkaG
@MirkaG
Nov 06 2015 08:14
@abhisekp where it says "some class", thats where I would write "pink- Text"
Abhisek Pattnaik
@abhisekp
Nov 06 2015 08:14
@samconnor @MirkaG But an id must be unique in an HTML file. Hence, you should only implement one unique id. E.g.
<div id="unique-id-1"></div>
<div id="unique-id-2"></div>
@MirkaG not with a space! Write pink-text.
Adole Samuel
@int-elligentSam
Nov 06 2015 08:16
@vanven thanks
CamperBot
@camperbot
Nov 06 2015 08:16
samconnor sends brownie points to @vanven :sparkles: :thumbsup: :sparkles:
:star: 139 | @vanven | http://www.freecodecamp.com/vanven
MirkaG
@MirkaG
Nov 06 2015 08:16
@abhisekp awesome sauce. Thanks
CamperBot
@camperbot
Nov 06 2015 08:16
mirkag sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:warning: mirkag already gave abhisekp points
Abhisek Pattnaik
@abhisekp
Nov 06 2015 08:17
@MirkaG @samconnor It's not that it will show any errors and all. But HTML is used for semantic writing. Hence, one must comply with specification i.e. when you write a paragraph, you mark it up with a p tag.
Adole Samuel
@int-elligentSam
Nov 06 2015 08:17
@abhisekp OK now I understand
Abhisek Pattnaik
@abhisekp
Nov 06 2015 08:17
@MirkaG @samconnor but you can check for HTML validation using validation tools :D
Ankit Panwar
@coderNoob
Nov 06 2015 08:20
@abhisekp Tools like?
Abhisek Pattnaik
@abhisekp
Nov 06 2015 08:20
Ankit Panwar
@coderNoob
Nov 06 2015 08:33
This message was deleted
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 08:42
I'm trying to include another sound file for my Simon game...and I can't find a site that will host it for free...and give me a direct link. Does anyone know of such a site?
Abhisek Pattnaik
@abhisekp
Nov 06 2015 08:43
@TheHighPriestess what about http://archive.org Won't they host your sound file?
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 08:44
I dont think so. I need the direct link with the .mp3 at the end
I want to include a "fail" sound for my game
h4r1m4u
@h4r1m4u
Nov 06 2015 08:45
@TheHighPriestess do you have the sound file as such and are looking for just the hosting?
Rafal Rudzinski
@rrudzinski
Nov 06 2015 08:47
function truncate(str, num) {

    if (str.length > num) {
        return str.slice(0,(num-3)) + "...";
    } else {
        return str.slice(0,num);
    }
}

truncate("A-",1);
can anyone point me in the right direction… my code works for all cases except for this one. Should return “A…"
h4r1m4u
@h4r1m4u
Nov 06 2015 08:48
@rrudzinski you'll need to add another if branch for strings that are shorter than 3 characters as those need to be handled differently
Rafal Rudzinski
@rrudzinski
Nov 06 2015 08:48
@h4r1m4u ahh got it. thank you!
CamperBot
@camperbot
Nov 06 2015 08:48
rrudzinski sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 549 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 06 2015 08:49
no problem
Abhisek Pattnaik
@abhisekp
Nov 06 2015 08:49
This message was deleted
Rafal Rudzinski
@rrudzinski
Nov 06 2015 08:50
i guess what is confuding me is, if the excercise referring to length of the actual string or the max length. It doesnt seem to be clear from what i can tell
lswq207
@lswq207
Nov 06 2015 08:53
lorem ipsum text
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 08:55
@h4r1m4u I have the found file...I just need somewhere to put it
I'm almost done!
h4r1m4u
@h4r1m4u
Nov 06 2015 08:56
@rrudzinski it's referring to the length of the string that you get on the input, for example:
truncate('sample', 4); // should return 's...' (max length 4, including ...)
truncate('sam', 2); // should return 'sa...' (max length is 2, but excluding ...)
@TheHighPriestess do you have dropbox?
Rafal Rudzinski
@rrudzinski
Nov 06 2015 08:57
got it, i added another if branch in the begining to test for string < 3, i was just misreading the instructions i guess
h4r1m4u
@h4r1m4u
Nov 06 2015 08:57
@rrudzinski nice work :thumbsup:
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 08:57
@h4r1m4u will dropbox work?
h4r1m4u
@h4r1m4u
Nov 06 2015 08:57
yup
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 08:59
ok...i will try it. Thank you @h4r1m4u
CamperBot
@camperbot
Nov 06 2015 08:59
thehighpriestess sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 550 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 06 2015 08:59
you bet
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 09:05

Ok...I have a quick question. I want the "fail" sound to play...if a wrong tile is selected. Therefore, I have this in my code. The wrongPlay() function is called..which has the link to the mp3 and then the proper sequence is played back. My question is...does "animate(sequence)" wait until wrongPlay() is done playing the mp3?

wrongPlay();
animate(sequence);

or do I need to put some sort of timer here?
h4r1m4u
@h4r1m4u
Nov 06 2015 09:06
animate() will get executed right after wrongPlay(). if wrongPlay() takes a while to finish, the two function will overlap in terms of execution
you'll want to delay animate() by the length of the wrongPlay() function
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 09:07
ok...that makes sense
h4r1m4u
@h4r1m4u
Nov 06 2015 09:07
so yeah, setTimer is your friend
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 09:07
one other question...when I go directly to the link provided by dropbox...it just takes me back to dropbox
oh wait...i see another link...a huge one
that has the sound
my mistake. I rarely use dropbox
Ok..it's working. Now I just to to delay animate() a bit
h4r1m4u
@h4r1m4u
Nov 06 2015 09:10
sweet
amrish036
@amrish036
Nov 06 2015 09:37
hi guys!!
can anyone help me with the filter() in the wayponint?
h4r1m4u
@h4r1m4u
Nov 06 2015 09:47
@amrish036 what's the issue?
x34passenger
@x34passenger
Nov 06 2015 09:51
I am not sure how to make my numbers for break length and session length to appear on the webpage, currently they are not: http://codepen.io/x34passenger/pen/ojPmeW/
h4r1m4u
@h4r1m4u
Nov 06 2015 09:53
@x34passenger you can add the whiteFont class to the spans you wrap them in: <span class="whiteFont">4</span>
the numbers are there, you just can't see them because of the font color
amrish036
@amrish036
Nov 06 2015 09:53
@h4r1m4u hi there. I’m doing the waypoint with the filter method. and the output that i get are values greater than 5. But i have an error saying “You should have removed all the values from the array that are greater than 5.” And i’m not sure what have i done wrong. thanks in advance
CamperBot
@camperbot
Nov 06 2015 09:53
:star: 552 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
amrish036 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
Ankit Panwar
@coderNoob
Nov 06 2015 09:54
@x34passenger And I would suggest you put them there using jQuery instead since their value would be changing.
h4r1m4u
@h4r1m4u
Nov 06 2015 09:54
he's just setting up the HTML / CSS structure at the moment. but you're right, he'll need to do it at some point
x34passenger
@x34passenger
Nov 06 2015 09:54
@coderNoob I am just working on the html and css first, I will work on the jquery after I get the formatting and styling correct
h4r1m4u
@h4r1m4u
Nov 06 2015 09:55
@amrish036 could you post your code?
x34passenger
@x34passenger
Nov 06 2015 09:55
@h4r1m4u I tried using whiteFont, it is not working, it is not displaying
h4r1m4u
@h4r1m4u
Nov 06 2015 09:55
it works for me
how did you use it?
x34passenger
@x34passenger
Nov 06 2015 09:55
@h4r1m4u correction, it is working
amrish036
@amrish036
Nov 06 2015 09:55
Screen Shot 2015-11-06 at 8.55.00 PM.png
@h4r1m4u
x34passenger
@x34passenger
Nov 06 2015 09:56
thanks @h4r1m4u
CamperBot
@camperbot
Nov 06 2015 09:56
x34passenger sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 553 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
amrish036
@amrish036
Nov 06 2015 09:56
Screen Shot 2015-11-06 at 8.55.23 PM.png
h4r1m4u
@h4r1m4u
Nov 06 2015 09:56
@x34passenger you're welcome
amrish036
@amrish036
Nov 06 2015 09:56
@h4r1m4u
h4r1m4u
@h4r1m4u
Nov 06 2015 09:57
@amrish036 you're supposed to remove all the elements greater than 5. the filter returns the elements from the array for which the callback function evaluates to true
for which elements will this evaluate to true? return val > 5
amrish036
@amrish036
Nov 06 2015 09:59
@h4r1m4u isnt that what i’m doing? removing values greater than 5? or did i get it totally wrong?
h4r1m4u
@h4r1m4u
Nov 06 2015 09:59
re-read what i said above
this being the key: the filter returns the elements from the array for which the callback function evaluates to true
amrish036
@amrish036
Nov 06 2015 10:00
ahh sorry @h4r1m4u
h4r1m4u
@h4r1m4u
Nov 06 2015 10:01
you got it?
amrish036
@amrish036
Nov 06 2015 10:01
@h4r1m4u didnt really get it :(
h4r1m4u
@h4r1m4u
Nov 06 2015 10:02
ok, let me rephrase it. the filter function returns an array. this array will include all the elements from the array you run the filter on for which the callback function evaluates to true
let me give you an example
amrish036
@amrish036
Nov 06 2015 10:03
@h4r1m4u yes please
Ankit Panwar
@coderNoob
Nov 06 2015 10:03
How can I call a function which is inside another function on a button click?
x34passenger
@x34passenger
Nov 06 2015 10:03
how can I bring the break length buttons and the session length buttons closer together like in the original pomodoro clock example, right now they are too far apart?
h4r1m4u
@h4r1m4u
Nov 06 2015 10:05
var myArr = ['aaa', 'b', 'dddd', 'eeeeeeeee', 'gg'];
var filterOutputArr = myArr.filter(function(element) {
  return element.length < 3; 
});
@amrish036 can you tell me what the filterOutputArr will look like after the code executes?
which elements from myArr will make it into filterOutputArr?
amrish036
@amrish036
Nov 06 2015 10:06
@h4r1m4u hi i think its gonna look like : [‘b’,’gg’];
h4r1m4u
@h4r1m4u
Nov 06 2015 10:06
@amrish036 that's right!
amrish036
@amrish036
Nov 06 2015 10:07
and in mine ain’t i doing the same?
like retrun val>5;
@h4r1m4u
h4r1m4u
@h4r1m4u
Nov 06 2015 10:07
what values will val > 5 return?
amrish036
@amrish036
Nov 06 2015 10:07
6,7,8,9,10
h4r1m4u
@h4r1m4u
Nov 06 2015 10:08
if your array is [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
correct
is that what you're supposed to return ?
in other words, is that the assignment?
amrish036
@amrish036
Nov 06 2015 10:08
yup thats what im supposed to do according to the question @h4r1m4u
h4r1m4u
@h4r1m4u
Nov 06 2015 10:09
really? are you sure?
amrish036
@amrish036
Nov 06 2015 10:09
Screen Shot 2015-11-06 at 8.55.23 PM.png
h4r1m4u
@h4r1m4u
Nov 06 2015 10:09
Use filter to REMOVE all elements from array that are GREATER THAN 5.
is that what your filter does?
x34passenger
@x34passenger
Nov 06 2015 10:11
how can I bring the break length buttons and the session length buttons closer together like in the original pomodoro clock example, right now they are too far apart?
amrish036
@amrish036
Nov 06 2015 10:11
i think so @h4r1m4u . am i doing it wrong?
h4r1m4u
@h4r1m4u
Nov 06 2015 10:12
you just told me that return val > 5 will give you this array: [6,7,8,9,10]
amrish036
@amrish036
Nov 06 2015 10:12
yes i did
h4r1m4u
@h4r1m4u
Nov 06 2015 10:13
are those elements greater or lower than 5?
or let me ask another way, did you remove elements greater than 5 or lower than 5?
amrish036
@amrish036
Nov 06 2015 10:15
@h4r1m4u hey i’m really sorry man. i got it
h4r1m4u
@h4r1m4u
Nov 06 2015 10:15
:D
amrish036
@amrish036
Nov 06 2015 10:15
val < 6
h4r1m4u
@h4r1m4u
Nov 06 2015 10:15
are you facepalming now or reveling in the 'aha' moment? :D
amrish036
@amrish036
Nov 06 2015 10:16
haha brainfart @h4r1m4u
h4r1m4u
@h4r1m4u
Nov 06 2015 10:16
:D
amrish036
@amrish036
Nov 06 2015 10:16
thank a lot for the help
CamperBot
@camperbot
Nov 06 2015 10:16
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Nov 06 2015 10:16
you're welcome
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 10:16
Can someone tell me why my "fail" sound isn't playing? It's the wrongPlay() and checkLose() functions.
amrish036
@amrish036
Nov 06 2015 10:17
@h4r1m4u u’ve been awesome :)
h4r1m4u
@h4r1m4u
Nov 06 2015 10:17
@amrish036 my pleasure
@TheHighPriestess looking at the code, it seems you're just inserting the file into the DOM?
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 10:21
@h4r1m4u yeah
seems like it should work
since this is how i did my other sound function
x34passenger
@x34passenger
Nov 06 2015 10:23
how can I bring the break length buttons and the session length buttons closer together like in the original pomodoro clock example, right now they are too far apart: http://codepen.io/x34passenger/pen/ojPmeW/?editors=110
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 10:23
but maybe my url isn't correct
h4r1m4u
@h4r1m4u
Nov 06 2015 10:23

@TheHighPriestess alright, first of all, you don't need to do that. you don't need to insert it into the DOM. doing this in your JS should be enough:

var failSound = new Audio('https://urltomysound.com/sound.mp3');
failSound.play();

second, the file is not loading properly from dropbox. it responds with 404

Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 10:24
oh
h4r1m4u
@h4r1m4u
Nov 06 2015 10:25
@x34passenger you'll need to experiment with your <div>s and set proper alignment on them
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 10:25
that's the link dropbox provided me with
x34passenger
@x34passenger
Nov 06 2015 10:25
@h4r1m4u I am doing that now but not sure how to set proper alignment
h4r1m4u
@h4r1m4u
Nov 06 2015 10:25
@x34passenger would suggest that you read up on the bootstrap grid classes if that's what you're planning to use
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 10:25
perhaps it's not possible to use a link from dropbox?
x34passenger
@x34passenger
Nov 06 2015 10:26
@h4r1m4u I am using the bootstrap grid classes but I don't know how to bring them closer together
Roy Bakker
@RoyBkker
Nov 06 2015 10:26
Hi everyone,
just started FCC and I really like it!
I am a little bit confused at the Waypoint: Give your JavaScript Slot Machine some Stylish Images.
The code runs, but when I have three of the same numbers / images, the text in the footer says : Not a win.
Anyone else who ran in to this?
h4r1m4u
@h4r1m4u
Nov 06 2015 10:26
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 10:28
I don't think it's possible to have it play though
the link that plays the file...is the 404
it only works when you click from dropbox
h4r1m4u
@h4r1m4u
Nov 06 2015 10:29
@x34passenger then you're not using the grid properly. it's difficult for me to give you the specifics as i don't know how you're planning to align the buttons on smaller screens, but this might be a good starting point:
        <div class='col-md-2 col-md-offset-4'>
          <p class="whiteFont">BREAK LENGTH</p>
          <button>-</button>
          <span class='whiteFont'>4</span>
          <button>+</button>
        </div>
        <div class='col-md-2'>
          <p class="whiteFont">SESSION LENGTH</p>
          <button>-</button>
          <span class='whiteFont'>25</span>
          <button>+</button>
        </div>
note the offset class. check the bootstrap docs for what it does
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 10:29
the link changes each time
h4r1m4u
@h4r1m4u
Nov 06 2015 10:29
@TheHighPriestess let me check that
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 10:30
i seem to remember having this same problem before when i wanted to link to a sound file. i can't remember where I hosted the file.
I think I used this:
h4r1m4u
@h4r1m4u
Nov 06 2015 10:32
@TheHighPriestess it works for me
@TheHighPriestess this is a sound i just added to my dropbox: https://www.dropbox.com/s/7s3vpvxqnehkocm/fail.mp3
and then got the share link for
if you stick that as the sound URL in your codepen for the fail sound, it'll work
(it's one of the button sounds, so don't get confused)
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 10:33
but it doesn't play
h4r1m4u
@h4r1m4u
Nov 06 2015 10:33
it does
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 10:33
it's asking me to download it
amrish036
@amrish036
Nov 06 2015 10:33
@RoyBkker hi .. said the same to me as well
h4r1m4u
@h4r1m4u
Nov 06 2015 10:33
@TheHighPriestess var soundurl = "https://www.dropbox.com/s/7s3vpvxqnehkocm/fail.mp3";
replace that in your codepen
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 10:34
ok..hold on
h4r1m4u
@h4r1m4u
Nov 06 2015 10:34
then play the game and fail
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 10:34
it doesn't work
and when I go to that link...it doesn't play. It asks me to download the file
and that kiwi6.com site is asking me to upgrade in order to upload the file
ggrrr
ok well..it's not absolutely necessary to have the fail sound
Roy Bakker
@RoyBkker
Nov 06 2015 10:36
@amrish036 Well, i just changed the text into " we have a winner', but don't know if this is the right solution.
amrish036
@amrish036
Nov 06 2015 10:37
@RoyBkker i did the same as well, and i think “not a win “ was a typo.
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 10:38
i wonder if I upgraded to Codepen pro if I could host it there.
just curious...let me see
yeah...Pro has asset hosting
Kanchan Chawla
@kanchanchawla
Nov 06 2015 10:54
hey all,
please have a look at waypoint 142.
its urgent
Michael Bomholt
@bomholtm
Nov 06 2015 10:55
waypoint 142?
Kanchan Chawla
@kanchanchawla
Nov 06 2015 10:56
in freecode camp
Michael Bomholt
@bomholtm
Nov 06 2015 10:56
there is no such thing
Kanchan Chawla
@kanchanchawla
Nov 06 2015 10:57
ok ok..let me elaborate
Waypoint: Store Multiple Values in one Variable using JavaScript Arrays

var array = ["John", 23];

// Only change code below this line.

var myArray = ["abc","123"];

// Only change code above this line.

(function(z){return z;})(myArray);

this s my code
question was:Now let's create a new array called myArray that contains both a string and a number (in that order).
hav I done something wrong?
Michael Bomholt
@bomholtm
Nov 06 2015 10:58
just post the link =)
oh...done
actually the inverted commas should not be placed with the number
Michael Bomholt
@bomholtm
Nov 06 2015 11:00
haha okay great =)
Kanchan Chawla
@kanchanchawla
Nov 06 2015 11:00
:)
anyways thanks
CamperBot
@camperbot
Nov 06 2015 11:01
if you want to thank someone, put an @ before their name!
Michael Bomholt
@bomholtm
Nov 06 2015 11:01
np :P
Kanchan Chawla
@kanchanchawla
Nov 06 2015 11:01
But here the person knows to whom I m grateful
no need to add@
isn't it?
Michael Bomholt
@bomholtm
Nov 06 2015 11:02
if you add an @
the person gets brownie points on fcc
thats why camperbot tells you to :P
Kanchan Chawla
@kanchanchawla
Nov 06 2015 11:04
ohh..okk
then here u go
Elliott McNary
@bighitbiker3
Nov 06 2015 11:04
Does anyone have trouble getting their stuff to look good in the codepen viewer?
Kanchan Chawla
@kanchanchawla
Nov 06 2015 11:04
@bomholt
Elliott McNary
@bighitbiker3
Nov 06 2015 11:04
if I got to full screen mode it looks great...in the editor it looks like shit though
Michael Bomholt
@bomholtm
Nov 06 2015 11:05
@bighitbiker3 like how?
Michael Bomholt
@bomholtm
Nov 06 2015 11:05
thanks @kanchanchawla
CamperBot
@camperbot
Nov 06 2015 11:05
bomholt sends brownie points to @kanchanchawla :sparkles: :thumbsup: :sparkles:
kelvintantono
@kelvintantono
Nov 06 2015 11:05
hi friends
CamperBot
@camperbot
Nov 06 2015 11:05
:star: 145 | @kanchanchawla | http://www.freecodecamp.com/kanchanchawla
Michael Bomholt
@bomholtm
Nov 06 2015 11:06
like this but nvm :P
kelvintantono
@kelvintantono
Nov 06 2015 11:06
I am at Basic Java Script Waypoint 42 and having stuck. need some help :)
can someone help me how to "Store the three random numbers in slotOne, slotTwo and slotThree." ?
Michael Bomholt
@bomholtm
Nov 06 2015 11:07
@bighitbiker3 ah i see the section are to short in editor view right?
Elliott McNary
@bighitbiker3
Nov 06 2015 11:07
yea...i think it's cause of the full-height class
which looks great in browser, but in the editor I can't get it to look right...not sure if it should
Michael Bomholt
@bomholtm
Nov 06 2015 11:08
@bighitbiker3 i will look into it. but not sure i can help.. just a sec
@kelvintantono look at the example code
it uses slotOne and [0] right?
Elliott McNary
@bighitbiker3
Nov 06 2015 11:09
@bomholt sweet thanks
CamperBot
@camperbot
Nov 06 2015 11:09
bighitbiker3 sends brownie points to @bomholt :sparkles: :thumbsup: :sparkles:
:star: 425 | @bomholt | http://www.freecodecamp.com/bomholt
Michael Bomholt
@bomholtm
Nov 06 2015 11:10
@bighitbiker3 yea i think height: 100vh; is causing the problem but not sure
actually i am xD
in editor view the sections are the same size the editor is
Bereket Yeleussinov
@Bektaz
Nov 06 2015 11:13
Thanks @SaintPeter ! yep we got the link
CamperBot
@camperbot
Nov 06 2015 11:13
bektaz sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1422 | @saintpeter | http://www.freecodecamp.com/saintpeter
Elliott McNary
@bighitbiker3
Nov 06 2015 11:32
@bomholt yea you're right...I wonder if there's a fix for that or if i'm just SOL
it looks good outside of codepen which I guess is what matters
just not sure if there's a better way to do it you know
Michael Bomholt
@bomholtm
Nov 06 2015 11:33
there should be other ways because vh isnt available for all browsers as well if i remember correctly
Albert
@NomadRiding
Nov 06 2015 11:35
hello world!
CamperBot
@camperbot
Nov 06 2015 11:35

welcome to FreeCodeCamp @NomadRiding!

Krishna Pradhan
@kpaccess
Nov 06 2015 11:36
hi @bomholt you can checkout http://caniuse.com/#search=vh
Kanchan Chawla
@kanchanchawla
Nov 06 2015 11:37
thanks @camperbot and @bomholt
CamperBot
@camperbot
Nov 06 2015 11:37
kanchanchawla sends brownie points to @camperbot and @bomholt :sparkles: :thumbsup: :sparkles:
:star: 427 | @bomholt | http://www.freecodecamp.com/bomholt
:star: 500 | @camperbot | http://www.freecodecamp.com/camperbot
jpjenkins
@jpjenkins
Nov 06 2015 11:48
function destroyer(arr) {
  // Remove all the values
  var newArr = arr[0].filter(function (val){
           if(val !== arr[1] && arr[2]){
             return val;
           }               
                             });

  return newArr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3)
I'm really struggling to get my head around why I can't do arr[0].filter ... 'arr[0].filter()' is not a function
why not? :s someone helped me the other day but I'm still stuck, I've forgotten what he said about joining into a string or something first
this bonfire is consuming far too much of my time, I'm missing some knowledge here. I completed all the others in the same amount of time I've spent on this.
jpjenkins
@jpjenkins
Nov 06 2015 11:55
I just did this:
var newArr = arr.join('').split('');
from the array given above it put this into newArr:
["1","2","3","1","2","3"]
why did it only put arr[0] into newArr when I joined and split it? This gives me what I need but I don't know why it didn't put arr1 and arr[2] in there
jpjenkins
@jpjenkins
Nov 06 2015 12:03
function destroyer(arr) {
  // Remove all the values
  var newArr = arr.join('').split(''); // put arr[0] into newArr
  newArr = newArr.map(function(val){ // search through newArr
    if(val !== arr[1] || arr[2]){  // if the value doesn't equal 2 or 3
      return val;  // return it into newArr
    }

  }); 

  return newArr; // show the newArr
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
I'd appreciate if someone could have a look at the above code, to me the logic is correct, I don't know where I'm going wrong :(
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 12:13
I'm using this to reload the page...and I see that it isn't working. Is this not correct?
$('#startover').click(function(){
      window.reload();
});
kelvintantono
@kelvintantono
Nov 06 2015 12:14
@bombolt nope. it dont Sir.
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 12:15
location.reload() doesn't work either
Michael Bomholt
@bomholtm
Nov 06 2015 12:15
@kelvintantono can you post the link?
Nathan
@terakilobyte
Nov 06 2015 12:15
@jpjenkins because 2 and 3 are positional parameters that you need to access through the arguments object
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 12:15
is it because i'm using codepen?
Nathan
@terakilobyte
Nov 06 2015 12:16
@jpjenkins since they aren't declared in the function definition you have no local name with which to get at them
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 12:16
ok..i fixed it: location.reload(true)
function checkLose() {
      if (copy.length === 0 && active) {
        newRound();
      } else if (!active) {
        $("h3").html("oops!");
        animate(sequence);
      } else {
        activateSimonBoard();
      }
    }
anyone know how to get that "oops" to disappear as soon as the animate function is called?
i tried .empty...but that made it so that the oops didn't pop up at all
The idea is that the player gets the "oops" message...and then it disappears as soon as the animate sequence plays
jpjenkins
@jpjenkins
Nov 06 2015 12:20
@terakilobyte I suppose that's what I'm having trouble understanding, how do I get the nested array out and then use the values of arr[1] and [2]?
Ah, I'll keep thinking, don't want to waste anyone's time here
Nathan
@terakilobyte
Nov 06 2015 12:24
@jpjenkins you aren't wasting anyone's time
jpjenkins
@jpjenkins
Nov 06 2015 12:25
I just realised that I was treating the whole thing as an array within an array... but it's not
it's an array with 2 separate integers... all this time...
New understanding, fresh eyes. Thanks anyway @terakilobyte , I'll be back once I'm more informed :)
CamperBot
@camperbot
Nov 06 2015 12:26
jpjenkins sends brownie points to @terakilobyte :sparkles: :thumbsup: :sparkles:
:star: 227 | @terakilobyte | http://www.freecodecamp.com/terakilobyte
Nathan
@terakilobyte
Nov 06 2015 12:28
@jpjenkins try this in a console or repl,
function argumentsInterpreter(args) {
  console.log(arguments[0]);
  console.log(arguments[1]);
  console.log(arguments[2]);
}
then call it like argumentsInterpreter(['not', 'a', 'waste'], 'of', 'time');
jpjenkins
@jpjenkins
Nov 06 2015 12:35
:)
but when I do...
newArg = arguments[0];
why does it not put the whole array in?
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 12:36
i did it!
Nathan
@terakilobyte
Nov 06 2015 12:38
@jpjenkins read up about the arguments object
NELLISSERY
@NELLISSERY
Nov 06 2015 12:47
How to do responsively stye Radio Buttons
<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>  
Where I went wrong, if any? Please help...
jpjenkins
@jpjenkins
Nov 06 2015 12:50
@terakilobyte it's starting to make a lot more sense now...
thanks again @terakilobyte
CamperBot
@camperbot
Nov 06 2015 12:50
jpjenkins sends brownie points to @terakilobyte :sparkles: :thumbsup: :sparkles:
:warning: jpjenkins already gave terakilobyte points
Nathan
@terakilobyte
Nov 06 2015 12:50
@jpjenkins np, happy coding!
jpjenkins
@jpjenkins
Nov 06 2015 12:51
I'm thinking it might be worth filing an issue with this bonfire on github. It should really have (args) at the top, not (arr). Because it's not arr, it just makes it confusing. Would I be correct in saying this?
@NELLISSERY looks okay from what I see, what waypoint was this?
h4r1m4u
@h4r1m4u
Nov 06 2015 13:11
@jpjenkins it's not really a bug or an issue. the first argument to the function is an array. the other arguments are optional. hence arras the name of the first argument. in some other languages you have to specifically declare that you expect the function to have optional arguments when you define it, but javascript is pretty liberate in this sense and you don't need to specify it
jpjenkins
@jpjenkins
Nov 06 2015 13:11
so calling arr in this instance returns arguments[0]?
h4r1m4u
@h4r1m4u
Nov 06 2015 13:12
i'm not sure i understand the question
could you rephrase it?
jpjenkins
@jpjenkins
Nov 06 2015 13:13
When you mentioned that arr is the name of the first argument... would I be correct in saying that returning arr would infact just be arguments[0]?
h4r1m4u
@h4r1m4u
Nov 06 2015 13:14
yeah. the value of arr is the same as the value of arguments[0]
arr gets stored in the arguments object
but if you only want to work with arr in the function, you can refer to it as arr. it's the optional arguments (2nd, 3rd, etc.) that you don't have other way to access than via the arguments object (arguments1, arguments[2], etc.)
jpjenkins
@jpjenkins
Nov 06 2015 13:15
so is 'arr' special in javascript? It seems quite arbitrary to call something seemingly undefined
h4r1m4u
@h4r1m4u
Nov 06 2015 13:16
we expect the first argument to be array. hence the name 'arr' (to suggest to people reading our code that the first argument should be array).
but the name is arbitrary, you could call it dog and it would still work the same
jpjenkins
@jpjenkins
Nov 06 2015 13:18
So the callback in the function always points to the first 'set' of values?
and this
var newArr = Array.prototype.slice.call(arguments[0]);
would make newArr essentially just arr, therefore not needed
h4r1m4u
@h4r1m4u
Nov 06 2015 13:19
the callback in the function?
and yes, you're right regarding newArr
jpjenkins
@jpjenkins
Nov 06 2015 13:19
is that what you call it ?
`function destroyer(arr) <---
h4r1m4u
@h4r1m4u
Nov 06 2015 13:19
arr? no, you refer to it as an argument
jpjenkins
@jpjenkins
Nov 06 2015 13:20
but that value (arr) in the function, always points to the first in the set of arguments? But this time it just so happens to be an array?
Sorry if I'm being a dunce here :)
h4r1m4u
@h4r1m4u
Nov 06 2015 13:22
the argument name, in this case arr (but it might as well be dog, a, or myFirstArgument1), both gives a hint to the user that the function expects an argument when called and gives the developer a convenient way to refer to it within the function itself. it's just a variable that you're passing to the function
function test(dog, cat) {
  // do something with dog
 // do something with cat
}
jpjenkins
@jpjenkins
Nov 06 2015 13:23
ah, so it's presented as a list? So because there's only one, it points to the first one in arguments?
if it was function destroyer(arr, dog)
it would be
arr = arguments[0]
dog = arguments1
?
h4r1m4u
@h4r1m4u
Nov 06 2015 13:24
that's right
jpjenkins
@jpjenkins
Nov 06 2015 13:24
!
:)
Thank you, confusion dissipated
CamperBot
@camperbot
Nov 06 2015 13:24
if you want to thank someone, put an @ before their name!
jpjenkins
@jpjenkins
Nov 06 2015 13:24
Thank you @h4r1m4u , to the rescue again
CamperBot
@camperbot
Nov 06 2015 13:24
jpjenkins sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 554 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 06 2015 13:25
and if, after defining the function as you did above, you called it like this:
destroyer(myVar, 'Pluto', 'Emily')
arguments[0] would myVar
arguments1 would be 'Pluto'
arguments[2] would be 'Emily'
jpjenkins
@jpjenkins
Nov 06 2015 13:26
okay, that would save some typing time
h4r1m4u
@h4r1m4u
Nov 06 2015 13:27
hence the argument names (arr, dog) when you define the function
it gives you a quick way of accessing the arguments passed to the function
instead of always utilizing the arguments object
jpjenkins
@jpjenkins
Nov 06 2015 13:28
but you don't want to pass them in quotes though do you? Otherwise it would literally be 'Pluto' not Pluto
h4r1m4u
@h4r1m4u
Nov 06 2015 13:28
basically the arguments object becomes useful only if the function can take unlimited number of arguments (you don't know how many in advance)
above I was calling the function, not defining it
so i was passing actual values to it
jpjenkins
@jpjenkins
Nov 06 2015 13:29
ah right, of course
h4r1m4u
@h4r1m4u
Nov 06 2015 13:32

and just to clarify, take this jQuery snippet as an example:

$( "#target" ).click(function() {
  alert( "Handler for .click() called." );
});

it's a click handler. when you click #target HTML element, it'll execute the function inside the handler and, in this case, alert "Handler for .click() called." this bit is what you would refer to as callback function:

function() {
  alert( "Handler for .click() called." );
}
jpjenkins
@jpjenkins
Nov 06 2015 13:36
the callback is the actual result returned?
if that's the right terminology there
h4r1m4u
@h4r1m4u
Nov 06 2015 13:39
no, 'callback' is the word that you'd use for the function (otherwise a piece of executable code) that you're passing as an argument to the parent function
so callback is an argument, but argument is not necessarily a callback. if that makes sense
jpjenkins
@jpjenkins
Nov 06 2015 13:39
ah okay, so the parent function being click
it's callback is the function that produces the alert
h4r1m4u
@h4r1m4u
Nov 06 2015 13:39
that's right!
jpjenkins
@jpjenkins
Nov 06 2015 13:39
:)
the argument is what's between the brackets
h4r1m4u
@h4r1m4u
Nov 06 2015 13:40
yeah, this whole thing:
function() {
  alert( "Handler for .click() called." );
}
jpjenkins
@jpjenkins
Nov 06 2015 13:40
the limits of which are defined by the function
Taher Giyori
@taherg786
Nov 06 2015 13:40
"Only use jQuery to add these classes to the element."
What does this mean?
I'm getting an error
jpjenkins
@jpjenkins
Nov 06 2015 13:41
You're a star @h4r1m4u, now if I could only get all of these things to pass...
h4r1m4u
@h4r1m4u
Nov 06 2015 13:41
:) my pleasure. keep chipping away at it and you'll make it happen
solving the puzzles is the fun part
h4r1m4u
@h4r1m4u
Nov 06 2015 13:42
what's your code like? @taherg786
Taher Giyori
@taherg786
Nov 06 2015 13:42
Should I copy the entire code?
h4r1m4u
@h4r1m4u
Nov 06 2015 13:43
the <script> part should be enough
Taher Giyori
@taherg786
Nov 06 2015 13:43
<script>
$(document).ready(function() {
$(button).addClass("animated bounce")
});
</script>
I get it
The quotes in button, maybe??
h4r1m4u
@h4r1m4u
Nov 06 2015 13:43
yep :)
Taher Giyori
@taherg786
Nov 06 2015 13:44
No, not yet
Still...
h4r1m4u
@h4r1m4u
Nov 06 2015 13:44
how did you update the code?
Taher Giyori
@taherg786
Nov 06 2015 13:44
Update?.. I just edited the code and run the test
h4r1m4u
@h4r1m4u
Nov 06 2015 13:45
i mean, what does it look like now?
Taher Giyori
@taherg786
Nov 06 2015 13:45
<script>
$(document).ready(function() {
$("button").addClass("animated bounce")
});
</script>
h4r1m4u
@h4r1m4u
Nov 06 2015 13:45
ok, that looks correct. just don't forget to add ; after the addClass function:
<script>
  $(document).ready(function() {
    $("button").addClass("animated bounce");
  });
</script>
if that doesn't work, try to reset the waypoint or reload the page, then put in the same code
sometimes the waypoints get stuck
Taher Giyori
@taherg786
Nov 06 2015 13:46
OK , i'll try that now
h4r1m4u
@h4r1m4u
Nov 06 2015 13:46
but the code is essentially correct
Taher Giyori
@taherg786
Nov 06 2015 13:47
I reloaded it
same thing
don't know why?
h4r1m4u
@h4r1m4u
Nov 06 2015 13:48
can you paste the URL from your browser here?
Taher Giyori
@taherg786
Nov 06 2015 13:50
http://www.freecodecamp.com/challenges/waypoint-target-html-elements-with-selectors-using-jquery#?solution=fccss%0A%20%20%24(document).ready(function()%20%7B%0A%20%20%20%20%24(%22button%22).addClass(%22animated%20bounce%22)%3B%0A%20%20%7D)%3B%0Afcces%0A%0A%3C!--%20Only%20change%20code%20above%20this%20line.%20--%3E%0A%0A%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%3Ch3%20class%3D%22text-primary%20text-center%22%3EjQuery%20Playground%3C%2Fh3%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23left-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22left-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%20animated%20bounce%22%20id%3D%22target1%22%3E%23target1%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%20animated%20bounce%22%20id%3D%22target2%22%3E%23target2%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%20animated%20bounce%22%20id%3D%22target3%22%3E%23target3%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23right-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22right-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%20animated%20bounce%22%20id%3D%22target4%22%3E%23target4%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%20animated%20bounce%22%20id%3D%22target5%22%3E%23target5%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%20animated%20bounce%22%20id%3D%22target6%22%3E%23target6%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A
h4r1m4u
@h4r1m4u
Nov 06 2015 13:52
@taherg786 oh, you manually added the classes to the buttons too:
<button class="btn btn-default target animated bounce" id="target1">#target1</button>
you only should the jQuery function to add it
Taher Giyori
@taherg786
Nov 06 2015 13:53
Yes, I did! I thought we had to do it.
I'll remove it now. Thanks for the help btw.
CamperBot
@camperbot
Nov 06 2015 13:53
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Nov 06 2015 13:54
you're welcome
Taher Giyori
@taherg786
Nov 06 2015 13:55
@h4r1m4u Thank you! It worked!
@camperbot Sorry , new here
CamperBot
@camperbot
Nov 06 2015 13:55
taherg786 sends brownie points to @h4r1m4u and @camperbot :sparkles: :thumbsup: :sparkles:
:star: 502 | @camperbot | http://www.freecodecamp.com/camperbot
:star: 555 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 06 2015 13:56
@taherg786 great!
jpjenkins
@jpjenkins
Nov 06 2015 14:01
var newArr = [];
  for(i=0; i <= arguments.length; i++){
    newArr = arguments[i];
  }
what am I missing here?
i = 1 too, missing out the array at the beginning
Matt Leonard
@matty22
Nov 06 2015 14:05
for (var i = 0; i <= arguments.length; i++) {}
Just need to declare your counter variable
jpjenkins
@jpjenkins
Nov 06 2015 14:06
I think that's implied in the for loop isn't it, really just good practice to do so
Matt Leonard
@matty22
Nov 06 2015 14:06
No, it's required as far as I know.
jpjenkins
@jpjenkins
Nov 06 2015 14:06
that's not the problem however, I'm not understanding how I can search through and check an arguments list of undetermined length
function destroyer(arr) {
  // Remove all the values

arr = arr.filter(function(val){
  for(i=1; i <= arr.length; i++)
     if(val != arguments[i]){
    return val;
  }

}); // end map function.
return arr;

}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
I know the first if is wrong at the moment, I had conditional statements at first just checking:
val != arguments[1] && val != arguments[2]
This passed all but one, of course, when there are more than 2 arguments needing checked.
now I'm trying to get my head around how to traverse through the array while checking ALL of the arguments
a loop within a loop was my idea, though again, I couldn't understand how to, at the same time, check ALL of the arguments
Matt Leonard
@matty22
Nov 06 2015 14:10
Sadly, the FCC editor hasn't saved my code. I remember not needing two loops. Might not have needed any loops because .filter() is doing that work for you.
jpjenkins
@jpjenkins
Nov 06 2015 14:11
hmm, I'll keep thinking
how do you get it to check through your arguments without a loop then?
Brian Wieland
@bwieland86
Nov 06 2015 14:13
hi, I'm hoping someone could help me out with one of the angular waypoints?
I was following the tutorial provided and had it working, then it asked me to add another controller and it just went "blah"
CamperBot
@camperbot
Nov 06 2015 14:13
:trollface: troll problems? notify admins here
Yusef Habib
@yhabib
Nov 06 2015 14:29
hi fellows!! anyone here is using firefox to debug??? I having problems with span elements and the click function
and I have no idea why, but in Firefox every time I click in one of the span elements inserts some padding in between the letters :S
jpjenkins
@jpjenkins
Nov 06 2015 14:36
function destroyer(arr,first,sec) {
  // Remove all the values

arr = arr.filter(function(val){
  if(val != arguments[1] && val != arguments[2]){
    return val;
  }

 /* why does it not work when I put 'arguments', 
 but it works when I put the assigned variables 'first' and 'second'.
 This is blocking me from understanding how I can iterate through the
 arguments to check if they are in the array. */

}); // end map function.
return arr;

}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
I'd be grateful if someone could take a second to enlighten me :) by replacing arguments 1 and 2 with 'first' and 'second', I successfully remove the 2's and 3's from the array. But the checks in FCC have more than just 2, so I need a way to iterate through an undetermined amount of arguments to be successful. I could just put assign a:
if(arguments[3] === true){ third = arguments[3])
or something like that, but that would fail if there were 4 and it's crap code.
Elizabeth Hatleli
@TheHighPriestess
Nov 06 2015 14:46
So...what happens if you don't do one of the user stories on a zipline?
because one of the Simon user stories...seems like it should be a BONUS user story'
User Story: As a user, if I press the wrong button, I am notified that I have done so, and that series of button presses starts again to remind me of the pattern so I can try again.
That's not part of the Simon game
but I have done this one: Bonus User Story: As a user, if I want to restart, I can hit a button to do so, and the game will return to a single step.
which is a lot easier....
so..this seems a bit peculiar
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 14:55
hello everybody.. may any one tell me what am i doing wrong??

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

.smaller-image {
width: 100px;
}

.gray-background {
background-color: gray;
}

#cat-photo-form{
background-color=green;
}

</style>

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

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

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

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

<form action="/submit-cat-photo" id="cat-photo-form">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>

i'm on Waypoint: Use an ID Attribute to Style an Element
Robin
@Xergxes7
Nov 06 2015 15:01
Dont see an issue there
u only added #cat-photo-form{
background-color=green;
}
right?
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 15:03
thanx for ur response.. yep.. right.. but i can't move to the next waypoint..
CamperBot
@camperbot
Nov 06 2015 15:03
if you want to thank someone, put an @ before their name!
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 15:03
@Xergxes7
Robin
@Xergxes7
Nov 06 2015 15:03
Are any of the checkpoints coming up with a red X?
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 15:04
yep..
Robin
@Xergxes7
Nov 06 2015 15:04
which ones?
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 15:04
Your form element should have the background-color of green.
Bill Zerega
@dedicatedfuture
Nov 06 2015 15:05
hello everyone
Robin
@Xergxes7
Nov 06 2015 15:05
refresh your page and try again
hello
Bill Zerega
@dedicatedfuture
Nov 06 2015 15:05
anyone willing to help me out w a basic problem?
Robin
@Xergxes7
Nov 06 2015 15:05
and what browser are you using @mushfiqulhaq
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 15:07
chrome @Xergxes7
refreshed.. but no luck.. :(
at css, the word 'green' is highlighted.. @Xergxes7
and what's ur basic prob?? @dedicatedfuture
Bill Zerega
@dedicatedfuture
Nov 06 2015 15:15
hey mush
i am trying out this project euler
where they give you simple math problems
it looks like i have the solution but i keep getting unexpected identifier
not sure how to post code from jsfiddle
'
js ``

var sum = 0;

for (var i = 0; i < 1000; i++) {
if (i % 3 === 0 || i % 5 === 0) {
sum += i;
}
}
print sum;

thats the code
dont know why its not working
D/S
@dantesolis
Nov 06 2015 15:17
hey peeps,
I’m trying to pass the Bonfire truncate a string challenge, I get 3 out of my test to pass. Here is my code:
function truncate(str, num) {
  // Clear out that junk in your trunk
  if (str.length <= num) {
    return str;
  } else if (num <= 3) {
    return str.substr(0,num) + '...';
  } else {
    return 'cannot truncate str';
  }
}

truncate("A-tisket a-tasket A green and yellow basket", 11);
Markus Kiili
@Masd925
Nov 06 2015 15:19
@dedicatedfuture use alert() or console.log() instead of print.
Bill Zerega
@dedicatedfuture
Nov 06 2015 15:19
ok
Robin
@Xergxes7
Nov 06 2015 15:19
delete what you wrote and paste this @mushfiqulhaq #cat-photo-form { background-color: green ;}
If it still doesnt work retype it out again with spaces
Bill Zerega
@dedicatedfuture
Nov 06 2015 15:20
that did it @Masd925 thank you
CamperBot
@camperbot
Nov 06 2015 15:20
dedicatedfuture sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star: 261 | @masd925 | http://www.freecodecamp.com/masd925
Robin
@Xergxes7
Nov 06 2015 15:20
Ive experienced issues where what you type is not registered, whilst you can see the text its not being picked up
retyping fixes this
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 15:21
thanx @Xergxes7
CamperBot
@camperbot
Nov 06 2015 15:21
mushfiqulhaq sends brownie points to @xergxes7 :sparkles: :thumbsup: :sparkles:
:star: 174 | @xergxes7 | http://www.freecodecamp.com/xergxes7
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 15:21
how did i make such a silly mistake!!
Robin
@Xergxes7
Nov 06 2015 15:22
so it worked?
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 15:23
yes sir.. i used '=' instead of ':'.. thanks a lot.. @Xergxes7
CamperBot
@camperbot
Nov 06 2015 15:23
mushfiqulhaq sends brownie points to @xergxes7 :sparkles: :thumbsup: :sparkles:
:warning: mushfiqulhaq already gave xergxes7 points
Robin
@Xergxes7
Nov 06 2015 15:24
oh ahahahah
i didnt even notice
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 15:25
:smile:
MelonYu
@MelonYu
Nov 06 2015 15:27
Hello, Why there is the mistake "$ is not defined"? I am the beginner of FreeCodeCamp.
Daniele Manca
@danielemanca1983
Nov 06 2015 15:30
can someone help me with Waypoint: Make Object Properties Private please
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 15:31
hello.. @MelonYu. i'm a beginner too.. at which waypoint r u having the prob??
Kilitan
@Kilitan
Nov 06 2015 15:31
Same here, making the object properties private challenge has stumped me all morning for some reason.
Daniele Manca
@danielemanca1983
Nov 06 2015 15:33
yeah
Caroline Longacre
@cglongacre
Nov 06 2015 15:34
I am trying to put a src for a cat photo and as of now my code is <img class="imv-responsive" src="http://bit.ly/fcc-running-cats"></a>
whats wrong?
Daniele Manca
@danielemanca1983
Nov 06 2015 15:35
the class has a typo
imv-responsive
should be img
MelonYu
@MelonYu
Nov 06 2015 15:35
@mushfiqulhaq just the First Waypoint:Say Hello to HTML Elements. :worried:
Markus Kiili
@Masd925
Nov 06 2015 15:36
@danielemanca1983 What is the problem?
Caroline Longacre
@cglongacre
Nov 06 2015 15:37
i have img responsive @danielemanca1983
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 15:38
plz copy-paste the code here.. @MelonYu
Caroline Longacre
@cglongacre
Nov 06 2015 15:38
<img class="img-responsive" src=" http://bit.ly/fcc-running-cats"></a>
i wrote my code below my <form> code section
and i have my </div> closing tag after my <img> code block
MelonYu
@MelonYu
Nov 06 2015 15:38
<h1>Hello</h1>
Daniele Manca
@danielemanca1983
Nov 06 2015 15:40
problem is: See if you can keep myBike.speed and myBike.addUnit private, while making myBike.getSpeed publicly accessible.
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 15:41
try <h1>Hello World</h1>
@MelonYu
Bersuc
@bersuc
Nov 06 2015 15:41
i had troubles in myBike challenge, but it worked...
MelonYu
@MelonYu
Nov 06 2015 15:41
I change it to <h1>Hello World</h1> and click the "Run tests", but it tell me the mistake $ is not defined
Daniele Manca
@danielemanca1983
Nov 06 2015 15:41
as far as I understand the myBike.getSpeed should use the this keyword
so what did you do @bersuc
Markus Kiili
@Masd925
Nov 06 2015 15:43
@danielemanca1983 inside constructor function use this.getSpeed = function...
Daniele Manca
@danielemanca1983
Nov 06 2015 15:43
yep
MelonYu
@MelonYu
Nov 06 2015 15:43
Should I change a Browser? I use the Chrome now.
Daniele Manca
@danielemanca1983
Nov 06 2015 15:43
and what about add.Unit
Bersuc
@bersuc
Nov 06 2015 15:43
you have to change this.speed to var speed
Daniele Manca
@danielemanca1983
Nov 06 2015 15:43

this.speed = 100;

function addUnit(value) {
return value + "KM/H";
}

this.getSpeed = function () {
return addUnit(speed);
};

Bersuc
@bersuc
Nov 06 2015 15:44
try var speed = 100;
Daniele Manca
@danielemanca1983
Nov 06 2015 15:45
damn
I get it now
thanks @bersuc
CamperBot
@camperbot
Nov 06 2015 15:45
danielemanca1983 sends brownie points to @bersuc :sparkles: :thumbsup: :sparkles:
:star: 179 | @bersuc | http://www.freecodecamp.com/bersuc
Bersuc
@bersuc
Nov 06 2015 15:45
:)
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 15:46
just a minute.. let me check.. i don't think there is anything wrong with the browser.. @MelonYu
MelonYu
@MelonYu
Nov 06 2015 15:47
@mushfiqulhaq OK, thanks~
CamperBot
@camperbot
Nov 06 2015 15:47
melonyu sends brownie points to @mushfiqulhaq :sparkles: :thumbsup: :sparkles:
:star: 52 | @mushfiqulhaq | http://www.freecodecamp.com/mushfiqulhaq
Kilitan
@Kilitan
Nov 06 2015 15:48
Thank you all. Can't believe it was that simple. I think myBike was throwing me off. @bersuc, @danielemanca1983
CamperBot
@camperbot
Nov 06 2015 15:48
kilitan sends brownie points to @bersuc and @danielemanca1983 :sparkles: :thumbsup: :sparkles:
:star: 180 | @bersuc | http://www.freecodecamp.com/bersuc
:star: 175 | @danielemanca1983 | http://www.freecodecamp.com/danielemanca1983
mushfiqulhaq
@mushfiqulhaq
Nov 06 2015 15:50
@MelonYu i'm using chrome too.. and it works fine here.. let's delete what u typed and paste <h1>Hello World</h1>
MelonYu
@MelonYu
Nov 06 2015 15:55
@mushfiqulhaq There still be the same mistake. Maybe I should work it tomorrow:)
ByShadow
@ByShadow
Nov 06 2015 15:57
Hello
Caroline Longacre
@cglongacre
Nov 06 2015 15:57
What's wrong with my code? I am getting an error that my image has to have a src with the image link which i already have...
<img class="img-responsive" src=" http://bit.ly/fcc-running-cats"></a>
ByShadow
@ByShadow
Nov 06 2015 15:58
Your img element should have the class smaller-image.
Your image should be 100 pixels wide.
help
CamperBot
@camperbot
Nov 06 2015 15:58

Hi, I'm CamperBot! I can help you in this chatroom :smile:

Basic Commands:

  • find TOPIC find all entries about topic. ex: find js
  • wiki TOPIC show contents of topic page
  • thanks @username send brownie points to another user
  • about @username shows info on that user
  • bonfire BONFIRENAME info on a bonfire

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

ByShadow
@ByShadow
Nov 06 2015 16:01
i have to create a class called smaller-image and use it to resize the iimage so that it's only 100 pixels wide.
Daniele Manca
@danielemanca1983
Nov 06 2015 16:04
hey folks, is someone working with Waypoint: Filter Arrays with filter
Yulia
@gorelikova1993
Nov 06 2015 16:07
hello, I need help to one task, can't see a mistake.
Waypoint: Give your JavaScript Slot Machine some Stylish Images
Edgar
@Ferru
Nov 06 2015 16:10
what is your problem?
zac247
@zac247
Nov 06 2015 16:11
hello all, could anyne suggest me a good backbone.js tutorial? I should work in be abke to follow along in windows/cygwin
I typed provided code three times
Edgar
@Ferru
Nov 06 2015 16:13
That problem is so strict, try to delete the spaces betwen slotOne - 1, something like slotOne-1, and with the others, I thin that was the thing that works for me
Yulia
@gorelikova1993
Nov 06 2015 16:14
doesn't help :(
Edgar
@Ferru
Nov 06 2015 16:16
@gorelikova1993 mmm, try copying the exact same code, three times, changing the name of the slot.
Yulia
@gorelikova1993
Nov 06 2015 16:16
it helped
thank you
CamperBot
@camperbot
Nov 06 2015 16:16
if you want to thank someone, put an @ before their name!
Yulia
@gorelikova1993
Nov 06 2015 16:17
thank you @Ferru
CamperBot
@camperbot
Nov 06 2015 16:17
gorelikova1993 sends brownie points to @ferru :sparkles: :thumbsup: :sparkles:
:star: 248 | @ferru | http://www.freecodecamp.com/ferru
Arthur
@ayzeeba
Nov 06 2015 16:28
hey guys, I'm having some trouble could you help me out?

link: http://www.freecodecamp.com/challenges/bonfire-reverse-a-string#?solution=function%20reverseString(str)%20%7B%0A%20%20var%20newArr%20%3D%20%5BnewArr.reverse%5D%3B%0A%20%20newArr.reverse()%3B%0A%20%20return%20newArr.reverse%3B%0A%7D%0A%0AreverseString(%22hello%22)%3B%0A
my code:

function reverseString(str) {
var newArr = [newArr.reverse];
newArr.reverse();
return newArr.reverse;
}

reverseString("hello");


Bonfire: Reverse a String
Reverse the provided string.

You may need to turn the string into an array before you can reverse it.

Your result must be a string.

Remember to use Read-Search-Ask if you get stuck. Write your own code.

Here are some helpful links:

Global String Object
String.split()
Array.reverse()
Array.join()

Roy
@CruelCoin
Nov 06 2015 16:31
@ayzeeba [newArr.reverse] this doesn't work.
Arthur
@ayzeeba
Nov 06 2015 16:31
@CruelCoin yeah it seemed a bit wrong
Roy
@CruelCoin
Nov 06 2015 16:31
@ayzeeba My solution used att 3 of the suggested methods: string splitting, array reversing and then array joining
Also, "return newArr.reverse;" this would return an array. The solution is asking for you to return a string
Step 1: Create an array and fill it from what you get when you Split the string.
Step 2: use array.reverse to reverse this array.
Step 3: Use the join method to join that array into a new string.
Step 4: Return that string
Arthur
@ayzeeba
Nov 06 2015 16:35
@CruelCoin thanks alot man
CamperBot
@camperbot
Nov 06 2015 16:35
ayzeeba sends brownie points to @cruelcoin :sparkles: :thumbsup: :sparkles:
:star: 275 | @cruelcoin | http://www.freecodecamp.com/cruelcoin
Roy
@CruelCoin
Nov 06 2015 16:35
No problem, did that help?
Arthur
@ayzeeba
Nov 06 2015 16:35
yes, I appreciate it!
Roy
@CruelCoin
Nov 06 2015 16:36
:-)
function reverseString(str)
{
  var array = [];
  array = str.split('');
  array.reverse();
  var newStr = array.join('');

  return newStr;
}
reverseString('hello');
Shayk Yasin
@shaykyasin
Nov 06 2015 16:43
@CruelCoin You did't have to give him the entire code.
Pranay Kothapalli
@kotAPI
Nov 06 2015 16:45

Guys, how in the oblivious hell is

Object.keys(obj)

used?

Pranay Kothapalli
@kotAPI
Nov 06 2015 16:48
@Ferru , I've read that man, it's all going over my head.
I'm expecting an ELI5 answer for my dumb brain to understand
h4r1m4u
@h4r1m4u
Nov 06 2015 16:49
@kotAPI which part you don't understand? it returns an array of all the object's enumerable properties
@shaykyasin i agree with you
Pranay Kothapalli
@kotAPI
Nov 06 2015 16:50
var bob = new Person('Bob Ross');

console.log(Object.keys(bob).length);
this was supposed to return 6, but it returns 0 somehow
what doest it mean by an object's enumerable properties?
h4r1m4u
@h4r1m4u
Nov 06 2015 16:52
those you can iterate over with a for loop
theSyndical
@theSyndical
Nov 06 2015 16:52
@kotAPI did you write all the methods for Person ?
h4r1m4u
@h4r1m4u
Nov 06 2015 16:52
what does the Person() constructor look like?
Pranay Kothapalli
@kotAPI
Nov 06 2015 16:52
yeah i've written a few functions
 Person.prototype.getFirstName = function(){
     return FirstName;
   };

   Person.prototype.getLastName = function(){
     return LastName;
   };
  Person.prototype.getFullName = function(){
     return firstAndLast;
   };
theSyndical
@theSyndical
Nov 06 2015 16:53
@kotAPI you need to write 6 methods
Pranay Kothapalli
@kotAPI
Nov 06 2015 16:53
and a few more methods, posting here would cover the whole chat
is it returning 0 coz i used prototypes?
alright nevermind, got it. appreciate the help
Roy
@CruelCoin
Nov 06 2015 16:58
@shaykyasin @h4r1m4u He seemed to understand. Its not exactly complex code. Once he get the concept he's pretty much there, so no issue in providing it
h4r1m4u
@h4r1m4u
Nov 06 2015 16:59
if he gets the concept, he can code it
Shayk Yasin
@shaykyasin
Nov 06 2015 16:59
@h4r1m4u right with you mate
h4r1m4u
@h4r1m4u
Nov 06 2015 16:59
it's a way better learning experience. imo
Roy
@CruelCoin
Nov 06 2015 17:00
@h4r1m4u @shaykyasin Whatever floats your boat. This way floats my boat and i was the one giving the advice, so....
h4r1m4u
@h4r1m4u
Nov 06 2015 17:00
it's not about floating my boat. it's about the best way to help others learn
you did a great job explaining the process and concept. the code was excessive
vamus7
@vamus7
Nov 06 2015 17:03
hi how to create a dead link?
use "#" istead of "href" ?
h4r1m4u
@h4r1m4u
Nov 06 2015 17:03
@vamus7 by replacing the value of the href attribute in an <a> element with #
not the href attribute itself, the value
vamus7
@vamus7
Nov 06 2015 17:04
i dont follow
like the "a"?
h4r1m4u
@h4r1m4u
Nov 06 2015 17:04
<a href="http://www.google.com">Google</a> the value of the href attribute here is 'http://www.google.com'
knowing what the value of the href attribute is, how would you replace it with #?
Pranay Kothapalli
@kotAPI
Nov 06 2015 17:05
the value in the quotes he means
vamus7
@vamus7
Nov 06 2015 17:06
yes thanks a lot
CamperBot
@camperbot
Nov 06 2015 17:06
if you want to thank someone, put an @ before their name!
vamus7
@vamus7
Nov 06 2015 17:07
thank you @h4r1m4u
CamperBot
@camperbot
Nov 06 2015 17:07
vamus7 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 556 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 06 2015 17:07
you're welcome, nice work!
Daniele Manca
@danielemanca1983
Nov 06 2015 17:09
can anyone help me with Waypoint: Filter Arrays with filter?
h4r1m4u
@h4r1m4u
Nov 06 2015 17:09
sure. what seems to be the issue?
Daniele Manca
@danielemanca1983
Nov 06 2015 17:10
Use filter to remove all elements from array that are greater than 5.
I used this code
var newArray = oldArray.filter(function(val) {
return val > 5;
});
h4r1m4u
@h4r1m4u
Nov 06 2015 17:10
do you understand how the filter works?
Daniele Manca
@danielemanca1983
Nov 06 2015 17:10
not very much
h4r1m4u
@h4r1m4u
Nov 06 2015 17:11
ok. so the filter() returns an array which contains all the elements from the array you run the filter on for which the callback function evaluates to true
Daniele Manca
@danielemanca1983
Nov 06 2015 17:11
ok
h4r1m4u
@h4r1m4u
Nov 06 2015 17:12
if you have an array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], for which of these numbers would the callback function in your code evaluate to true?
Daniele Manca
@danielemanca1983
Nov 06 2015 17:12
any number greater than 5
h4r1m4u
@h4r1m4u
Nov 06 2015 17:12
that's right!
now what's the assignment of the waypoint?
Daniele Manca
@danielemanca1983
Nov 06 2015 17:13
Use filter to remove all elements from array that are greater than 5.
but I am unsure how to remove them
h4r1m4u
@h4r1m4u
Nov 06 2015 17:13
using the filter function. the filter returns an array with all the elements from the original array for which the callback will be true.
Daniele Manca
@danielemanca1983
Nov 06 2015 17:13
yeah
h4r1m4u
@h4r1m4u
Nov 06 2015 17:14
in other words, all the elements for which the callback is false won't be present in the returned array
(which is effectively removal)
Daniele Manca
@danielemanca1983
Nov 06 2015 17:14
so what should I return
I am unsure about that
an operator should be used as far as I understand
5
greater than 5
h4r1m4u
@h4r1m4u
Nov 06 2015 17:15
you know the answer. you already told me above. we just need it to click it in your head
var oldArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
var newArray = oldArray.filter(function(val) {
  return val > 5;
});
based on what we discussed above, what will be in newArray after the filter runs?
Daniele Manca
@danielemanca1983
Nov 06 2015 17:16
[1,2,3,4,5]
h4r1m4u
@h4r1m4u
Nov 06 2015 17:16
how so?
Edgar
@Ferru
Nov 06 2015 17:16
No...think again
h4r1m4u
@h4r1m4u
Nov 06 2015 17:17
does 1 > 5 evaluate to true?
Daniele Manca
@danielemanca1983
Nov 06 2015 17:17
the task asks to remove values greater than 5
h4r1m4u
@h4r1m4u
Nov 06 2015 17:18
which in other words means - keep all values lower or equal to 5