These are chat archives for FreeCodeCamp/Help

1st
Jan 2016
Michael Martin
@MikeASNT
Jan 01 2016 00:02
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
    var result = "";
    // Your code below this line
  result = "Tomorrow, I will destroy my " + myAdjective + myNoun + "while I "+ myVerb + myAdverb;
    // Your code above this line
  return result;
}

// Change the words here to test your function
wordBlanks("","","","");
Let's play fill in the blanks :P
yoni chanowitz
@yonichanowitz
Jan 01 2016 00:02
in escape sequences strings. what does it want? the symbols, or the words with the symbols??
help
Brian
@sludge256
Jan 01 2016 00:04
just the "symbols"
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 00:04
@ProgrammedMikey what is the problem?
CamperBot
@camperbot
Jan 01 2016 00:08

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

Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 00:10
@yonichanowitz , it will be like: var myStr= "\ \t \t \r \n";
Mohamed Rady
@MohamedRady93
Jan 01 2016 00:13
what is the meaning of lorem ipsum text
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 00:14
Roshan Ghadamian
@RGhadamian
Jan 01 2016 00:16
@SaintPeter I’m doing caesar’s cipher, but I dont know how to shift a letter 13 characters along in the alphabet? where has this been taught in the course?
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 00:18
@RGhadamian did not get to that part yet
Brian
@sludge256
Jan 01 2016 00:20
I don't think it has been "taught" explicitly
Dan Carter
@drdcart
Jan 01 2016 00:21
Just joined FreeCodeCamp and set up a new FCC Facebook group in Bozeman. I was a bit surprised there was not already a group, closest established group is in Butte (Montana)
David Collins Moore
@3chordme
Jan 01 2016 00:21
@RGhadamian I haven't yet, but you should be able to use charCodeAt and charCodeFrom to convert to a number, then add 13, then convert back
Brian
@sludge256
Jan 01 2016 00:21
@drdcart :wave: hi
David Collins Moore
@3chordme
Jan 01 2016 00:21
wiki charcodeat
CamperBot
@camperbot
Jan 01 2016 00:21

:point_right: js string prototype charcodeat [wiki]

js String prototype charCodeAt

The charCodeAt() method returns the numeric Unicode value of the character at the given index (except for unicode codepoints > 0x10000).

:pencil: read more about js string prototype charcodeat on the FCC Wiki

Brian
@sludge256
Jan 01 2016 00:22
It would be a daunting task to teach you how to solve every single little problem
David Collins Moore
@3chordme
Jan 01 2016 00:22
I think it actually is covered in a problem where they give you an array of letters and ask you which are missing in sequence. don't remember which that is.
Brian
@sludge256
Jan 01 2016 00:23
There is a missing letters bonfire
David Collins Moore
@3chordme
Jan 01 2016 00:23
oh yeah maybe that is later then
Brian
@sludge256
Jan 01 2016 00:23
but it also doesn't explicitly tell you how to do it
David Collins Moore
@3chordme
Jan 01 2016 00:23
true enough
Brian
@sludge256
Jan 01 2016 00:26
Yea missing letters is in the intermediate algos section
so it's "way" later
I haven't done all the new waypoints yet so I'm not sure if they do introduce charCodeAt or fromCharCode. They should probably add helpful links to the cipher waypoint though
David Collins Moore
@3chordme
Jan 01 2016 00:28
completely agree
It's hardly intuitive
spacejump13891312
@spacejump13891312
Jan 01 2016 00:31
To be honest. Is there any chance for me to learn JS? I am pretty dumb( i need a lot of time to get something). So am i going to be able to earn some $$$ within 5-8 years?
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 00:32
if you work hard and put time in coding, nothing is impossible, @spacejump13891312
David Collins Moore
@3chordme
Jan 01 2016 00:32
It is more about perseverance than intelligence. And 5-8 years is a long time.
spacejump13891312
@spacejump13891312
Jan 01 2016 00:33
Like, is there any way you learn programing? Like some your personal special way?
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 00:34
there are many ways to learn programming, the question is why u want that?
David Collins Moore
@3chordme
Jan 01 2016 00:34
This is a great resource. I started with a book called A Smarter Way to Learn Javascript that I liked. And codecademy.com is pretty great too.
So far freeCodeCamp is the most fun :D
spacejump13891312
@spacejump13891312
Jan 01 2016 00:35
Well, very good question @safaaAlkhatib
thanks for A Smarter Way to Learn Javascript @3chordme
CamperBot
@camperbot
Jan 01 2016 00:36
spacejump13891312 sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
:star: 244 | @3chordme | http://www.freecodecamp.com/3chordme
David Collins Moore
@3chordme
Jan 01 2016 00:36
no problem :)
Michael DaSilva
@ProgrammedMikey
Jan 01 2016 00:51
find Waypoint: Passing Values to Functions with Arguments
CamperBot
@camperbot
Jan 01 2016 00:51
find waypoint passing values to functions with arguments
nothing found
Brian
@sludge256
Jan 01 2016 00:52
Are you getting a max stack error?
Michael DaSilva
@ProgrammedMikey
Jan 01 2016 00:52
yea
Brian
@sludge256
Jan 01 2016 00:52
try refreshing the page
Michael DaSilva
@ProgrammedMikey
Jan 01 2016 00:53
now its getting NaN
Brian
@sludge256
Jan 01 2016 00:54
What's your code?
Michael DaSilva
@ProgrammedMikey
Jan 01 2016 00:54
function myFunction(param1, param2) {
console.log(param1 + param2);
}
myFunction();
Mahtab
@RoadToCode822
Jan 01 2016 00:54
can anyone help with
var count = 0;

function cc(card) {
  // Only change code below this line
  if (card === 2 || card === 3 || card === 4 || card === 5 || card === 6) {
    count += 1;
  } else if (card === 7 || card === 8 || card === 9) {
    count += 0;
  } else if (card === 10 || card === 'J' || card === 'Q' || card === 'K' || card === 'A') {
    count -= 1;
  }


  if (count > 0) {
    console.log (count + " Bet");
  } else {
    console.log (count + "Hold");
  }

  return "Change Me";
  // Only change code above this line
}

// Add/remove calls to test your function. 
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
for countin cards waypoint
Michael DaSilva
@ProgrammedMikey
Jan 01 2016 00:55
nvm got it
David Collins Moore
@3chordme
Jan 01 2016 00:55
@RoadToCode822 instead of all those if statements, you can put if (card < 6)
Brian
@sludge256
Jan 01 2016 00:55
@ProgrammedMikey Add some stuff into the function call
myFunction("stuff here, "here too");
ok
Michael DaSilva
@ProgrammedMikey
Jan 01 2016 00:55
@sludge256 thanks!
CamperBot
@camperbot
Jan 01 2016 00:55
programmedmikey sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 452 | @sludge256 | http://www.freecodecamp.com/sludge256
David Collins Moore
@3chordme
Jan 01 2016 00:56
but the problem is your return statement
i think
don't console.log, just return count + " Bet" and count + " Hold"
Make sense?
Michael Martin
@MikeASNT
Jan 01 2016 00:59
Does anyone know how to run a function in Javascript in HTML via codepen?
David Collins Moore
@3chordme
Jan 01 2016 00:59
Right now you are returning "Change Me". It wants you to return "-3 Hold" or "5 Bet".
@RoadToCode822 ^
@RoadToCode822 also you don't need that second else statement, as += 0 doesn't do anything
lyndfem02
@lyndfem02
Jan 01 2016 01:02
set D id of an element, help on this
David Collins Moore
@3chordme
Jan 01 2016 01:03
This message was deleted
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:03
@lyndfem02 , id=“name of the id"
lyndfem02
@lyndfem02
Jan 01 2016 01:04
where to insert this cos is not working here
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:04
what is the code first
it should be in the tag of the lement asked for
like: <p id=“any id here”>
Michael Martin
@MikeASNT
Jan 01 2016 01:06
asking me?
lyndfem02
@lyndfem02
Jan 01 2016 01:06
let me show you
Mahtab
@RoadToCode822
Jan 01 2016 01:07
yeah makes sense. Thanks @3chordme
CamperBot
@camperbot
Jan 01 2016 01:07
roadtocode822 sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
:star: 251 | @3chordme | http://www.freecodecamp.com/3chordme
lyndfem02
@lyndfem02
Jan 01 2016 01:08
<form action="/submit-cat-photo">
<h2 id="cat-photo-app">
<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>
that"s it @safaaAlkhatib
Suyash
@sid7
Jan 01 2016 01:08
anyone completed Waypoint: Returning Boolean Values from Functions?
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:10
@lyndfem02 and what is the problem u r facing? first of all why h2 tag nested in form?
which Waypoint is that
Den McHenry
@denmch
Jan 01 2016 01:12
@sid7 I'll check it out right now …
Juwdohr
@Juwdohr
Jan 01 2016 01:13
@Alanh168 enter ``` then press shift+enter
Den McHenry
@denmch
Jan 01 2016 01:13
@sid7 Okay. What do you need?
Suyash
@sid7
Jan 01 2016 01:14
it say that we have remove the if/else statements.
n when tried with out if/else 1 conditions is not geting right
Den McHenry
@denmch
Jan 01 2016 01:14
@sid7 It may be better to say "replace" the if/else statement.
Suyash
@sid7
Jan 01 2016 01:14
ok
Den McHenry
@denmch
Jan 01 2016 01:15
@sid7 The idea is to arrive at the same true or false response without an if/else.
Suyash
@sid7
Jan 01 2016 01:15
but how?
Den McHenry
@denmch
Jan 01 2016 01:15
@sid7 And you can do that with a simple return as in the example.
Suyash
@sid7
Jan 01 2016 01:15
i did that
Den McHenry
@denmch
Jan 01 2016 01:15
@sid7 If x = 1 and I say return x === 1; the return is a Boolean: true
If I say x === 0 the return is false.
Can you share your actual code?
Thomas Manchester
@Eruditious
Jan 01 2016 01:16
you wouldn't say return x = 1
Suyash
@sid7
Jan 01 2016 01:16
function isEqual(a,b) {
  return a===b;
}
Thomas Manchester
@Eruditious
Jan 01 2016 01:16
you'd use return x === 1
Den McHenry
@denmch
Jan 01 2016 01:16
@Eruditious Just careless.
Thomas Manchester
@Eruditious
Jan 01 2016 01:17
just wanted to make sure
Den McHenry
@denmch
Jan 01 2016 01:17
@sid7 Don't copy the example. Follow it, but keep the comparison in the actual program.
@Eruditious I'd do the same thing :)
Thomas Manchester
@Eruditious
Jan 01 2016 01:17
:P
Den McHenry
@denmch
Jan 01 2016 01:18
@Eruditious I'm doing a tutorial with an earbud in one ear and my son is watching Ninjago …
Stoner19
@Stoner19
Jan 01 2016 01:19
@denmch I'm about to do the same. Started Minions for the kiddos and going to go through some js tutorials
Den McHenry
@denmch
Jan 01 2016 01:19
@sid7 In other words, keep the a < b from the original if/else.
Suyash
@sid7
Jan 01 2016 01:20
ok
Den McHenry
@denmch
Jan 01 2016 01:20
@Stoner19 A baby sitter you can trust.
Anthony Leong
@anthonyleong83
Jan 01 2016 01:20
im confused about the waypoint: escape sequences in strings
Instructions
Encode the following sequence, separated by spaces:
backslash tab tab carriage-return new-line and assign it to myStr
why does this code not work?
var myStr; \ \t \t \r \n
Suyash
@sid7
Jan 01 2016 01:21
thanks @denmch
CamperBot
@camperbot
Jan 01 2016 01:21
sid7 sends brownie points to @denmch :sparkles: :thumbsup: :sparkles:
:star: 511 | @denmch | http://www.freecodecamp.com/denmch
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:21
space
var myStr = “\ \t \t \t \n”;
Anthony Leong
@anthonyleong83
Jan 01 2016 01:21
omg
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:21
it should be a string
Anthony Leong
@anthonyleong83
Jan 01 2016 01:21
so simple
Den McHenry
@denmch
Jan 01 2016 01:21
@sid7 Any time!
@anthonyleong83 Double that first slash
Anthony Leong
@anthonyleong83
Jan 01 2016 01:22
thanks @safaaAlkhatib
CamperBot
@camperbot
Jan 01 2016 01:22
anthonyleong83 sends brownie points to @safaaalkhatib :sparkles: :thumbsup: :sparkles:
:star: 83 | @safaaalkhatib | http://www.freecodecamp.com/safaaalkhatib
Brian Giles
@briangiles
Jan 01 2016 01:22
I have a question about Multi-Deminsional Arrays
var arr = [
    [1,2,3],
    [4,5,6],
    [7,8,9],
    [[10,11,12], 13, 14]
];
arr[0]; // equals [1,2,3]
arr[1][2]; // equals 6
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:22
@anthonyleong83 welcome
@briangiles what is the question?
\
Den McHenry
@denmch
Jan 01 2016 01:22
@briangiles Shoot
Brian Giles
@briangiles
Jan 01 2016 01:22
How does `arr1; equals 6?
Den McHenry
@denmch
Jan 01 2016 01:23
@briangiles It's arr[1][2]
Brian Giles
@briangiles
Jan 01 2016 01:23
arr[1][2]; // equals 6
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:23
arry1 => [4,5,6]
Den McHenry
@denmch
Jan 01 2016 01:23
Silly Markdown …
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:23
so array1= 6
Den McHenry
@denmch
Jan 01 2016 01:23
@briangiles It's zero indexed.
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:24
right, arrays start from 0
Brian Giles
@briangiles
Jan 01 2016 01:24
hmmmm
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:24
so array[1] [0] = 4
array1= 5
array1 =6
Ted
@AmLearning
Jan 01 2016 01:25
Hmmmm, how do you add both an id to a form, plus an id style element. the id="" seems to only apply to adding the id to the form...but when creating an id attribute in style, don't you call it by id= also? -- like when you create a .class, you call it with class=""... I created a #id... don't I call it with id=""?
Den McHenry
@denmch
Jan 01 2016 01:25
@briangiles Basically you count the spaces before and after the item. What we think of as the first item comes after the 0 hole, etc.
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:25
@AmLearning yes u do, just used id=“name of the id"
Brian Giles
@briangiles
Jan 01 2016 01:25
@denmch thanks @safaaAlkhatib thanks. Sorry about the delay in replying, I’m trying to understand what you’re saying
CamperBot
@camperbot
Jan 01 2016 01:25
briangiles sends brownie points to @denmch and @safaaalkhatib :sparkles: :thumbsup: :sparkles:
:star: 512 | @denmch | http://www.freecodecamp.com/denmch
:star: 84 | @safaaalkhatib | http://www.freecodecamp.com/safaaalkhatib
David Collins Moore
@3chordme
Jan 01 2016 01:25
@AmLearning yes, it is the same. Are you sure you are meant to add it to the form?
Den McHenry
@denmch
Jan 01 2016 01:26
@briangiles If you move up to position 2, the third item is next.
Nickolas Gettel
@nickolaskg
Jan 01 2016 01:27
Can anyone help with Waypoint: Caesars Cipher
Brian Giles
@briangiles
Jan 01 2016 01:27
hmmm
Let me stare at this for a second.
I’m sure if you could point at what you’re talking about this would be easily cleared up
Steven Parker
@Philosophist
Jan 01 2016 01:28

I'm trying to test the bootsrap glyphicons using the example code from the bootstrap site

<button type="button" class="btn btn-default btn-lg">
  <span class="glyphicon glyphicon-star" aria-hidden="true"></span> Star
</button>

But no icon is appearing on my page. Can anyone tell me why?
http://codepen.io/Philosophist/pen/xZgKzV

Isn't appearing
Den McHenry
@denmch
Jan 01 2016 01:30
@nickolaskg I haven't done that one, but I might loop through and replace characters by char code.
David Collins Moore
@3chordme
Jan 01 2016 01:31
@nickolaskg wiki charCodeAt
wiki charCodeAt
CamperBot
@camperbot
Jan 01 2016 01:31

:point_right: js string prototype charcodeat [wiki]

js String prototype charCodeAt

The charCodeAt() method returns the numeric Unicode value of the character at the given index (except for unicode codepoints > 0x10000).

:pencil: read more about js string prototype charcodeat on the FCC Wiki

David Collins Moore
@3chordme
Jan 01 2016 01:31
Translate to unicode, add 13, translate to letter
I think ;)
Suyash
@sid7
Jan 01 2016 01:33
@Philosophist ur pen does not have bootstrap css
Brian Giles
@briangiles
Jan 01 2016 01:33
@denmch So I see how the first bracket in 'arr1= [1,2,3]'
@denmch @safaaAlkhatib So I see how the first arr[0]; // equals [1,2,3]
Steven Parker
@Philosophist
Jan 01 2016 01:35
@sid7 Ok, that is much better. I had no idea.
@sid7 Thanks!
CamperBot
@camperbot
Jan 01 2016 01:35
philosophist sends brownie points to @sid7 :sparkles: :thumbsup: :sparkles:
:star: 250 | @sid7 | http://www.freecodecamp.com/sid7
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:35
@briangiles great
Brian Giles
@briangiles
Jan 01 2016 01:36
@denmch @safaaAlkhatib How are we getting just 'one number' with arr[1][2]; with two brackets
Nickolas Gettel
@nickolaskg
Jan 01 2016 01:36
CharCode does not work for this particular solution. @denmch @3chordme I had to make a object with a key for ever letter in the alphabet corrosponding to its partner shifted 13 letters down.
Den McHenry
@denmch
Jan 01 2016 01:36
@briangiles You're grabbing the second index of the first index of the arr :)
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:36
@briangiles so what is arr1 equals to?
Suyash
@sid7
Jan 01 2016 01:36

in Waypoint: Return Early Pattern for Functions
my code
```function abTest(a, b) {
// Only change code below this line
if(a<0 || b<0){
return "undefined";
}

// Only change code above this line

return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}
```
says that my code not worked for this condition abTest(-2,2) should return undefined
but when i tried this my change -2,2 in the function while calling answer display for my code is undefined

Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:36
i t is [4,5,6]
David Collins Moore
@3chordme
Jan 01 2016 01:36
@nickolaskg oh! sorry about that, I haven't gotten there yet, just assumed. apologies
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:37
so it is like u r saying i have an array called x = [4,5,6]
David Collins Moore
@3chordme
Jan 01 2016 01:37
@nickolaskg That sounds insane tho
Den McHenry
@denmch
Jan 01 2016 01:37
@briangiles In other words, arr[1] grabs the second level array at that index, and then [2] grabs something from inside that internal array.
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:37
if u say x2 => it will be 6
David Collins Moore
@3chordme
Jan 01 2016 01:37
@nickolaskg let me take a look
Ted
@AmLearning
Jan 01 2016 01:37
@safaaAlkhatib but can you add both and id, and an id attribute? Doesnt when I add both, it doesnt take..
Nickolas Gettel
@nickolaskg
Jan 01 2016 01:37
@3chordme no problem. it looked like it would work. but charCode includes non alphabet characters, so it was putting weird symbols instead of letters at some point.
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:37
which means: are1 = x
Brian Giles
@briangiles
Jan 01 2016 01:37
@denmch aaaahhh
David Collins Moore
@3chordme
Jan 01 2016 01:38
@nickolaskg perhaps better to check if it is A-Z or a-z and just ignore if not?
Seems like an annoying exercise, at any rate
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:39
@AmLearning in the style u r specifying the CSS for the id like: #nameOfID {...}
Nickolas Gettel
@nickolaskg
Jan 01 2016 01:39
@3chordme Yes, the entire time I was trying everything to avoid my end solution.
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:39
in the tag u will use the attribute id=“nameOfID"
David Collins Moore
@3chordme
Jan 01 2016 01:39
@nickolaskg lol I hate that feeling
Ted
@AmLearning
Jan 01 2016 01:40
ahh, never mind... I didn't realize you had to have the id name in creating the style element the same..I thought they were different and you added each separately...
thanks!
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:40
welcome
Anthony Leong
@anthonyleong83
Jan 01 2016 01:41
hey guys
one more
Waypoint: Word Blanks
why is my code not using the word banks
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:41
@anthonyleong83 what about it?
Anthony Leong
@anthonyleong83
Jan 01 2016 01:41

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line
result = "myNoun " + "myAdjective " + "myVerb " + "myAdverb."

// Your code above this line

return result;
}

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");

David Collins Moore
@3chordme
Jan 01 2016 01:41
@nickolaskg str.match(/[a-z]/i); may help in this case
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:42
@anthonyleong83 u need to add a condition that checks when all arguments =“"
Chris
@Aoxom
Jan 01 2016 01:42
@anthonyleong83 that exercise wants you to add more words to the madlib story, not just spaces between the words
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:42
in that case, u specify the result to be a sentence with at least 30 characters
Anthony Leong
@anthonyleong83
Jan 01 2016 01:43
so how do i add a condition that checks the agruments?
Chris
@Aoxom
Jan 01 2016 01:43
@anthonyleong83 oh hold on you did that a bit wrong. you shouldnt put quotes around the arguments
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:43
@anthonyleong83
if (myNoun ==="" && myAdjective === "" && myVerb==="" && myAdverb === "")
result ="This is an empty string because the argument parameters are set to null";
in the above, u are checking on each parameter passed to the function if it is null or not
null means empty
Anthony Leong
@anthonyleong83
Jan 01 2016 01:45
ok
wait im lost again
sorry
Chris
@Aoxom
Jan 01 2016 01:46
@safaaAlkhatib i dont think that was the intent of that exercise
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:46
it is part of it, if u check what they are asking for
that is not the whole code ;)
Chris
@Aoxom
Jan 01 2016 01:46
@anthonyleong83 it wants you to create a little madlib story
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:47
there should be an else that will make result a string created from the params passed
Chris
@Aoxom
Jan 01 2016 01:47
@safaaAlkhatib wordBlanks("","","","") should return at least 30 characters with empty inputs is what you are referring to i assume, and i think thats just to make sure the learner is putting in a madlib story, and not just spaces between the fill-in words
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:48
so the whole code is really

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line

if (myNoun ==="" && myAdjective === "" && myVerb==="" && myAdverb === "")
result ="This is an empty string because the argument parameters are set to null";

else
result = myAdjective+" "+ myNoun + " " + myVerb+ " "+ myAdverb;
// Your code above this line
return result;
}

Richard Griffin
@regchef
Jan 01 2016 01:48
waypoint size your images... ".smaller-image{width:100px;} does not work please help
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:49
@regchef how u r using that class in the image?
Chris
@Aoxom
Jan 01 2016 01:49
@safaaAlkhatib i know what you are saying, and it makes sense, but i still dont think thats what they are asking for :/
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:49
i did that and passed it
@Aoxom
Chris
@Aoxom
Jan 01 2016 01:49
yeah itll pass the tests sure
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:49
u will need to call the function twice: with params and blanks
Richard Griffin
@regchef
Jan 01 2016 01:49
img source
Chris
@Aoxom
Jan 01 2016 01:49
but you arent* creating a real "madlib" story with just four words
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:50
@Aoxom can u show what exactly u mean?
i could be wrong ;)
@regchef ur code please
Chris
@Aoxom
Jan 01 2016 01:50
@safaaAlkhatib a Mad Libs story is like "The ______ was too _______ so he ______ _______" and the 4 words fill in the blanks
err one sec
Richard Griffin
@regchef
Jan 01 2016 01:51
its in the 1st messgae in parenthesis
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:52
see non @regchef
@Aoxom that can be done as well for sure but there is no way to put simple rule in that case..
Richard Griffin
@regchef
Jan 01 2016 01:53
.smaller-image{width:100px;}
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:53
@regchef <image class=“smaller-image”…>
lyndfem02
@lyndfem02
Jan 01 2016 01:53
Waypoint: Use an ID Attribute to Style an Element,it"s not working
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:54
u had defined the class in style, and now u just use it in img tag
Richard Griffin
@regchef
Jan 01 2016 01:54
thanks
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:54
np
Roshan Ghadamian
@RGhadamian
Jan 01 2016 01:54
has anyone done the JS waypoint record collection?
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:54
not me but we can have a look
Roshan Ghadamian
@RGhadamian
Jan 01 2016 01:55
i’m not sure where to start in terms of what functions I should be using?
Chris
@Aoxom
Jan 01 2016 01:55
@anthonyleong83 any luck?
Roshan Ghadamian
@RGhadamian
Jan 01 2016 01:56
obviously there’s an object and four properties in there
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:56
@RGhadamian , object has an id as -> 2548 and property as album and artist, and tracks
Roshan Ghadamian
@RGhadamian
Jan 01 2016 01:57
yes I understand this…but I’m not sure what to do in terms of firstly calling the id
then checking whether the value is !== “"
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:57
so u want to do something like:
update(2458,artist, “anything")
Roshan Ghadamian
@RGhadamian
Jan 01 2016 01:58
so I need to build a new function within the function?
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 01:58
no, u need to use the update function itself and do some if conditions to check
Roshan Ghadamian
@RGhadamian
Jan 01 2016 01:59
ok I was thinking of doing if statements but then the code will probably get quite bloated…is there no better way of doing it?
Mark
@MarkFilchenko
Jan 01 2016 02:00
var myStr = \ \t \t \r \n;
what is wrong with that?
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 02:00
u can add functions to make the delete of prop or check on values
@MarkFilchenko it should be btw “” , u r dealing with string
Mark
@MarkFilchenko
Jan 01 2016 02:00
ah of course
thank you
Safaa Alkhatib
@safaaAlkhatib
Jan 01 2016 02:01
welcome
I am leaving for now, happy new yr for all.. see u tomorrow :)
Roshan Ghadamian
@RGhadamian
Jan 01 2016 02:01
happy nww year @safaaAlkhatib
Chris
@Aoxom
Jan 01 2016 02:01
@safaaAlkhatib take care!
Jason C.
@jayman3838
Jan 01 2016 02:05

var myVar = 87;

// Only change code below this line
myVar = myVar i++ 1;
how do i make myVar = 88

David Collins Moore
@3chordme
Jan 01 2016 02:06
myVar++
I think
yes
that should be right :)
Adding ++ after a variable increments by one
It is the same as saying myVar += 1;
Which is the same as myVar = myVar + 1;
@jayman3838 ^
Jason C.
@jayman3838
Jan 01 2016 02:08
@3chordme myVar = myVar ++; IS THIS RIGHT?
David Collins Moore
@3chordme
Jan 01 2016 02:08
NO IT IS NOT
lol
myVar++;
OR
myVar += 1;
OR
sammyb123
@sammyb123
Jan 01 2016 02:08
thanks @safaaAlkhatib
CamperBot
@camperbot
Jan 01 2016 02:08
sammyb123 sends brownie points to @safaaalkhatib :sparkles: :thumbsup: :sparkles:
:star: 85 | @safaaalkhatib | http://www.freecodecamp.com/safaaalkhatib
David Collins Moore
@3chordme
Jan 01 2016 02:09
myVar = myVar + 1;
Jason C.
@jayman3838
Jan 01 2016 02:09
@3chordme thanks so much :smile:
CamperBot
@camperbot
Jan 01 2016 02:09
jayman3838 sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
:star: 255 | @3chordme | http://www.freecodecamp.com/3chordme
David Collins Moore
@3chordme
Jan 01 2016 02:09
no problem :D
Rex Schrader
@SaintPeter
Jan 01 2016 02:09
@RGhadamian You can do a lookup :D
Laura Veee
@Cyclokitty
Jan 01 2016 02:13
I'm stuck on Waypoint: Using Objects for Lookups. It is driving me nuts.
function phoneticLookup(val) {
  var result = "";

  // Only change code below this line
 result = {
     "alpha": "Adams",
     "bravo": "Boston",
     "charlie": "Chicago",
     "delta": "Denver",
     "echo": "Easy",
     "foxtrot":"Frank"
  };

  var someProp = val;
  var nextOne = result.someProp;

  // Only change code above this line
  return result;
}
Jason C.
@jayman3838
Jan 01 2016 02:15
Set remainder equal to the remainder of 11 divided by 3 using the remainder (%) operator.
im lost can someone help me
J
It is Waypoint: Finding a Remainder in Javascript
Bill
@kirah1314
Jan 01 2016 02:17
@jayman3838 remainder = 11 % 3;
Laura Veee
@Cyclokitty
Jan 01 2016 02:18
Yup, it's typing it in js like it's written
Chris
@Aoxom
Jan 01 2016 02:19
@Cyclokitty have a nice catnap?
Jesus Vega
@ParagonChuy
Jan 01 2016 02:20
has anyone done the golf code?
Bill
@kirah1314
Jan 01 2016 02:20
@ParagonChuy Yup finished the golf codes
Jesus Vega
@ParagonChuy
Jan 01 2016 02:20
Can you help? I'm not entirely sure how to even start
Bill
@kirah1314
Jan 01 2016 02:21
@ParagonChuy you have to write a bunch of if else statements
Jesus Vega
@ParagonChuy
Jan 01 2016 02:22
what am i comparing to what
Laura Veee
@Cyclokitty
Jan 01 2016 02:22
@Aoxom It was good. I had pizza afterwards.
Bill
@kirah1314
Jan 01 2016 02:22
@ParagonChuy first one should be if (strokes === 1) { return "..."; }
Jesus Vega
@ParagonChuy
Jan 01 2016 02:23
okay but what do i do about the par
Bill
@kirah1314
Jan 01 2016 02:23
@ParagonChuy if strokes === par;
Jesus Vega
@ParagonChuy
Jan 01 2016 02:23
ohh
i get it now
thanks @kirah1314
CamperBot
@camperbot
Jan 01 2016 02:23
paragonchuy sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 686 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Jan 01 2016 02:23
@ParagonChuy the first column is what you compare strokes with :thumbsup:
Chris
@Aoxom
Jan 01 2016 02:24
@Cyclokitty yummy, chinese food here :)
Laura Veee
@Cyclokitty
Jan 01 2016 02:26
@Aoxom Lucky!
Oh good grief. I finally figured it out!
Jason C.
@jayman3838
Jan 01 2016 02:27
Convert the assignments for a, b, and c to use the += operator.
can someone help me? im lost

var a = 3;
var b = 17;
var c = 12;

// Only modify code below this line

a = a +12;
b = 9 +b;
c = c +7;

Bill
@kirah1314
Jan 01 2016 02:28
@jayman3838 a += 12;
Jason Watkins
@jasonwatkins
Jan 01 2016 02:28

anybody done the counting cards waypoint? i'm stuck on it. var count = 0;

function cc(card) {
// Only change code below this line
if (card === 2 || card === 3 || card === 4 || card === 5 || card === 6) {
return count++ + " Bet";
} else if (card === 7 || card === 8 || card === 9){
return count;
} else if (card === 10 || card === "J" || card === "Q" || card === "K" || card === "A") {
return count-- + " Hold";
}
// Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc("2");

none of the test pass
Laura Veee
@Cyclokitty
Jan 01 2016 02:29
I did mine the long way with a switch for each group of cards and than an if/else if for the final print outs
Jason C.
@jayman3838
Jan 01 2016 02:30

@kirah1314 var a = 3;
var b = 17;
var c = 12;

// Only modify code below this line

a = a += 12;var a = 3;
var b = 17;
var c = 12;

is this it?
says not working
Jason Watkins
@jasonwatkins
Jan 01 2016 02:30
ahh i almost did it that way earlier @Cyclokitty , i'll give it a whirl
Roshan Ghadamian
@RGhadamian
Jan 01 2016 02:30
anyone here done the waypoint record collection?
Bill
@kirah1314
Jan 01 2016 02:31
@jayman3838 try this:
a += 12;
b += 9;
c += 7;
Laura Veee
@Cyclokitty
Jan 01 2016 02:31
@jasonwatkins It looks like a lot more code to type but the way it's set up, you'll see the conditional statements easily
Jason Watkins
@jasonwatkins
Jan 01 2016 02:32
@Cyclokitty yea thats what turned me off of it earlier, i need to stop being lazy lol
Laura Veee
@Cyclokitty
Jan 01 2016 02:34
lol I hear you!
My brain triples the work that is actually needed.
Jason Watkins
@jasonwatkins
Jan 01 2016 02:35
mine too!
Steven Parker
@Philosophist
Jan 01 2016 02:37
On the Camper News API, what type of time code is that listed for timePosted? Like this: 1451501011401
How does someone read that?
Ray
@wolfhound921
Jan 01 2016 02:38

havin a trouble with "Selecting from many options with Switch Statements" this is what i got: switch (num) {

case myTest(1):
answer = "alpha";
break;

case myTest(2):
answer = "beta";
break;

case myTest(3):
answer = "gamma";
break;

case myTest(4):
answer = "delta";
break;

}

Jason Watkins
@jasonwatkins
Jan 01 2016 02:40
@Cyclokitty worked like a charm, thanks!!
CamperBot
@camperbot
Jan 01 2016 02:40
jasonwatkins sends brownie points to @cyclokitty :sparkles: :thumbsup: :sparkles:
Laura Veee
@Cyclokitty
Jan 01 2016 02:40
@Philosophist I think that's all the milliseconds since midnight 01 January, 1970 UTC
CamperBot
@camperbot
Jan 01 2016 02:40
:star: 282 | @cyclokitty | http://www.freecodecamp.com/cyclokitty
Laura Veee
@Cyclokitty
Jan 01 2016 02:41
@jasonwatkins Yes! Anytime!
Bill
@kirah1314
Jan 01 2016 02:41
@wolfhound921 it should be case 1: remove all myTest()
Ray
@wolfhound921
Jan 01 2016 02:42
@kirah1314 thanks! happy new yr
CamperBot
@camperbot
Jan 01 2016 02:42
wolfhound921 sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 690 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Jan 01 2016 02:42
@wolfhound921 :thumbsup: you're welcome and happy new years to you too!
Thomas DeFeo-Gelman
@triplettomy
Jan 01 2016 02:42
Quincy is holding a livestream not sure if anyone knows
Steven Parker
@Philosophist
Jan 01 2016 02:48
@Cyclokitty Naw, then it would be magnitudes too small.
abidahmad473
@abidahmad473
Jan 01 2016 02:54
How d you guys post strips of code in this room
Jpax411
@Jpax411
Jan 01 2016 02:55
has anyone done the new Waypoint: Local Scope and Functions?
Jesus Vega
@ParagonChuy
Jan 01 2016 02:56
Have any of you guys done the replacing if else chains with switch?
Richard Griffin
@regchef
Jan 01 2016 02:56
waypoint 23.. link to external pages with anchor elements.. i have written "<p>cat photos<a href="http://freecatphotoapp.com"></a></p>
tells me your a element should have the anchor text of cat photos confused??????
Jesus Vega
@ParagonChuy
Jan 01 2016 02:58
@Jpax411 yeah what's up?
Jpax411
@Jpax411
Jan 01 2016 02:58
is is broken?
Jesus Vega
@ParagonChuy
Jan 01 2016 02:58
no
Jpax411
@Jpax411
Jan 01 2016 02:58

function myFunction() {
var myVar=23;
console.log(myVar);
}
myFunction();

// run and check the console
// myVar is not defined outside of myFunction
// now remove the console.log line to pass the test

Jesus Vega
@ParagonChuy
Jan 01 2016 02:58
I finished it just fine
oh wait
you have to delete both the console.log lines
it's a bug
Richard Griffin
@regchef
Jan 01 2016 02:59
can someone help me
Jpax411
@Jpax411
Jan 01 2016 03:00
cool, I'll report it
Jesus Vega
@ParagonChuy
Jan 01 2016 03:00
yeah np
@regchef what's your code look like?
Jpax411
@Jpax411
Jan 01 2016 03:04
@refresh2k you need to put the link words in between your link's <a> and </a>
<p><a href="http://freecatphotoapp.com">cat photos</a></p>
Sean McGuinness
@smmcguinness
Jan 01 2016 03:05
can anyone help with waypoint shopping list?
Bill
@kirah1314
Jan 01 2016 03:05
@smmcguinness sure, what do you need help with?
Richard Griffin
@regchef
Jan 01 2016 03:06
paragon its in my first message
Ray
@wolfhound921
Jan 01 2016 03:06
in "Counting Cards," is the card-counting function supposed include some if/else statements ?? or is it a switch statement ?
Sean McGuinness
@smmcguinness
Jan 01 2016 03:06
im not using correct syntax for sub array.
Stoner19
@Stoner19
Jan 01 2016 03:07
man, I'm super stuck on the Convert Celsius to Fahrenheit waypoint
Bill
@kirah1314
Jan 01 2016 03:07
@smmcguinness paste what you have?
@wolfhound921 i think you can use either, I used switch statement
Jesus Vega
@ParagonChuy
Jan 01 2016 03:08
which waypoint is it
Bill
@kirah1314
Jan 01 2016 03:08
@Stoner19 paste what you have here?
Sean McGuinness
@smmcguinness
Jan 01 2016 03:08
var myList = ["lettuce", 1, "tomato",2,"garlicn", 3,"onion", 4, "grape", 6];
Jesus Vega
@ParagonChuy
Jan 01 2016 03:08
@Stoner19 Read the instructions all the way through
Stoner19
@Stoner19
Jan 01 2016 03:08
I literally have nothing, other than var fahrenheit = (9/5 + 32);
Sean McGuinness
@smmcguinness
Jan 01 2016 03:08
Before i tried it snother way
Stoner19
@Stoner19
Jan 01 2016 03:10
@ParagonChuy yeah, I read and reread several times. I'm sure I'm just forgetting what I need to do. It's kinda hard to take a break for a week or longer and come back to things
Marisa Lozano
@marisaslozano
Jan 01 2016 03:10
Hello everyone! I'm on passing values to functions with arguments. Here is my code and none of the parameters seem to be registering. I don't understand. Please help?
function myFunction(m, j) {
console.log(m + j);
}
myFunction(1, 2);
umesh
@umeshgadage1989
Jan 01 2016 03:10
@smmcguinness try this [["lettuce", 1][ "tomato",2]["garlicn", 3]["onion", 4][ "grape", 6]];
Stoner19
@Stoner19
Jan 01 2016 03:10
I do wish there was another button or way to reference what needs to be done, rather than just coming here for help
Bill
@kirah1314
Jan 01 2016 03:10
@smmcguinness you need to create a multi-dimensional array while your codes are just a single array
sammyb123
@sammyb123
Jan 01 2016 03:11
thanks @ivy33
CamperBot
@camperbot
Jan 01 2016 03:11
sammyb123 sends brownie points to @ivy33 :sparkles: :thumbsup: :sparkles:
:star: 248 | @ivy33 | http://www.freecodecamp.com/ivy33
Sean McGuinness
@smmcguinness
Jan 01 2016 03:12
i attempted them within brackets as following :[ [][[][[][[][[]]
Bill
@kirah1314
Jan 01 2016 03:12
@Stoner19 var fahrenheit = celsius * (9/5) + 32;
Stoner19
@Stoner19
Jan 01 2016 03:13
oh geez. I actually was closer than I thought. Thank you @kirah1314
CamperBot
@camperbot
Jan 01 2016 03:13
stoner19 sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 696 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Sean McGuinness
@smmcguinness
Jan 01 2016 03:13
that didnt work
Bill
@kirah1314
Jan 01 2016 03:14
@smmcguinness use myList.push([array1], [array2], [array3], [array4], [array5]);
@Stoner19 :thumbsup:
Stoner19
@Stoner19
Jan 01 2016 03:15
the older I get (or maybe the older my kids get) the harder it seems to remember just about anything
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:15
who has done the bonfire mutations?
umesh
@umeshgadage1989
Jan 01 2016 03:15
@smmcguinness sorry you have to use , in between your '[]' like this code var myList = [["lettuce", 1],[ "tomato",2],["garlicn", 3],["onion", 4],[ "grape", 6]];
Stoner19
@Stoner19
Jan 01 2016 03:15
certainly makes learning to code difficult
David Collins Moore
@3chordme
Jan 01 2016 03:15
@RGhadamian I have
Sean McGuinness
@smmcguinness
Jan 01 2016 03:15
i attempted it 5 levels deep
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:15
I’m totally stuck on what exactly teh string.indexOf() function does?
@3chordme
ArchSerpo
@ArchSerpo
Jan 01 2016 03:16
Waypoint: Local Scope and Functions: There is no goals?
Sean McGuinness
@smmcguinness
Jan 01 2016 03:16
so it rewuires a nested array not 5
David Collins Moore
@3chordme
Jan 01 2016 03:16
@RGhadamian .indexOf returns -1 if the value is not present in the string, otherwise it tells you what the index of the value is.
Sean McGuinness
@smmcguinness
Jan 01 2016 03:16
levels of different arrays
David Collins Moore
@3chordme
Jan 01 2016 03:17
@RGhadamian Well. The first instance. So "hello".indexOf("l"); returns 2. "hello".indexOf("x"); returns -1.
That's an L, by the way. Not a one.
Make sense?
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:18
@3chordme rightio
Bill
@kirah1314
Jan 01 2016 03:18
@Stoner19 for that waypoint, you're given an argument which is celsius and you need to use this argument to convert to fahrenheit. Without this argument, you can't convert it
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:18
that makes sense
David Collins Moore
@3chordme
Jan 01 2016 03:18
good good
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:18
I’m just looking at some example codes from MDN
Jason Watkins
@jasonwatkins
Jan 01 2016 03:18
anyone else miss the raining checkmarks from the old version? the single checkmark upon successful completion seems restrictive
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:18
@3chordme this could take a while to actually understand :)
David Collins Moore
@3chordme
Jan 01 2016 03:19
@RGhadamian haha yeah, just play with it in your console for a minute, you'll get the hang of it
Stoner19
@Stoner19
Jan 01 2016 03:20
@kirah1314 I see it now. Since celsius wasn't written as a simple var celsius it confused me a bit
clearly my markup didn't work either fixed :)
David Collins Moore
@3chordme
Jan 01 2016 03:21
@RGhadamian It can be used for Arrays too. It's a good way of saying, "is this value even in my array or my string?" If you get -1, you know it isn't in the array or the string. If you get a number greater than or equal to 0, you know it is there somewhere.
Bill
@kirah1314
Jan 01 2016 03:21
@Stoner19 yeah it gets confusing once you work with functions, just now the parameters are also variables like function myFunction(a, b, c, d) a, b, c, d are local variables you can use within myFunction
David Collins Moore
@3chordme
Jan 01 2016 03:22
@RGhadamian [1, 2, 3, 4].indexOf(1); //returns 0 because 1 is at the 0 position and [1, 2, 3, 4].indexOf(5); //returns -1 because it isn't there at all.
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:22
@3chordme you have an awesome Github contributions page
‘hire me'
:)
hilarious!
David Collins Moore
@3chordme
Jan 01 2016 03:22
haha thanks!
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:23
cool thanks @3chordme
CamperBot
@camperbot
Jan 01 2016 03:23
rghadamian sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
:star: 257 | @3chordme | http://www.freecodecamp.com/3chordme
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:23
now I’ve just got to figure out how to use it
David Collins Moore
@3chordme
Jan 01 2016 03:23
good luck! :)
leanminmachine
@leanminmachine
Jan 01 2016 03:27
hey guys : I need some help for Waypoint : Iterate Over Arrays with Map.

Tried using this code but it doesn't work? I get 1,2,3,4,5 returned to me instead of adding 3 to each value.

var addThree =
oldArray.map(function(val) {
return val + 3;
});

David Collins Moore
@3chordme
Jan 01 2016 03:30
@minminimal That's a problem I had too. You need to do this:
var addThree = oldArray.map(function(val, index, array) { return index[array] = val + 3; });
See if that works for you. For some reason you have to use the bracket notation on the index rather than just setting the value. Doesn't completely make sense but there it is.
Ray
@wolfhound921
Jan 01 2016 03:33

my card-counting function is a dud, so it seems.... this is what i got: if (card <7){
count++;
return "Bet";
}

 else if (card <10) {
  count--;
   return "Hold";
 }

else {
count--;
return "Hold";
}

}
return "Change Me";

Richard Griffin
@regchef
Jan 01 2016 03:34
<p><a href="http://www.freecatphotoapp.com">cat photos</a>View more </p> tells me that my p element should have the text "view more " (with a space after it)... confused... by what it seeks..
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:34
@3chordme did you do the mutations bonfire with a while loop?
David Collins Moore
@3chordme
Jan 01 2016 03:34

@minminimal oh crap. I'm totally wrong. I was thinking of a different one.

var newArray = oldArray.map(function(val) {
  return val + 3;
});

worked for me

@RGhadamian lemme check
@RGhadamian no, just a normal for loop
leanminmachine
@leanminmachine
Jan 01 2016 03:36
@3chordme im still having the same problems :(
It still returns 1,2,3,4,5 lol
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:36
@3chordme ok I’ve got some if/else statements that allows me to do some of the solutions but I’m guessing that I have split up the string into an array and have a for loop go through each letter to check if it’s in the original string?
David Collins Moore
@3chordme
Jan 01 2016 03:37
@minminimal try refreshing your page? sometimes that helps
Richard Griffin
@regchef
Jan 01 2016 03:37
i asked for assistance any one
David Collins Moore
@3chordme
Jan 01 2016 03:38
@RGhadamian no, since you can use indexOf on a string there isn't a need to separate. And your for loop can iterate over the string using myString.length same as an array.
leanminmachine
@leanminmachine
Jan 01 2016 03:39
LOL okay it worked now thanks @3chordme
CamperBot
@camperbot
Jan 01 2016 03:39
minminimal sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
:star: 261 | @3chordme | http://www.freecodecamp.com/3chordme
David Collins Moore
@3chordme
Jan 01 2016 03:39
Here was my solution:
function mutation(arr) {

  var first = arr[0].toLowerCase()
  , second = arr[1].toLowerCase();

  flag = true;

  for (i = 0; i < second.length; i++) {
    if (first.indexOf(second[i]) === -1) {
      flag = false;
      break;
    }
   }

  return flag;

}
@regchef what was the question?
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:41
oh god i’m so close @3chordme
so close
David Collins Moore
@3chordme
Jan 01 2016 03:41
hahaha
can i see?
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:41
let me see if I can bash away
David Collins Moore
@3chordme
Jan 01 2016 03:41
haha kk
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:41
and figure it out
I’ll paste the code in here but don’t tell me how to fix it unless I crawl into a hole and die and can’t figure it out

function mutation(arr) {

var string = arr[0].toLowerCase();
var check = arr1.toLowerCase();

for (i=0; i<string.length; i++) {

if (string.indexOf(check[i]) >= 0 ) {
return true;
}

else {
return false;
}
}
return check;
}

mutation(["HJllo", "hello"]);

David Collins Moore
@3chordme
Jan 01 2016 03:42
okay okay my lips are sealed
David Collins Moore
@3chordme
Jan 01 2016 03:45
@wolfhound921 you are on the right track, but it needs some work. You need to build in a contingency for when the count DOESN'T change. And your return statements need to match the instructions EXACTLY. Also, remove the return "Change Me"; from the end, that is no longer necessary.
Joe McIlhargey
@jmcilhargey
Jan 01 2016 03:46
Has anyone solved the Waypoint: Caesars Cipher yet?
David Collins Moore
@3chordme
Jan 01 2016 03:46
Yes. It is a pain in the behind.
Jason Watkins
@jasonwatkins
Jan 01 2016 03:46
@wolfhound921 i ended up doing a switch statement
David Collins Moore
@3chordme
Jan 01 2016 03:46
@jmcilhargey I haven't had time to refactor my solution yet. But I was able to get charCodeAt and fromCharCode working for me.
Joe McIlhargey
@jmcilhargey
Jan 01 2016 03:46
Yeah, I'm having trouble for the letters that loop past Z
That was the direction I was going too..
David Collins Moore
@3chordme
Jan 01 2016 03:48
There's the rub. For numbers past character code 110, you need to subtract 13 instead of adding it. This will make z = m as it should, rather than becoming some insane non-alpha character.
Not sure about the exact details tbh, but that is the idea.
Joe McIlhargey
@jmcilhargey
Jan 01 2016 03:49
Haha to be or not to be. That's a great point.. Maybe I can setup a if statement to account for that
David Collins Moore
@3chordme
Jan 01 2016 03:49
yes! perfect.
Joe McIlhargey
@jmcilhargey
Jan 01 2016 03:49
@3chordme Thanks for the tip!
CamperBot
@camperbot
Jan 01 2016 03:49
jmcilhargey sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
:star: 262 | @3chordme | http://www.freecodecamp.com/3chordme
David Collins Moore
@3chordme
Jan 01 2016 03:49
for sure!
yoni chanowitz
@yonichanowitz
Jan 01 2016 03:53
@safaaAlkhatib thanks
CamperBot
@camperbot
Jan 01 2016 03:53
yonichanowitz sends brownie points to @safaaalkhatib :sparkles: :thumbsup: :sparkles:
:star: 86 | @safaaalkhatib | http://www.freecodecamp.com/safaaalkhatib
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:53
ok I’m cooked @3chordme
I don’t understand why it won’t let me pass the test with “hello”, “hey"
but will do it for all other tests…?
David Collins Moore
@3chordme
Jan 01 2016 03:55
can you repaste your code?
Rafael J. Rodriguez
@Rafase282
Jan 01 2016 03:55

I'm having trouble with this

function checkNaturalTime(date, unix) {
        // Deal with Natural Time
        if (unix == null) {
            return unix;
        } else {
            return date;
        }
    }

I'm not getting a null value, basically I'm not getting unix when unix is infact null

Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:56

function mutation(arr) {

var string = arr0.toLowerCase();
var check = arr1.toLowerCase();

for (i=0; i<string.length; i++) {

if (string.indexOf(check[i]) >= 0 ) {
return true;
}

else {
return false;
}
}

}

mutation(["hello", "hey"]);

David Collins Moore
@3chordme
Jan 01 2016 03:58
Ah! I see a problem, I think. Remember that return will IMMEDIATELY terminate your function. So it checks h, thinks, "Oh hey, we got a match, let's stop the function" and then returns true and doesn't check any more.
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:58
test
David Collins Moore
@3chordme
Jan 01 2016 03:58
That is why I used the flag to store the value of true or false.
lol very good :)
Roshan Ghadamian
@RGhadamian
Jan 01 2016 03:58
what’s teh flag?
Debby
@debbyccc
Jan 01 2016 03:59
why this following code cannot let the background changed to green ?
Ray
@wolfhound921
Jan 01 2016 03:59
@jasonwatkins that's interesting ...mite i ask what yer switch statement looked like ?
Debby
@debbyccc
Jan 01 2016 03:59
#cat-photo-form {
background-color: green;
}
David Collins Moore
@3chordme
Jan 01 2016 03:59
I put var flag = true; as a way of keeping track of my Boolean. Then if I found a letter that didn't match, I changed flag = false, and after checking ALL the values, I return flag
Debby
@debbyccc
Jan 01 2016 04:00
<form id="cat-photo-form" action="/submit-cat-photo">
<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>
David Collins Moore
@3chordme
Jan 01 2016 04:00
You can name it anything, just a way to track Booleans
Cole Perkins
@coleperkins
Jan 01 2016 04:00
Working through Waypoint: Passing Values to Functions with Arguments. I have define the function and called it. My code seems correct; however, I am not passing the waypoint because it states I have not 'called' the function yet. Any ideas?

function myFunction(a, b) {
console.log(a + b);
}

myFunction();

David Collins Moore
@3chordme
Jan 01 2016 04:00
@debbyccc it looks like you have a space # cat-photo-form should be #cat-photo-form
Debby
@debbyccc
Jan 01 2016 04:01
I found I can solve it after reset the editor
Cole Perkins
@coleperkins
Jan 01 2016 04:01
Failing to pass the test which states :"Call myFunction after you define it"
David Collins Moore
@3chordme
Jan 01 2016 04:01
@debbyccc oh good!
@coleperkins make sure you put in arguments
Cole Perkins
@coleperkins
Jan 01 2016 04:02
I will try that again.
Worked that time. I tried using strings as arguments before. Perhaps that was the issue.
Thanks @3chordme
CamperBot
@camperbot
Jan 01 2016 04:03
coleperkins sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
:star: 265 | @3chordme | http://www.freecodecamp.com/3chordme
David Collins Moore
@3chordme
Jan 01 2016 04:03
ah, yes, perhaps. glad it worked!
Roshan Ghadamian
@RGhadamian
Jan 01 2016 04:03
@3chordme thx, i got it eventually
CamperBot
@camperbot
Jan 01 2016 04:03
rghadamian sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
:warning: rghadamian already gave 3chordme points
David Collins Moore
@3chordme
Jan 01 2016 04:03
@RGhadamian nice!
yoni chanowitz
@yonichanowitz
Jan 01 2016 04:05
help, in waypoint escapesequences in strings. what did ido wrong??
var myStr = "\" \" \\ \" \t \t \r \n\" ";
CamperBot
@camperbot
Jan 01 2016 04:05
no wiki entry for: in waypoint escapesequences in strings what did ido wrongvar mystr t t r n
:pencil: click here to create one now!after creating your page type update to reload it here
David Collins Moore
@3chordme
Jan 01 2016 04:07
@yonichanowitz var myStr = "\\ \t \t \r \n";
One set of quotes for the whole thing, then one backslash per special character.
yoni chanowitz
@yonichanowitz
Jan 01 2016 04:08
@3chordme why?
David Collins Moore
@3chordme
Jan 01 2016 04:08
Hmm good question.
Well you are only making one string, so you only need one set of quotes.
leanminmachine
@leanminmachine
Jan 01 2016 04:08

Now I'm stuck at the reversing arrays bit :( Got back the correct values of 7,6,5,4,3,2,1 returned but somehow, it says I'm not using the reverse method lol.

Here's my code

newArray.reverse (function (a,b) {
return a + b;
});

David Collins Moore
@3chordme
Jan 01 2016 04:09
@yonichanowitz And then the backslash is a character used to indicate you are going to make a special character, so you only need it once per special character. One for the tab, one for the carriage-return, one for the new line.
@yonichanowitz And then a backslash to make a backslash show up (otherwise it just wouldn't appear)
@minminimal lol that is strange! I think you can just say array.reverse(); and it will reverse array, I don't think you need a callback.
so maybe newArray = oldArray.reverse();
or something like that?
leanminmachine
@leanminmachine
Jan 01 2016 04:12
yeah you're right newArray.reverse (); works thanks @3chordme
CamperBot
@camperbot
Jan 01 2016 04:12
minminimal sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
:warning: minminimal already gave 3chordme points
David Collins Moore
@3chordme
Jan 01 2016 04:12
for sure!
Ray
@wolfhound921
Jan 01 2016 04:14

@3chordme this an improvement ? var count = 0;

function cc(card) {
// Only change code below this line

if (card < 7){
return "Bet";
}

else if (card > 9){
return "Hold";
}

  else {
    return "Hold";
  }
David Collins Moore
@3chordme
Jan 01 2016 04:17
@wolfhound921 Right now, you're code says if card is less than 7, return "Bet", and if card is greater than 9, return "Hold", and for all other cases return "Hold". This is not what the instructions ask, but it is the right general direction. I have some suggestions:
Hancheng Wu
@spockmaster
Jan 01 2016 04:18
What Javascript function can print something onto the screen but unlike document.write(), it has to be where I need it to be?
David Collins Moore
@3chordme
Jan 01 2016 04:20

@wolfhound921
If card is less than or equal to six, add 1 to count.
If card is greater than six AND less than 10, do nothing.
If card is equal to ten OR J OR Q OR K OR Ace, subtract 1 from count.

then

if count is less than or equal to 0, return count and " Hold",
and if count is greater than zero, return count and " Bet"

Try making that work in code! Good luck! If you can't get it, I can give you my solution.

@spockmaster I'm not sure if I understand the question, maybe console.log();
Ray
@wolfhound921
Jan 01 2016 04:21
@3chordme okay... i'll make an effort with what you gave me here, which looks like a lot ..... thank you
CamperBot
@camperbot
Jan 01 2016 04:21
wolfhound921 sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
:star: 266 | @3chordme | http://www.freecodecamp.com/3chordme
David Collins Moore
@3chordme
Jan 01 2016 04:22
:) you can do it!
Pawan
@pawan92
Jan 01 2016 04:27
question on the Waypoint: Replacing If Else Chains with Switch. they need 4 break statements but then i cant meet the last 2 requirments..any ideas
Brian
@sludge256
Jan 01 2016 04:31
@pawan92 If you post your code I can try to troubleshoot it
Jason Watkins
@jasonwatkins
Jan 01 2016 04:31
@pawan92 make sure you have breaks on all but the final one
Pawan
@pawan92
Jan 01 2016 04:32

function myTest(val) {
var answer = "";
// Only change code below this line

switch (val) {
case "bob":
answer = "Marley";
break;
case 42:
answer = "The Answer";
break;
case 1:
answer = "There is no #1";
break;
case 99:
answer = "Missed me by this much!";
break;
default:
answer = "Ate Nine";

}
// Only change code above this line
return answer;
}

// Change this value to test
myTest(156);

@jasonwatkins thats what i did but it doesnt meet the last 2 requirments
@sludge256
Jason Watkins
@jasonwatkins
Jan 01 2016 04:32
@wolfhound921 it was just like the switches from the exercise just a couple before that one
daxkrishna
@daxkrishna
Jan 01 2016 04:35
guys, is there a way to reset all the code in a section? like Basic Javascript and functional programming seems to have new lessons
i want to start over with these both, is there a way to erase completed waypoints and start these again?
Kyle Kinzalow
@KyleKinz
Jan 01 2016 04:38
Ok so I know the basics of how to write and use objects, but this lesson isn't clear to me http://www.freecodecamp.com/challenges/waypoint-using-objects-for-lookups
Kris Gesling
@krisgesling
Jan 01 2016 04:40
Anyone done Stand in Line?
Trying to figure out why I can't use splice(0,1) instead of shift() as shown below. The shift() version passes but changing to the commented out splice() version won't pass. Is this a bug or am I not seeing something?
function queue(arr, item) {
  // Your code here
  arr.push(item);
  //item = arr.splice(0,1);
  item = arr.shift();
  return item;
}
@KyleKinz does the alphabet reverse lookup example make sense?
Kyle Kinzalow
@KyleKinz
Jan 01 2016 04:43
not it exactly. it doesn't explain how or where it's calling
well the example is just an object and they're calling key values
but the problem has the function and it says not to touch it
and it's using return to call the answer for the problem
Roshan Ghadamian
@RGhadamian
Jan 01 2016 04:44
Who has done the bonfire falsey bouncer?
I don’t seem to be able to get my filter function to work
just trying to use it simply on an array but it’s not working
and not sure how i’m using it incorrectly?
h4r1m4u
@h4r1m4u
Jan 01 2016 04:46
@KyleKinz the splice version should work. i suspect that the waypoint tests for the presence of the shift method as that's the material that's presented in the waypoints.
Pawan
@pawan92
Jan 01 2016 04:47
so anyone gonna help me out
Kyle Kinzalow
@KyleKinz
Jan 01 2016 04:47
did you tag the wrong person?
h4r1m4u
@h4r1m4u
Jan 01 2016 04:47
@KyleKinz yeah, i did, my bad
Kyle Kinzalow
@KyleKinz
Jan 01 2016 04:47
;P
h4r1m4u
@h4r1m4u
Jan 01 2016 04:47
@krisgesling the comment above about splice is for you
Kris Gesling
@krisgesling
Jan 01 2016 04:48
@h4r1m4u thanks, maybe ill log a bug for it
CamperBot
@camperbot
Jan 01 2016 04:48
krisgesling sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1205 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Jan 01 2016 04:48
:thumbsup:
Roshan Ghadamian
@RGhadamian
Jan 01 2016 04:50
anyone know how to use a filter() function correctly on an array?
I can’t seem to get mine to work
h4r1m4u
@h4r1m4u
Jan 01 2016 04:51
@KyleKinz as for your problem, you don't need to change the return statement. you just need to store the right value in the resultvariable, which is then returned by the return
so your task is to put together the lookup object (instead of the if/else statements) and then get the right val out of it
Kris Gesling
@krisgesling
Jan 01 2016 04:52
@KyleKinz i just hit the same wall, but realised I was missing the calls below the alphabet example
Brian
@sludge256
Jan 01 2016 04:53
@pawan92 Sorry I was busy
so with your code
You do not need the default
make a case for 7
it does not need the break so you will still be at 4
Leonardo Prates
@odran037
Jan 01 2016 04:54

Hello! Has anyone completed Waypoint #51? (waypoint: Local Scope and Functions Incomplete)

function myFunction() {
  var myVar = 3;
  console.log(myVar);
}
myFunction();

// run and check the console 
// myVar is not defined outside of myFunction

//  console.log(myVar);

// now remove the console.log line to pass the test

Shouldn’t this pass? Or am I missing something?

Brian
@sludge256
Jan 01 2016 04:55
max stack error?
are those comments in your actual code?
Leonardo Prates
@odran037
Jan 01 2016 04:56
Its part of the waypoint.
Kenston
@kdrye72
Jan 01 2016 04:56
working Waypoint #39 could use a second set of eyes.
Leonardo Prates
@odran037
Jan 01 2016 04:57
I commented out the console.log per the instructions
Pawan
@pawan92
Jan 01 2016 04:57
@sludge256 ohhh got it thanks
CamperBot
@camperbot
Jan 01 2016 04:57
pawan92 sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 453 | @sludge256 | http://www.freecodecamp.com/sludge256
Darius
@ensyde
Jan 01 2016 04:57
Waypoint: Returning Boolean Values from Functions
i get both to return true
but it still won't complete
Kris Gesling
@krisgesling
Jan 01 2016 04:57
@odran037 you have to delete the comment below that console.log too - it's been logged as a bug already
Brian
@sludge256
Jan 01 2016 04:57
@pawan92 since the str is = "" at the top
and the last two tests do not match any cases
h4r1m4u
@h4r1m4u
Jan 01 2016 04:57

@RGhadamian you may want to check the documentation page for .filter(), but the way it works in a nutshell is that you call it on an array, it iterates over every element in the array and returns an array of the elements for which the callback function evaluates to true. for example:

var result = someArray.filter(function(element) {
 return element.length > 3; 
});

in this example, i'm calling the filter on a someArray array and saving the result into result. the result array will contain elements from the original array whose length is larger than 3

Brian
@sludge256
Jan 01 2016 04:58
it will return the ""
Kenston
@kdrye72
Jan 01 2016 04:58
Your form element should have the background-color of green.
Leonardo Prates
@odran037
Jan 01 2016 04:58
@krisgesling perfect thank you!
CamperBot
@camperbot
Jan 01 2016 04:58
odran037 sends brownie points to @krisgesling :sparkles: :thumbsup: :sparkles:
:star: 336 | @krisgesling | http://www.freecodecamp.com/krisgesling
Kyle Kinzalow
@KyleKinz
Jan 01 2016 04:58
// Setup
function phoneticLookup(val) {
  var result = "";

  // Only change code below this line
  lookup = {

    alpha: "Adams",
    bravo: "Boston",
    charlie: "Chicago",
    delta: "Denver",
    echo: "Easy",
    foxtrot: "Frank"
  };


  // Only change code above this line
  return result;
}
this is as far as I've gotten. I can't figure out where (val) comes into play at all
Brian
@sludge256
Jan 01 2016 04:58
@odran037 Maybe try deleting the console.log comment line. I believe that waypoint was bugged at one point
Roshan Ghadamian
@RGhadamian
Jan 01 2016 04:58
@h4r1m4u thx, the part I don’t get is calling a function as part of the filter
CamperBot
@camperbot
Jan 01 2016 04:58
rghadamian sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1206 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Brian
@sludge256
Jan 01 2016 04:59
but I haven't read the instructions yet so hold on:P
mmm the chat lag
h4r1m4u
@h4r1m4u
Jan 01 2016 05:00
@RGhadamian that's the callback function. its argument is the current element of the array (as the filter iterates over it) and it needs to resolve to true or false, so that the filter knows whether to keep that element in the result or discard it
Kyle Kinzalow
@KyleKinz
Jan 01 2016 05:00
also, I should make those keys strings shouldn't I?
h4r1m4u
@h4r1m4u
Jan 01 2016 05:01
@KyleKinz now you just need to get the value from the lookup object: lookup[val]
and no, the keys dont' need to be strings, unless they have some special characters or blank spaces in them
Kyle Kinzalow
@KyleKinz
Jan 01 2016 05:01
well one of them was called echo
wouldn't that be an issue?
Roshan Ghadamian
@RGhadamian
Jan 01 2016 05:02
@h4r1m4u so taking it step by step the function is getting the “array” applying the filter using a function with a parameter element and only returning information in the array that is greater that 3?
h4r1m4u
@h4r1m4u
Jan 01 2016 05:04
@RGhadamian in my example, the filter takes every element from someArray and applies the callback function to it (which returns true if the element's length is larger than 3 and to false if it's not). if the callback resolves to true, the element will be kept, otherwise it will be discarded
Roshan Ghadamian
@RGhadamian
Jan 01 2016 05:05
sure I’m just trying to apply it to my array and it is just coming up as undefined...
@h4r1m4u
h4r1m4u
@h4r1m4u
Jan 01 2016 05:07
i'm guessing you're doing something wrong then. have a look at the example again and try to modify it for your particular user case (i'm assuming your variables are called something else and you'll probably be testing for a different condition)
i need to step out for lunch now, unfortunately, but if you still can't figure it out, leave me a message and i'll get back to you when i come back
Roshan Ghadamian
@RGhadamian
Jan 01 2016 05:08
ok
thx
enjoy your lunch
David Collins Moore
@3chordme
Jan 01 2016 05:08
Has anyone completed Waypoint: Record Collection? Does not make sense to me
Kyle Kinzalow
@KyleKinz
Jan 01 2016 05:09
thanks @h4m
CamperBot
@camperbot
Jan 01 2016 05:09
kylekinz sends brownie points to @h4m :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for h4m
Kyle Kinzalow
@KyleKinz
Jan 01 2016 05:09
thanks @h4r1m4u
CamperBot
@camperbot
Jan 01 2016 05:09
kylekinz sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1207 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
David Collins Moore
@3chordme
Jan 01 2016 05:11
oh nvm! figured it out
wow that was a dumb one
Darius
@ensyde
Jan 01 2016 05:12
has anyone had trouble with Waypoint: Returning Boolean Values from Functions?
it returns true for both requirements but still doesnt complete
Roshan Ghadamian
@RGhadamian
Jan 01 2016 05:12
can someone explain what this function is doing for me:
function(value) {
if (value) { return true; }
});
specifically the if statement. it is just value
there’s not comparator so what is it doing?
David Collins Moore
@3chordme
Jan 01 2016 05:15
@ensyde can you post your code?
Roshan Ghadamian
@RGhadamian
Jan 01 2016 05:15
@3chordme can you explain the above ^^
?
David Collins Moore
@3chordme
Jan 01 2016 05:16
ah yes
so when you use a comparison operator, it evaluates to either true or false, right?
if (n > 10) { /*if statement evaluates to true, this happens*/ }
Roshan Ghadamian
@RGhadamian
Jan 01 2016 05:17
yup
so what if there is no comparator?
Darius
@ensyde
Jan 01 2016 05:17

function isLess(a, b) {
// Fix this code
return a !== b;
}

// Change these values to test
isLess(10, 15);

David Collins Moore
@3chordme
Jan 01 2016 05:19
@RGhadamian well in javascript, certain things are considered true or false other than Booleans, and we refer to these as truthy or falsey. Basically everything is true other than undefined null 0 um...can't remember google it! but the idea is if value doesn't exist, then your statement evaluates to false. But if value DOES exist, then it evaluates to true.
Allan Von Schenkel
@solobass
Jan 01 2016 05:19
I'm working on Assignment with a Returned Value
David Collins Moore
@3chordme
Jan 01 2016 05:19
if (undefined) { this won't happen }
make sense?
Allan Von Schenkel
@solobass
Jan 01 2016 05:19

var processed = 0;

function process(num) {
return (num + 3) / 5;
}

I am entering

var processed = 2;

function process(num) {
return (num + 7);
}

Any ideas what I am doing wrong?
David Collins Moore
@3chordme
Jan 01 2016 05:20
@ensyde this will return true if a does not equal b. you need a statement that returns true if one is LESS THAN the other.
Darius
@ensyde
Jan 01 2016 05:21
w/o using switch or if statement?
Allan Von Schenkel
@solobass
Jan 01 2016 05:21
Basic JS #54
Lynn
@eades001
Jan 01 2016 05:21
@RGhadamian "if (value)" tests that value is something other than 0 or null.
David Collins Moore
@3chordme
Jan 01 2016 05:21
@ensyde correct. if you put return a < b then you will return true if a is less than b and false if a is greater than or equal to b.
Roshan Ghadamian
@RGhadamian
Jan 01 2016 05:22
thanx @eades001 @3chordme
CamperBot
@camperbot
Jan 01 2016 05:22
rghadamian sends brownie points to @eades001 and @3chordme :sparkles: :thumbsup: :sparkles:
:star: 269 | @3chordme | http://www.freecodecamp.com/3chordme
:star: 228 | @eades001 | http://www.freecodecamp.com/eades001
Darius
@ensyde
Jan 01 2016 05:22
right and i did that and it still didnt complete
David Collins Moore
@3chordme
Jan 01 2016 05:22
Your code said !==
Can you post new code?
Darius
@ensyde
Jan 01 2016 05:22
wow
nvm
David Collins Moore
@3chordme
Jan 01 2016 05:22
@solobass you only need to write ```processed = process(7);
Darius
@ensyde
Jan 01 2016 05:22
it worked
David Collins Moore
@3chordme
Jan 01 2016 05:23
@ensyde yay!
Darius
@ensyde
Jan 01 2016 05:23
i swear i did a < b
Roshan Ghadamian
@RGhadamian
Jan 01 2016 05:23
so the next part of the function { return true } means that it just keeps the values that are truthy values @3chordme….if so how do you do it you want to get falsey values?
Darius
@ensyde
Jan 01 2016 05:23
to begin with
David Collins Moore
@3chordme
Jan 01 2016 05:23
@ensyde sometimes it is just weird
@RGhadamian not sure I understand :/
Darius
@ensyde
Jan 01 2016 05:24
@3chordme thanks
CamperBot
@camperbot
Jan 01 2016 05:24
ensyde sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
:star: 270 | @3chordme | http://www.freecodecamp.com/3chordme
David Collins Moore
@3chordme
Jan 01 2016 05:24
np :)
Allan Von Schenkel
@solobass
Jan 01 2016 05:24
@3chordme .. Thanks. I tried that earlier but w/o the 7 and it didn;t run. Thanks for helping!
CamperBot
@camperbot
Jan 01 2016 05:24
solobass sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
:star: 271 | @3chordme | http://www.freecodecamp.com/3chordme
Roshan Ghadamian
@RGhadamian
Jan 01 2016 05:24
@3chordme code: arr = arr.filter(function(value) {
if (value) { return true; }
});
David Collins Moore
@3chordme
Jan 01 2016 05:24
@solobass for sure!
Roshan Ghadamian
@RGhadamian
Jan 01 2016 05:24
{ return true; } part of teh function means that only ‘truthy’ values are returned yes?
David Collins Moore
@3chordme
Jan 01 2016 05:25
oh I think I see. so with filter it will keep all values that the function evaluates to true for. This code you have says "if value exists, return true, therefore keep value" which basically does nothing but makes an array of values that exist in the original array.
Other than null, undefined, and I believe 0? not sure
What values are you trying to keep? Or get rid of?
Roshan Ghadamian
@RGhadamian
Jan 01 2016 05:26
yeah sure, so if i wanted it to keep all the ‘falsey’ values, how would i write it?
Marc Fogleman
@MFogleman
Jan 01 2016 05:26
Waypoint: Record Collection
Roshan Ghadamian
@RGhadamian
Jan 01 2016 05:26
@3chordme this is just for my understanding because I can pass the test with the code i have
I’m just trying to understand it
my brain is mush
David Collins Moore
@3chordme
Jan 01 2016 05:27
You could write
falseyArray = originalArray.filter(function(val, ind, arr) { !value; });
! makes the expression evaluate to the opposite of its truthy/falsey value
so this code says "I want my falsey array to be composed of my original array, but only keep values where (they are not) truthy"
where the ! is the (they are not) part
Roshan Ghadamian
@RGhadamian
Jan 01 2016 05:29
@3chordme awesome - i kept trying to do comparators !=== so much better now thanks
CamperBot
@camperbot
Jan 01 2016 05:29
rghadamian sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
:warning: rghadamian already gave 3chordme points
Marc Fogleman
@MFogleman
Jan 01 2016 05:29
Waypoint: Record Collection
@camperbot Waypoint: Record Collection
David Collins Moore
@3chordme
Jan 01 2016 05:29
fo sho!
Pranav Doshi
@pranavdoshi
Jan 01 2016 05:30
Gm guys happie new year
David Collins Moore
@3chordme
Jan 01 2016 05:30
happy new year!
Akshdeep singh rajawat
@akshdeep996
Jan 01 2016 05:33
happy new year!!
where am i wrong ? waypoint : word blank
i am not able to pass the 2nd part of the map which says
"wordBlanks("","","","") should return at least 30 characters with empty inputs "
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
     // Your code below this line
    var result = myAdjective + " " + myNoun + " " + myVerb + " " + myAdverb + " ";

    // Your code above this line
  return result;
}

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");
David Collins Moore
@3chordme
Jan 01 2016 05:36
@sandeep96 Add a random 30 character string on the front of that and you are set.
It's a dumb requirement. Lots of people confused on this one.
Craig C.
@cjc402
Jan 01 2016 05:36
I am sorry to bother...but I am such a newb to programming of any sort. I thought I was doing okay on the waypoints until I got to converting celsius to Farenheit...and I draw a complete blank. I have been reading JS sites about how to code something like it...but I feel like it is sorta cheating...any advice how to approach this?
Akshdeep singh rajawat
@akshdeep996
Jan 01 2016 05:37
@3chordme thanks a ton !!!
CamperBot
@camperbot
Jan 01 2016 05:37
sandeep96 sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
:star: 273 | @3chordme | http://www.freecodecamp.com/3chordme
David Collins Moore
@3chordme
Jan 01 2016 05:37
@cjc402 No worries! I believe the formula for conversion is fahrenheit = 5/9 * celsius + 32, does that help at all?
let me double check that
Craig C.
@cjc402
Jan 01 2016 05:38
The waypoint gives the formula. It's the coding part. For some reason I don't get how to construct it. :(
David Collins Moore
@3chordme
Jan 01 2016 05:38
Oh oops, okay show me what you have so far
@sandeep96 no problem :)
Craig C.
@cjc402
Jan 01 2016 05:40
I just have the c to f formula..9/5, plus 32... that is it. I have gone back and did all the waypoints over from the start in the JS section...I have done them a few times...and for some reason I am missing the logical transition to do this problem. :(
David Collins Moore
@3chordme
Jan 01 2016 05:40
@cjc402 it should look like this var fahrenheit = 9/5*celsius + 32;
does that code make sense?
Akshdeep singh rajawat
@akshdeep996
Jan 01 2016 05:41
@cjc402
function convert(celsius) {
  // Only change code below this line

var fahrenheit = celsius * (9/5) + 32; 

  // Only change code above this line
  if ( typeof fahrenheit !== 'undefined' ) {
  return fahrenheit;
  } else {
    return 'fahrenheit not defined';
  }
}

// Change the inputs below to test your code
convert(30);
Craig C.
@cjc402
Jan 01 2016 05:41
@3chordme I did try the var fahrenheit 9/5 plus 32 ...didn't work..gave a wrong number and only even worked for convert (0)
@sandeep96 yep..that is exactly what I did..
David Collins Moore
@3chordme
Jan 01 2016 05:41
Hmm you may need to refresh then, that is the correct code
Sometimes you get an error randomly, refreshing can fix it
Akshdeep singh rajawat
@akshdeep996
Jan 01 2016 05:41
@cjc402 can u show me ur code;
?
David Collins Moore
@3chordme
Jan 01 2016 05:42
To paste code in chat, insert it between two sets of ```
Craig C.
@cjc402
Jan 01 2016 05:42
Okays...thanks. It works now..and I saw what I did wrong
David Collins Moore
@3chordme
Jan 01 2016 05:42
great!
Akshdeep singh rajawat
@akshdeep996
Jan 01 2016 05:42
@cjc402 :+1:
David Collins Moore
@3chordme
Jan 01 2016 05:43
and never feel bad about asking questions, we're all here to help and learn
Craig C.
@cjc402
Jan 01 2016 05:43
:( I have worked on that thing for 24 hours.
David Collins Moore
@3chordme
Jan 01 2016 05:43
oh no! well then congrats on your first really annoying bug :D
Akshdeep singh rajawat
@akshdeep996
Jan 01 2016 05:44
@cjc402 sometimes u need a refreshment!!
David Collins Moore
@3chordme
Jan 01 2016 05:44
haha so true! snacks + coding = good
Craig C.
@cjc402
Jan 01 2016 05:44
I despise not being able to parse something out on my own. :(
Nerando Johnson
@nerajno
Jan 01 2016 05:45
Happy New YEAR FROM THE atl
David Collins Moore
@3chordme
Jan 01 2016 05:45
happy noob beer!
Akshdeep singh rajawat
@akshdeep996
Jan 01 2016 05:45
@nerajno happy new year !!!
@3chordme happy new year!!
Sarvesh kumar
@SarveshGupta1234
Jan 01 2016 05:47
Happ New Year Friend
Darius
@ensyde
Jan 01 2016 05:48
@3chordme happy late near yea
Brian Giles
@briangiles
Jan 01 2016 05:48
Happy New Year!
Engr-Rafia
@Engr-Rafia
Jan 01 2016 05:49
Happy New Year :)
Pawan
@pawan92
Jan 01 2016 05:52
wow guess most of us are on the east coast lol
Kyle Kinzalow
@KyleKinz
Jan 01 2016 05:57
yep this is my new year
i want a newwww job so it's worth it
Alec
@itsalbow
Jan 01 2016 05:58
Hey happy new year FCC!!!
Jesus Vega
@ParagonChuy
Jan 01 2016 05:59
card counting anyone?
Alec
@itsalbow
Jan 01 2016 06:00
sounds corny and crap but remember, don't hope for a good year, make it a good year!
Kenston
@kdrye72
Jan 01 2016 06:00
 .#cat-photo-element {

      background-color: green;
   }

</style>

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

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

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back" 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>
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:00
@ParagonChuy what about it
Jesus Vega
@ParagonChuy
Jan 01 2016 06:01
have you guys done it?
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:01
I have
I'm sure others have as well
Kenston
@kdrye72
Jan 01 2016 06:02
working Waypoint #37 cant find my mistake.
escapeplan4
@escapeplan4
Jan 01 2016 06:02
happy New Year and I've got a question about that new Word Blanks chaleng. I don't get it
Jesus Vega
@ParagonChuy
Jan 01 2016 06:02
From what i am understanding. I'm writing a bunch of if statements where i decrement/increment the count
Marc Fogleman
@MFogleman
Jan 01 2016 06:02
Question on Waypoint: Caesars Cipher. Was there a simple way to do it than creating an entire dictioanry of A:N, B:O, C:P etc etc etc? I got it to work, but i was wondering if there was a simpler way I was missing.
Brian Giles
@briangiles
Jan 01 2016 06:02
@kdrye72 what's the challenge?
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:02
nope, you do it with a single if/else
Herman Fassett
@HermanFassett
Jan 01 2016 06:02
@CangosGit you can use charCodes
Marc Fogleman
@MFogleman
Jan 01 2016 06:02
Paragon, I used a case switch
Kenston
@kdrye72
Jan 01 2016 06:02
this is the challenge Your form element should have the background-color of green.
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:02
@ParagonChuy you can use || in your loops, don't forget that
Jesus Vega
@ParagonChuy
Jan 01 2016 06:03
okay
Marc Fogleman
@MFogleman
Jan 01 2016 06:03
@ParagonChuy if you remember earlier, they did a thing about cases on a switch falling through if you dont break.
Kenston
@kdrye72
Jan 01 2016 06:03
@briangiles Your form element should have the background-color of green.
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:03
it might not have been if/else though, let me check the problem
@ParagonChuy yeah you can do it as a switch if that's easier for you
Kenston
@kdrye72
Jan 01 2016 06:04
@briangiles im sure its something simple, but I just cant see it
Jesus Vega
@ParagonChuy
Jan 01 2016 06:04
okay thanks
Brian Giles
@briangiles
Jan 01 2016 06:04
@kdrye72 what number?
Kenston
@kdrye72
Jan 01 2016 06:04
#37
Brian Giles
@briangiles
Jan 01 2016 06:04
@kdrye72 stand by
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:05
@ParagonChuy I think it was if/else if
Brian Giles
@briangiles
Jan 01 2016 06:05
@kdrye72 The example says to make it green. The challenge is Gray :P
Jesus Vega
@ParagonChuy
Jan 01 2016 06:05
I'm still not entirely sure
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:05
i'll give you the first part and see if you can figure out the 2nd
Jesus Vega
@ParagonChuy
Jan 01 2016 06:05
sounds good
David Collins Moore
@3chordme
Jan 01 2016 06:06
@CangosGit yes, for anything after m, subtract 13
I think it was m. Something like that.
Lynn
@eades001
Jan 01 2016 06:06
@CangosGit I converted each char to ascii and tested it. Added 13 to ascii value if value was 65-77. Subtracted 13 if ascii value was 78-90. Then converted back to a char.
David Collins Moore
@3chordme
Jan 01 2016 06:06
^
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:07
if (card>1 && card<7) {
    count++;
} else if ( ) {
        count--;
}
you also need an if/else to return the count + " Bet" or count + " Hold"
Elifaz Filho
@elifaz25
Jan 01 2016 06:07
any ideas on how to solve this one
// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function update(id, prop, value) {

    if(value !== "") {
      collection[id][prop] = value;
      if (value === "tracks")
        collection[id].tracks.push(value);
    }
    else if (value === "")
      delete collection[id][prop];


  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");
David Collins Moore
@3chordme
Jan 01 2016 06:07
Small point, no need for card>1 because cards are only positive and 2 or greater, so card<7 will suffice
Marc Fogleman
@MFogleman
Jan 01 2016 06:08
@KyleKinz , you dont need the }else if () { you can just do else{}
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:08
@CangosGit there's supposed to be more code in the else if
Elifaz Filho
@elifaz25
Jan 01 2016 06:08
This is Record Collection
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:08
I didn't want to spoil the entire answer
Marc Fogleman
@MFogleman
Jan 01 2016 06:09
Oh, gotcha
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:09
@3chordme I guess I just did it like that in case someone typed the number 1 in error
not like the program will ever be used, lol..
Elifaz Filho
@elifaz25
Jan 01 2016 06:09
Guys did anyone went through the Record Collection Waypoint yet? I can’t get pass this thing no matter what…
David Collins Moore
@3chordme
Jan 01 2016 06:09
@elifaz25 ugh I hated these instructions. One sec.
Marc Fogleman
@MFogleman
Jan 01 2016 06:09
@elifaz25 remember bracket notation from the previous object lessons? Use that, dont use dot notation. that will solve most of your problems
It is a confusingly worded problem.
Elifaz Filho
@elifaz25
Jan 01 2016 06:10
@CangosGit you meant on ”tracks” right? I’ve changed that and nothing worked
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:11
```
if (card<7) {
    count++;
} else if (put arguments here ) {
     count--;
}
```
@ParagonChuy here is a better example so you know what to fill in
David Collins Moore
@3chordme
Jan 01 2016 06:11
@elifaz25 I'm just going to give you the answer because I hated that question so much.
if (value !== "") {
    collection[id][prop] = value;
  }
  if (prop === "tracks" && value !== "") {
    collection[id][prop] = [value];
  }
  if (value === "") {
    delete collection[id][prop];
  }
Kenston
@kdrye72
Jan 01 2016 06:11
@briangiles sorry thats #39
Elifaz Filho
@elifaz25
Jan 01 2016 06:11
@3chordme this was a pretty hard one...
so I missed the brackets on the value? thats it?
David Collins Moore
@3chordme
Jan 01 2016 06:12
Do you understand the code? That's the important part. Tell me if you have questions.
Marc Fogleman
@MFogleman
Jan 01 2016 06:12
elia, you were close
I think you called the wrong thing in one line, you called tracks directly, which messes up certain test cases, isntead of props
Elifaz Filho
@elifaz25
Jan 01 2016 06:12
@3chordme @CangosGit let me go through this I can see some other things that I missed on this
David Collins Moore
@3chordme
Jan 01 2016 06:12
Yeah, you were very close. The second if statement was your problem
Brian Giles
@briangiles
Jan 01 2016 06:12
@kdrye72 ```
@kdrye72
 #cat-photo-form {
    background-color: green;
  }
</style>
Lynn
@eades001
Jan 01 2016 06:13
@3chordme @CangosGit I think 'value' was being tested for "tracks" rather than "props".
escapeplan4
@escapeplan4
Jan 01 2016 06:13
what's wrong whith this code : result=myNoun ;
result+=" "+myAdjective;
result+=" "+myVerb;
result+=" "+myAdverb;
Brian Giles
@briangiles
Jan 01 2016 06:13
@kdrye72 remove the period
Kenston
@kdrye72
Jan 01 2016 06:14
@briangiles I did still nothing
Brian Giles
@briangiles
Jan 01 2016 06:14
@kdrye72 also
<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>
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:15
var myPlants = [
  { 
    type: "flowers",
    list: [
      "rose",
      "tulip",
      "dandelion"
    ]
  },
  {
    type: "trees",
    list: [
      "fir",
      "pine",
      "birch"
    ]
  }  
];
how can I acces pine? I've tried
myPlants.type.trees.list1, myPlants.trees.list1, myPlants.trees1, not sure what I'm missing
er put brackets around those "1"s [ ]
Marc Fogleman
@MFogleman
Jan 01 2016 06:15
you know you want myplants
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:15
mhmm
Lynn
@eades001
Jan 01 2016 06:16
Its an array. Access by index first.
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:16
so
Marc Fogleman
@MFogleman
Jan 01 2016 06:16
Kyle, do you know about the console?
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:16
testing something - 1
[1]
ok had to escape
Marc Fogleman
@MFogleman
Jan 01 2016 06:16
hit f12. that will open up your dev console in firefox and chrome
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:16
ah yeah I should check that before asking eh
Marc Fogleman
@MFogleman
Jan 01 2016 06:17
you can then type console.log(myPlants[0]); and it will evaluate that and put it in your log
Brian Giles
@briangiles
Jan 01 2016 06:17
@kdrye72
<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" alt="A cute orange cat lying on its back" 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>
Marc Fogleman
@MFogleman
Jan 01 2016 06:17
find out what myPlants[1] evaluates as, then go from there.
CamperBot
@camperbot
Jan 01 2016 06:17
find out what myplants1 evaluates as then go from there
nothing found
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:17
will it show me the same message that I see on the bottom left? under reset/help/bug
it seems it does
Marc Fogleman
@MFogleman
Jan 01 2016 06:17
sometimes., depends on how the waypoint is set up
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:18
ok thanks, good to know
Marc Fogleman
@MFogleman
Jan 01 2016 06:18
but console log will be helpful later on when youre building your own stuff in codepen
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:18
cool
Elifaz Filho
@elifaz25
Jan 01 2016 06:18
@3chordme @CangosGit I see it, I was making so many changes that I left behind the Value assigned to the prop, but my biggest mistake was assigning the value without the brackets. I will go through this path again to make sure I understood. Thanks guys
CamperBot
@camperbot
Jan 01 2016 06:18
elifaz25 sends brownie points to @3chordme and @cangosgit :sparkles: :thumbsup: :sparkles:
:star: 274 | @3chordme | http://www.freecodecamp.com/3chordme
:star: 272 | @cangosgit | http://www.freecodecamp.com/cangosgit
Brian Giles
@briangiles
Jan 01 2016 06:18
function myFunction() {
  var myVar = "foo";
  console.log(myVar);
}
myFunction();

// run and check the console 
// myVar is not defined outside of myFunction
console.log(myVar);

// now remove the console.log line to pass the test
What am I doing wrong here?
escapeplan4
@escapeplan4
Jan 01 2016 06:18
I can't upload printscrin :worried: and still don't know what's wrong whith this code from word blanks result=myNoun ;
result+=" "+myAdjective;
result+=" "+myVerb;
result+=" "+myAdverb;
Marc Fogleman
@MFogleman
Jan 01 2016 06:19
brian, thats a dumb one. remove both the console.log lines and I think it will work
Brian Giles
@briangiles
Jan 01 2016 06:19
If I remove the console.log(myVar); I still don’t paas
Marc Fogleman
@MFogleman
Jan 01 2016 06:19
remove both, I think its a bug in the question
Brian Giles
@briangiles
Jan 01 2016 06:19
@CangosGit both… aahhh Thanks~!
CamperBot
@camperbot
Jan 01 2016 06:19
briangiles sends brownie points to @cangosgit :sparkles: :thumbsup: :sparkles:
:star: 273 | @cangosgit | http://www.freecodecamp.com/cangosgit
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:19
@CangosGit thank you
CamperBot
@camperbot
Jan 01 2016 06:19
kylekinz sends brownie points to @cangosgit :sparkles: :thumbsup: :sparkles:
:star: 274 | @cangosgit | http://www.freecodecamp.com/cangosgit
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:20
worked out wonderfully and logically
Marc Fogleman
@MFogleman
Jan 01 2016 06:20
escape plan, thats another poorly worded one, you have to have a long empty string in it I think, like " "
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:22
did anyone find it strange how brief the first jQuery section was? I did it yesterday and it was so brief and out of context that I can't even remember any of it
Elifaz Filho
@elifaz25
Jan 01 2016 06:22
I’m reading a book to complement jQuery from here..
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:22
i remember $("#class")
Marc Fogleman
@MFogleman
Jan 01 2016 06:22
Kyle, yes.
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:22
er #id
Marc Fogleman
@MFogleman
Jan 01 2016 06:22
I forgot about it entirely
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:22
.>
escapeplan4
@escapeplan4
Jan 01 2016 06:23
@CangosGit eee I don't get it I mean I put spaces i so what's wrong?
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:23
oh man the escaping messes up my faces
ecahua
@ecahua
Jan 01 2016 06:23
whats a good book to compliment
Marc Fogleman
@MFogleman
Jan 01 2016 06:23
When I started the 'build your own site' stuff, I forgot about it 100%, and used pure JS for everything.
Akshdeep singh rajawat
@akshdeep996
Jan 01 2016 06:23
@KyleKinz yeah :+1:
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:23
lol good to know I'm not alone
I have javascript and jQuery by... michael douglas? i dunno lemme check
Marc Fogleman
@MFogleman
Jan 01 2016 06:23
escape, copy and paste your code between ``` code goes here ```
Elifaz Filho
@elifaz25
Jan 01 2016 06:23
@ecahua This one I’m reading so far I found really good it’s called Javascript & jQuery by Jon Duckett
ecahua
@ecahua
Jan 01 2016 06:23
FCC is live online right now on twitch btw
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:23
by jon duckett yeah
that's it
Akshdeep singh rajawat
@akshdeep996
Jan 01 2016 06:23
@sandeep96 i thought i was the only one
Elifaz Filho
@elifaz25
Jan 01 2016 06:24
@KyleKinz hahah, yeah same book ahhaha
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:24
amazing visual-enhanced book
Elifaz Filho
@elifaz25
Jan 01 2016 06:24
yes, astonishing, only bad is that if you don’t have the hard cover the book will fall appart easily
Kenston
@kdrye72
Jan 01 2016 06:24
@briangiles thanks so much. ```
CamperBot
@camperbot
Jan 01 2016 06:24
kdrye72 sends brownie points to @briangiles :sparkles: :thumbsup: :sparkles:
:star: 196 | @briangiles | http://www.freecodecamp.com/briangiles
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:25
yeah the pages are so thick and heavy that I can see how that would happen
Elifaz Filho
@elifaz25
Jan 01 2016 06:25
@KyleKinz too many pages around 640
Kenston
@kdrye72
Jan 01 2016 06:25
#cat-photo-form {
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:25
@elifaz25 I don't recommend reading it front to back
escapeplan4
@escapeplan4
Jan 01 2016 06:25
@CangosGit // Your code below this line
result=myNoun ;
result+=" "+myAdjective;
result+=" "+myVerb;
result+=" "+myAdverb;
// Your code above this line
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:26
javascripIsSexy has a good pathway for learning and it has you pick and choose parts to read in a certain order
Elifaz Filho
@elifaz25
Jan 01 2016 06:26
I just finished reading the other one called HTML & CSS Design and build websites it was good, I tagged all over for when I need to refresh something. @KyleKinz
escapeplan4
@escapeplan4
Jan 01 2016 06:26
This message was deleted
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:26
@elifaz25 yeah I need to buy some of those little highlight tags, lol
Kenston
@kdrye72
Jan 01 2016 06:27
@briangiles in the coding "cat-photo-form. I had the word element instead of form.
Elifaz Filho
@elifaz25
Jan 01 2016 06:27
@KyleKinz I did read skipping through with the HTML & CSS one it was really helpful haven’t done witht he JS & jQuery and found quite hard to remember, so i will do that on this one from now on..
escapeplan4
@escapeplan4
Jan 01 2016 06:28
This message was deleted
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:29
yeah I just read chapters on what I've done recently on here
helps to solidify the information after the waypoints
also helps to see a big breakdown instead of deducing an answer to a problem
Record Collection seems like a doozy
Brian Giles
@briangiles
Jan 01 2016 06:38
@kdrye72 Glad to have helped. :)
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:40
\console.log(collection0);
is returning undefined on a JSON object called collection even though there are 3 objects within the JSON object
oops
console.log(collection[0]);
am I missing something?
I want to be able to access the first object inside of the JSON object
and its properties
Elifaz Filho
@elifaz25
Jan 01 2016 06:43
@KyleKinz collection is an object, so collection[0] should return the first array of the collection variable.
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:44
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
console.log(collection[0]);
returns undefined
Hector Garcia
@augmt
Jan 01 2016 06:44
@KyleKinz collection is an object, not an array
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:45
so how can I call one of the nested objects if I don't know the object's name?
Lynn
@eades001
Jan 01 2016 06:45
@KyleKinz access each record in the collection by the id.
Hector Garcia
@augmt
Jan 01 2016 06:45
you have the keys for each sub-object
2548, 2468, etc.
Lynn
@eades001
Jan 01 2016 06:45
the id is the key
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:46
lemme work on this function and I'll show where it's snagging me
Elifaz Filho
@elifaz25
Jan 01 2016 06:46
@KyleKinz to access a property you can go 2 ways use collection[5235] which is the name of the property or lets say collection.name if there was a property called name...
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:48
ok I think I was just overthinking stuff, working on it for a couple mins here..
Akash Chavan
@CruiseDevice
Jan 01 2016 06:48
happy new year guys. :smile:
Hector Garcia
@augmt
Jan 01 2016 06:49
happy new year :)
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:49
I know I'm messing up really bad here but
Elifaz Filho
@elifaz25
Jan 01 2016 06:49
@KyleKinz all I can tell you is that I wasted a whole afternoon and night on the Record Collection and after them helping me here is that it clicked why I was making a very silly mistake but important at the same time.
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:49
function update(id, prop, value) {
  if (value !== "") {
    collection.id.prop = value;
  }

  return collection;
}
is supposed to do:
"If value is non-blank (value !== ""), then update or set the value for the prop."
Elifaz Filho
@elifaz25
Jan 01 2016 06:49
maybe I should say that I Invested
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:50
but I get the error "TypeError {message: "Cannot set property 'prop' of undefined"}"
Hector Garcia
@augmt
Jan 01 2016 06:50
@KyleKinz collection.id implies collection has a key called id
id is a variable so you'll want to do collection[id] instead
same for prop i believe
Marc Fogleman
@MFogleman
Jan 01 2016 06:51
Im seeing alot of times where dot notation breaks it, and bracket notation doesnt. Is there ever a time when accessing objects that dot notation is functionally better?
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:51
man I almost tried the double brackets
but I talked myself out of it somehow
zzzz
Hector Garcia
@augmt
Jan 01 2016 06:52
@CangosGit i can't think of any situations where dot notation is functionally better
Elifaz Filho
@elifaz25
Jan 01 2016 06:52
@CangosGit maybe changing object values outside a function..?
Hector Garcia
@augmt
Jan 01 2016 06:52
it saves bytes on your file at least :p
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:52
function update(id, prop, value) {
  if (value !== "") {
    collection[id][prop] = value;
  }

  return collection;
}
gives me one green checkmark so here I go
should I be using multiple if statements here though?
Lynn
@eades001
Jan 01 2016 06:53
yes. need to check for "tracks"
or use &&
Kyle Kinzalow
@KyleKinz
Jan 01 2016 06:55
they seem mutually exclusive to be using &&

If value is non-blank (value !== ""), then update or set the value for the prop.

If the prop is "tracks" and value is non-blank, push the value onto the end of the tracks array.

If value is blank, delete that prop.

Lynn
@eades001
Jan 01 2016 06:56
I used a nested if
Kyle Kinzalow
@KyleKinz
Jan 01 2016 07:00
i'm getting into a wormhole here
function update(id, prop, value) {
  if (prop == "tracks" && value !== "") {
    collection[id][prop] = value;
    collection[id][tracks].push(value);
  } 
  return collection;
}
no idea. it's bad though lol
Lynn
@eades001
Jan 01 2016 07:03
you do not want to do both lines of code for prop == tracks and value !== "". You push to the array if the props is tracks else you set the prop to value.
Kyle Kinzalow
@KyleKinz
Jan 01 2016 07:05
oops
Manish Giri
@Manish-Giri
Jan 01 2016 07:06
@KyleKinz here's what I used -
//if value is not empty - 
  //is prop not tracks?
     //then set value
 //else if prop is tracks
    //then use .push()
//if value is empty- 
  //then delete
Kyle Kinzalow
@KyleKinz
Jan 01 2016 07:07
@Manish-Giri thank you
CamperBot
@camperbot
Jan 01 2016 07:07
kylekinz sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star: 554 | @manish-giri | http://www.freecodecamp.com/manish-giri
Kyle Kinzalow
@KyleKinz
Jan 01 2016 07:08
was there a waypoint on nested ifs before this?
I don't remember
Lynn
@eades001
Jan 01 2016 07:09
i don't think so. just else and else if.
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 07:17
I still don't understand why collaborators are against prefix increment/decrement operators in FCC https://github.com/FreeCodeCamp/FreeCodeCamp/issues/5632#issuecomment-168282608 :-1:
Kyle Kinzalow
@KyleKinz
Jan 01 2016 07:19
function update(id, prop, value) {
  if (prop !== "" && prop !== "tracks") {
    collection[id][prop] = value; 
  } else if (value == "tracks") {
    collection[id][prop].push(value);
  } 

  if (value === "") {
    delete collection[id][prop];
  }

}
that's what I ended up with based on your pseudo-code. i did something wrong :(
@Manish-Giri
Hector Garcia
@augmt
Jan 01 2016 07:19
-- and ++ are claimed to be confusing and certain people would recommend -= 1 and += 1
"certain people" include douglas crockford, creator of JSLint, and those who subscribe to his philosophy
Manish Giri
@Manish-Giri
Jan 01 2016 07:21
@KyleKinz
if (value !== "") {
//if value is not empty
  if(prop!=="tracks") {
    //if property is not "tracks", then assign value
       collection[id][prop] = value; 
    }
  } else if (prop === "tracks") {
     //now property is tracks, so use .push()
    collection[id].tracks.push(value);
  } 
}

  else if (value === "") {
   //now value is "" so delete
    delete collection[id][prop];
  }
@KyleKinz I've quickly modified your code to match the pseudo code I gave, can you understand what this code is doing? I've added comments to help you walk through it.
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 07:23
@augmt true but if they are teaching one side of the increment/decrement operators why not complete it by teaching on both prefix and postfix ?
Manish Giri
@Manish-Giri
Jan 01 2016 07:24
@KyleKinz note that some parts could be re-written, like collection[id].tracks.push(value); could be written as collection[id][prop].push(value);, I just used what I remembered from my code
Lynn
@eades001
Jan 01 2016 07:25
@Manish-Giri I wonder if the 'else if's could just be 'else'
Nigel
@nigeljoy
Jan 01 2016 07:25
what does this error mean? maximum call stack size exceeded on stand in line waypoint
Hector Garcia
@augmt
Jan 01 2016 07:25
@Mr-Kumar-Abhishek i don't really know but i think i agree with you in that teaching about these operators is worthwhile.
Manish Giri
@Manish-Giri
Jan 01 2016 07:26
@eades001 yes, of course, I just used else if to help him walk through
Lynn
@eades001
Jan 01 2016 07:26
makes sense
Kyle Kinzalow
@KyleKinz
Jan 01 2016 07:27
@Manish-Giri was afk, checking it out now
@Manish-Giri yeah I understand the code, I just wouldn't have arrived to that setup ever based on the instructions
still thinking through it
Hector Garcia
@augmt
Jan 01 2016 07:30
@Mr-Kumar-Abhishek though i do come from a language where those operators aren't uncommon
Kyle Kinzalow
@KyleKinz
Jan 01 2016 07:31
@Manish-Giri the code isn't passing either :0
Manish Giri
@Manish-Giri
Jan 01 2016 07:32
@KyleKinz post your code
Kyle Kinzalow
@KyleKinz
Jan 01 2016 07:33
function update(id, prop, value) {
if (value !== "") {
//if value is not empty
  if(prop!=="tracks") {
    //if property is not "tracks", then assign value
       collection[id][prop] = value; 
    }
  } else if (prop === "tracks") {
     //now property is tracks, so use .push()
    collection[id].tracks.push(value);
  } 

  else if (value === "") {
   //now value is "" so delete
    delete collection[id][prop];
  }

  return collection;
}
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 07:34
@augmt well , both postfix and prefix should be included , I would make a pull request/issue after I had completed taking all these certificates :hammer:
Lynn
@eades001
Jan 01 2016 07:35
might be an extra } on seventh line down
@KyleKinz ^^
or maybe not
Manish Giri
@Manish-Giri
Jan 01 2016 07:36
@KyleKinz here's mine, check!
function update(id, prop, value) {

    if(value !== "") {
      if(prop === "tracks") {
          (collection[id].tracks).push(value);
         //collection[id][prop].push(value);
      }
      else {
        collection[id][prop] = value;
      }

    }

    else if(value === ""){
      delete collection[id][prop];
    }



  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");
Kyle Kinzalow
@KyleKinz
Jan 01 2016 07:37
that makes more sense
@Manish-Giri thank you
CamperBot
@camperbot
Jan 01 2016 07:37
kylekinz sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:warning: kylekinz already gave manish-giri points
Kyle Kinzalow
@KyleKinz
Jan 01 2016 07:38
@Manish-Giri what's the difference between doing the ifs like that and doing &&?
Abhisek Pattnaik
@abhisekp
Jan 01 2016 07:39
@Mr-Kumar-Abhishek Teaching about everything will be overwhelming. Better to keep the course concise and let the camper explore about the other alternative way of writing it.
The point is to introduce just the basics about JS to keep the camper moving.
Kyle Kinzalow
@KyleKinz
Jan 01 2016 07:40
@Manish-Giri nevermind I think I am good to go
Manish Giri
@Manish-Giri
Jan 01 2016 07:40
@KyleKinz I didn't understand what you were asking
Kyle Kinzalow
@KyleKinz
Jan 01 2016 07:40
@Manish-Giri yeah ignore it, I was overthinking it.
Manish Giri
@Manish-Giri
Jan 01 2016 07:41
cool!
Kyle Kinzalow
@KyleKinz
Jan 01 2016 07:43
thanks a lot for your time
Akash Chavan
@CruiseDevice
Jan 01 2016 07:45
Waypoint: Local Scope and Functions
Waypoint not passing.
Somnath Garai
@garaisomnath
Jan 01 2016 07:46

i need help to solve the following query

One h4 element should have the text #left-well.

Abhisek Pattnaik
@abhisekp
Jan 01 2016 07:46
@CruiseDevice remove the console.log from comment too
Somnath Garai
@garaisomnath
Jan 01 2016 07:47

And the code i tried so far is

<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<h4>
<div class="well" id="left-well">
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
</div>
</h4>
</div>
<div class="col-xs-6">
<h4>
<div class="well" id="right-well">
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
</div>
</h4>
</div>
</div>
</div>

Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 07:47
@abhisekp alright , so then atleast the test should accept prefix decrement/increment operators in order to help explore other alternative way of writing it ?
Akash Chavan
@CruiseDevice
Jan 01 2016 07:47
@abhisekp is that any kind of issue
Indri Dwi Ayu
@indridwiayu
Jan 01 2016 07:47
This message was deleted
Abhisek Pattnaik
@abhisekp
Jan 01 2016 07:47
@Mr-Kumar-Abhishek i think so... :+1:
@CruiseDevice FreeCodeCamp/FreeCodeCamp#5559
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 07:47
@abhisekp precisely
Akash Chavan
@CruiseDevice
Jan 01 2016 07:48
@abhisekp Thanks
CamperBot
@camperbot
Jan 01 2016 07:48
cruisedevice sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 1706 | @abhisekp | http://www.freecodecamp.com/abhisekp
Somnath Garai
@garaisomnath
Jan 01 2016 07:50

One h4 element should have the text #left-well...

I didnt get what I need to do

Lynn
@eades001
Jan 01 2016 07:50
@garaisomnath <h4> #left-well</h4>
which waypoint are you working on?
Somnath Garai
@garaisomnath
Jan 01 2016 07:51
Waypoint: Label Bootstrap Wells
@eades001 It worked!!
Thanks @eades001
CamperBot
@camperbot
Jan 01 2016 07:51
garaisomnath sends brownie points to @eades001 :sparkles: :thumbsup: :sparkles:
:star: 245 | @eades001 | http://www.freecodecamp.com/eades001
Lynn
@eades001
Jan 01 2016 07:51
@garaisomnath nice!
Akash Chavan
@CruiseDevice
Jan 01 2016 07:53
help
CamperBot
@camperbot
Jan 01 2016 07:53

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

Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 07:55
about @Mr-Kumar-Abhishek
CamperBot
@camperbot
Jan 01 2016 07:55
:star: 269 | @mr-kumar-abhishek | http://www.freecodecamp.com/mr-kumar-abhishek
Olawale Akinseye
@brainyfarm
Jan 01 2016 07:55
@CruiseDevice? Help with what?
7386834273
@7386834273
Jan 01 2016 08:01
hwo to access properties of objects
Kyle Kinzalow
@KyleKinz
Jan 01 2016 08:02
myObject.propertyname
myObject["property name with spaces"]
Vickywara
@Vickywara
Jan 01 2016 08:02
There is a button with code like this: <button class="target" id="target3">Button3</button>, I need to add the class(fadeOut) to this button using Jquery to make the button fadeout...how should i do this?
Lynn
@eades001
Jan 01 2016 08:05
@Vickywara I believe you add fadeOut after your target class, separated by a space.
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 08:06
:laughing: did any one else did this ? It already has the solution , I didn't had to do anything , is this a bug ? anyone else found this ?
Abhisek Pattnaik
@abhisekp
Jan 01 2016 08:06
@Mr-Kumar-Abhishek could you try to RESET and see
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 08:06
@abhisekp hold on
Abhisek Pattnaik
@abhisekp
Jan 01 2016 08:07
@Mr-Kumar-Abhishek many existing waypts. were modified
Olawale Akinseye
@brainyfarm
Jan 01 2016 08:07
Is it with animate.css? $("target").addClass("animated fadeOut") @Vickywara :)
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 08:07
@abhisekp Ah.. I see
@abhisekp I have already did this one in the older version
Abhisek Pattnaik
@abhisekp
Jan 01 2016 08:08
@Mr-Kumar-Abhishek yep! So the old code exists.
anthonygallina1
@anthonygallina1
Jan 01 2016 08:09
Wow am I seeing double 2 abhishek
Akash Chavan
@CruiseDevice
Jan 01 2016 08:09
@brainyfarm Just wanted to view camperbot commands.
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 08:09
@anthonygallina1 it is common name :smirk:
Abhisek Pattnaik
@abhisekp
Jan 01 2016 08:13
@anthonygallina1 one of Bollywood celebrity's name is Abhishek too
Abhisek Pattnaik
@abhisekp
Jan 01 2016 08:18
@anthonygallina1 it's Double Trouble for you :D
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 08:39

I must have popped my brains somewhere while managing some people before I did this , what I am doing wrong I don't understand here:

function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for(var i = 0; i < arr.lenght; i++){
    for (var j = 0; j < arr[i].length; j++){
      product *=  arr[i][j];
    }
  }
  // Only change code above this line
  return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);

This is ridiculously simple yet I fail to see what is wrong with it :fire:

Ahh.. got it
nevermind
in-in
@in-in
Jan 01 2016 08:58
I just finished the «Bonfire: Pig Latin». And checked solution from Wiki no solutions is similar to mine. Is my code bad (slow, messy etc)? Should I use regex instead?
function translate(str) {

  var consonant = ["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "x", "z", "w"];

  if (consonant.indexOf(str[0]) === -1) {
    return str + 'way';
  } else {
    var consArr = [];
    for (var i = 0; i < str.length; i++) {
      if (consonant.indexOf(str[i]) === -1) {
        consArr.push(i);
      }
    }
    return str.slice(consArr[0]) + str.slice(0, consArr[0]) + 'ay';
  }

}

translate("consonant");
Ademola Adegbuyi
@ooade
Jan 01 2016 09:02
@SaintPeter ??
Vadali Soumitri
@svadali2
Jan 01 2016 09:03
hey guys i am having huge problems uderstanding regex in javascript
could someone help me out?
for example, if i wrote /[\d]/ what is the purpose of the square brackets here?
if it is of relevance i am using the replace function
@in-in yes your code is just a bit lengthy, we never ever do things like that manually using regex and doing /[a-z}/ etc. would help i suppose
Ademola Adegbuyi
@ooade
Jan 01 2016 09:09
@svadali2 square brackets are used for grouping. let's say we have [A-Za-z0-9] It matches all Uppercase letters, lowercase letters and numbers
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 09:09
@in-in does bonfire solutions needs to be unique (or not unique ) ? I didn't checked the ones I have done are unique or not.
Vadali Soumitri
@svadali2
Jan 01 2016 09:10
@marhyorh so in your example don't you have to write [A-Z a-z 0-9]?
thanks for answering
Mahtab
@RoadToCode822
Jan 01 2016 09:13
I’m stuck in
"Use the playerNumber variable to lookup player 16 in testObj using bracket notation."
The waypoint name is Waypoint: Accessing Objects Properties with Variables
// Setup
var testObj = {
  12: "Namath",
  16: "Montana",
  19: "Unitas"
};

// Only change code below this line;

var playerNumber = testObj[16];       // Change this Line
var player = testObj[16];   // Change this Line
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 09:15
@RoadToCode822 var playerNumber only asks for player's number not its object
Mahtab
@RoadToCode822
Jan 01 2016 09:16
how does it not?
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 09:17
@RoadToCode822 var player object then could be retrieved from var playerNumber
Mahtab
@RoadToCode822
Jan 01 2016 09:17
previously I did testObjt[“name”] to get it
i’m actually confued about what the instruction is asking
"Use the playerNumber variable to lookup player 16 in testObj using bracket notation."
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 01 2016 09:19
@RoadToCode822 instruction is telling you to put player number in player number variable var playerNumber , then it is telling you to use that variable to take out /look up that player .
@RoadToCode822 which could be done in the second line which is asked to be changed
Mahtab
@RoadToCode822
Jan 0