These are chat archives for FreeCodeCamp/Help

7th
Jan 2016
Bill
@kirah1314
Jan 07 2016 00:00
@djmuffy to access object properties using numbers you have to use the bracket notation
Sylvan Swierkosz
@nodatall
Jan 07 2016 00:01
awesome, thanks!
Bill
@kirah1314
Jan 07 2016 00:01
@djmuffy and if you want to test console.log, will have to use dev tools or something like https://repl.it/
Sylvan Swierkosz
@nodatall
Jan 07 2016 00:01
I was doing it in Firebug
Franco Zapata
@Francozt01
Jan 07 2016 00:03
i was stuck there too couldn-t find a way to show what i was trying to select
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 00:05
@alexisreina I tested it. it works great.
YI JIANG
@jennytech
Jan 07 2016 00:08

var count = 0;

function cc(card) {
// Only change code below this line
if (card > 1) {
return "5 bet";
} else if (card === 0) {
return "0 Hold";
} else if (card === -1) {
return "-5 Hold";
} else {
return "-1 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');

Checkpoint: Counting Cards
help
CamperBot
@camperbot
Jan 07 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

YI JIANG
@jennytech
Jan 07 2016 00:08
is this use for loop?
plz thanks
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 00:09
@jennytech try using a switch case statement. it is easier.
Robert Newton
@LVL4WIZ
Jan 07 2016 00:10
@ganeshkmurthy thank you! It worked
CamperBot
@camperbot
Jan 07 2016 00:10
lvl4wiz sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:star: 245 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 00:10
@LVL4WIZ welcome!
@jennytech you will need to increment/decrement the global variable based the card value. after that you will need to check value and return "bet" or "hold".
mecotterman
@mecotterman
Jan 07 2016 00:14
I'm having an issue on waypoint 22 in HTML/CSS. This is the statement that refuses to accept my input: Your p element should have the text "View more " (with a space after it). I've tried 10 different versions of: <p>"View more " <a href="http://www.freecatphotoapp.com">cat photos</a></p>
Any advice?
YI JIANG
@jennytech
Jan 07 2016 00:15
@ganeshkmurthy so it's for loop?
Yvan DiVirgilio
@YvanDi
Jan 07 2016 00:16
@jennytech try this

var count = 0;

function cc(card) {
// Only change code below this line
switch(card) {
case 2,3,4,5,6:
return "5 Bet";
case 7,8,9:
return "0 Hold";
case 10, "J", "Q", "K", "A":
return "-5 Hold";
case 3, 2, "A", 10, "K":
return "-1 Hold";

}

Franco Zapata
@Francozt01
Jan 07 2016 00:16
@jennytech i used a switch statement to assign the values +1 0 and -1 to the cards, and used an if ( ) statements inside each case to determinate the string of the values of card counting, Hold or Bet, depending on positive or negative values
YI JIANG
@jennytech
Jan 07 2016 00:16
why my if else is wrong?
angelbenoit
@angelbenoit
Jan 07 2016 00:17
anyone know how to do waypoint:Nesting for loops?
This message was deleted
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for(var i = 0; i < arr.length; i++){
    for(var j = 0; j < arr[i].length; j++)
      product = arr[i*j];
  }
  // Only change code above this line
  return product;
}
it's what i have so far, i think i'm supposed to multiply the i and j, not sure
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 00:18
@jennytech the 5 and 1 were just example outputs. read through the checkpoint again.
Franco Zapata
@Francozt01
Jan 07 2016 00:19
cuz u have to use switch to assign the values to each card, would be case 2,3,4,5,6: count++; to be +1 the second case of 7,8,9: to be count = 0; and the 3r case of 10, "J","Q","K","A": count--; to decrease each time a card is -1
Maciej Bembenista
@macbem
Jan 07 2016 00:20
@Takumar thanks
CamperBot
@camperbot
Jan 07 2016 00:20
noczesc sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 1568 | @takumar | http://www.freecodecamp.com/takumar
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 00:20
@angelbenoit that should be product *= arr[i][j];
Aleksander Gębicki
@Takumar
Jan 07 2016 00:20
@angelbenoit if you have to access 2D arrays, you have to access elements like that: arr[i][j]
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 00:21
@angelbenoit you are also missing the braces for the j loop.
angelbenoit
@angelbenoit
Jan 07 2016 00:22
you need braces for those too? it said i got it right without them
Sylvan Swierkosz
@nodatall
Jan 07 2016 00:23

Basic Javascript: 90.Checkpoint: Record Collection. In the following, my first else if with collection[id][prop].push(value); does not seem to be working. I can't figure out why.

// 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;
    } else if (prop == "tracks" && value !== "") {
      collection[id][prop].push(value);
    } else if (value === "") {
      delete collection[id][prop];
    }

  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");

```

angelbenoit
@angelbenoit
Jan 07 2016 00:23
thanks @ganeshkmurthy
CamperBot
@camperbot
Jan 07 2016 00:23
angelbenoit sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:star: 246 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
angelbenoit
@angelbenoit
Jan 07 2016 00:23
thanks @Takumar
CamperBot
@camperbot
Jan 07 2016 00:23
angelbenoit sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 00:23
@angelbenoit I guess it does not need it when you have a just a single statement. it is still a good idea to add it for code readability.
CamperBot
@camperbot
Jan 07 2016 00:23
:star: 1569 | @takumar | http://www.freecodecamp.com/takumar
angelbenoit
@angelbenoit
Jan 07 2016 00:24
thanks both of you
Aleksander Gębicki
@Takumar
Jan 07 2016 00:25
@angelbenoit you are welcome.
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 00:25
@djmuffy this is the tough one. :) check your first if condition. it will evaluate even if the prop is tracks which is a problem.
Farzaneh
@FarzanehNezarati
Jan 07 2016 00:26
Give your form element the id cat-photo-form.
how i should do this?
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 00:27
@angelbenoit welcome!
Sylvan Swierkosz
@nodatall
Jan 07 2016 00:27
@ganeshkmurthy I see what you mean, it is never getting past the first if
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 00:28
@djmuffy right. try adding a && prop not tracks
Sylvan Swierkosz
@nodatall
Jan 07 2016 00:28
@ganeshkmurthy Hurray, that did it. Thanks!
CamperBot
@camperbot
Jan 07 2016 00:28
djmuffy sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:star: 247 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 00:29
@djmuffy welcome! I did it like this
function update(id, prop, value) {

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

  return collection;
}
Sylvan Swierkosz
@nodatall
Jan 07 2016 00:31
@ganeshkmurthy cool, I didn't know you could nest if statements.
@ganeshkmurthy your solution looks more elegant
CompGeekGirl
@LisaRamos
Jan 07 2016 00:32

I'm having a problem with Waypoint: Understand String Immutability. I typed in this code and it won't go through.

// Setup
var myStr = "Jello World";

// Only change code below this line

myStr[0] = "H"; // Fix Me
myStr = "Hello World";
How can I fix this?

Dr. Paul Kenneth Shreeman
@pkshreeman
Jan 07 2016 00:33
@LisaRamos That’s the whole point. You can’t..you have to replace the whole string.
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 00:33
@LisaRamos strings are immutable; you cannot replace individual characters of a string. replace myStr[0] line with your next line.
CompGeekGirl
@LisaRamos
Jan 07 2016 00:34
@pkshreeman @ganeshkmurthy I got it. Thanks.
CamperBot
@camperbot
Jan 07 2016 00:34
lisaramos sends brownie points to @pkshreeman and @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:star: 248 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
:star: 267 | @pkshreeman | http://www.freecodecamp.com/pkshreeman
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 00:35

hi guys How can i return the prop value

var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here
  var property= myObj.hasOwnProperty(checkProp);
  if (property===true){
    return checkProp;
  }
  else{
    return "Not Found";
  } 
}
// Test your code by modifying these values
checkObj("gift”);

Instructions
Modify the function checkObj to test myObj for checkProp. If the property is found, return that property's value. If not, return "Not Found".

Franco Zapata
@Francozt01
Jan 07 2016 00:38
@mukhtaarabdi inside the if statement u have to ask if myObj.hasOwnProperty "checkProp" in it
u don't need to declare the variable property
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 00:40
so i should put myObj.hasOwnProperty “checkProp” inside the if statement ? @Francozt01
Saujan Uprety
@SaujanUprety
Jan 07 2016 00:40
js function diff(arr1, arr2) {
  var newArr = [];

  // Same, same; but different.


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

  }
   for(var k =0; k <arr2.length; k++){
   if( arr2.indexOf(arr1[k]) === -1) {
     newArr.push(arr1[k]);
   }

  }



  return newArr;
}

diff([], ["snuffleupagus", "cookie monster", "elmo"]);
guys my code prints out commas despite showing the desired output, can anyone check it out please
Question: Compare two arrays and return a new array with any items only found in one of the original arrays.
CompGeekGirl
@LisaRamos
Jan 07 2016 00:41

I have no idea with what I'm doing with Checkpoint: Word Blanks.

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

// Your code above this line

return result;
}

// Change the words here to test your function
wordBlanks("cat", "little", "hit", "slowly");

How can I fix this to make this run through properly (even though it doesn't)?

Franco Zapata
@Francozt01
Jan 07 2016 00:41
@mukhtaarabdi that's what i did not using the "" just like u did in the assignment to ur var property
nbgit
@nbgit
Jan 07 2016 00:42
ok guys so on this waypoint: Use a CSS Class to Style an Element it's telling me that my stylesheet should declare a red-text class and have its color set to red
Franco Zapata
@Francozt01
Jan 07 2016 00:42
just change the "" for ()
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 00:42
@Francozt01 where?
Robin Lu
@robinswaylu
Jan 07 2016 00:42
hi guys! Question for Timestamp Microservice. Does anyone know how do you validate the natural language date?
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 00:42
@Francozt01 oh yeah i did it already i was not following you
Franco Zapata
@Francozt01
Jan 07 2016 00:43
hahaha ok
Jonathan Coleman
@jondcoleman
Jan 07 2016 00:43
@robinswaylu you can use momentjs if you want to do it the easy way
nbgit
@nbgit
Jan 07 2016 00:43

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

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

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

mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 00:43
@Francozt01 i am here now
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here

  if (myObj.hasOwnProperty(checkProp)===true){
    return checkProp;
  }
  else{
    return "Not Found";
  } 
}
// Test your code by modifying these values
checkObj("gift”);
nbgit
@nbgit
Jan 07 2016 00:43
whOOPS
Franco Zapata
@Francozt01
Jan 07 2016 00:43
worked?
@nbgit ready :D ?
Jonathan Coleman
@jondcoleman
Jan 07 2016 00:43
@robinswaylu and the realistic way
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 00:44
@Francozt01 no its showing gift, i should output “pony"
Jonathan Coleman
@jondcoleman
Jan 07 2016 00:44
if you want to do it the hard way you'll need some regex-fu
nbgit
@nbgit
Jan 07 2016 00:44
<style>
  .red-text {
    color:  red
  }
</style>

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

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
it's telling me that "Your stylesheet should declare a red-text class and have its color set to red."
i am doing that
what am i doing wrong
Franco Zapata
@Francozt01
Jan 07 2016 00:45
@mukhtaarabdi delete ===true
Eina
@thelittleblacksmith
Jan 07 2016 00:45
@nbgit semi-colon after red?
Franco Zapata
@Francozt01
Jan 07 2016 00:45
only use myObj.hasOwnProperty(checkProp)
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 00:45
This message was deleted
chipymunk
@chipymunk
Jan 07 2016 00:45
Anyone able to help me on a rather stupid question?
nbgit
@nbgit
Jan 07 2016 00:45
sHIT SEMICOLON
I HATE SEMICOLON
DJ
@qualitymanifest
Jan 07 2016 00:45
SEMICOLON! HIT THE DECK
Eina
@thelittleblacksmith
Jan 07 2016 00:45
welcome to css, once you're okay with it, learn sass lol
Franco Zapata
@Francozt01
Jan 07 2016 00:46
hahahahah
u will get use to it @nbgit
@mukhtaarabdi only put this inside the if statement myObj.hasOwnProperty(checkProp)
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 00:47
then?
Robin Lu
@robinswaylu
Jan 07 2016 00:47
@jondcoleman thanks for the tip. I will try to solve it with regex first before I look up moment.js
CamperBot
@camperbot
Jan 07 2016 00:47
robinswaylu sends brownie points to @jondcoleman :sparkles: :thumbsup: :sparkles:
:star: 354 | @jondcoleman | http://www.freecodecamp.com/jondcoleman
Franco Zapata
@Francozt01
Jan 07 2016 00:47
click on run test xd
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 00:47
@Francozt01 i think the problem is what i am returning
@Francozt01 do you mean this
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here

  if (myObj.hasOwnProperty(checkProp)){
    return checkProp;
  }
  else{
    return "Not Found";
  } 
}
// Test your code by modifying these values
checkObj("gift”);
Franco Zapata
@Francozt01
Jan 07 2016 00:48
return myObj[checkProp];
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 00:48
@Francozt01 yeah that is it
@mukhtaarabdi :D thanks
CamperBot
@camperbot
Jan 07 2016 00:48
sorry mukhtaarabdi, you can't send brownie points to yourself! :sparkles: :sparkles:
Franco Zapata
@Francozt01
Jan 07 2016 00:49
hahaha acording to the camper bot u can't thanks yourself xd
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 00:49
what ? lool did i mention my self ?
@Francozt01 thanks
CamperBot
@camperbot
Jan 07 2016 00:49
mukhtaarabdi sends brownie points to @francozt01 :sparkles: :thumbsup: :sparkles:
:star: 429 | @francozt01 | http://www.freecodecamp.com/francozt01
Franco Zapata
@Francozt01
Jan 07 2016 00:50
hahahaha
yes u did D:
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 00:50
@Francozt01 coz i was so happy passing this point after 1 day
Franco Zapata
@Francozt01
Jan 07 2016 00:52
is a good feeling when u pass a waypoint or checkpoint that takes u a good amount of time
Keat
@keatclark
Jan 07 2016 00:53
@kam_ise SUP
@kam-ise hey need help with basic stuff message me
Kami Iseman
@kam-ise
Jan 07 2016 00:54
@keatclark who do you need the help with?
Keat
@keatclark
Jan 07 2016 00:54
@kam-ise okay, bye!
John Espinoza
@johnlovespi
Jan 07 2016 00:57
my code is not going thru
$("#left-well").parent().css("background-color", "red")
turning left well red , witch it is showing up but not valid answear
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 00:59
@johnlovespi Which waypoint is that?
John Espinoza
@johnlovespi
Jan 07 2016 00:59
@DevPoetsSociety Waypoint: Target the Parent of an Element Using jQuery
Bill
@kirah1314
Jan 07 2016 01:01
@johnlovespi do you have a semi-colon at the end?
John Espinoza
@johnlovespi
Jan 07 2016 01:01
yea dosent work
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:02
@johnlovespi You're trying to color the well, right?
John Espinoza
@johnlovespi
Jan 07 2016 01:02
@DevPoetsSociety yes
witch it is
but it not working
Bill
@kirah1314
Jan 07 2016 01:03
@johnlovespi you're suppose to target target1, the instructions ask for:
Give the parent of the #target1 element a background-color of red.
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:03
So to do that with .parent you have to target the child
Oh, it even says that in the sidebar.
chipymunk
@chipymunk
Jan 07 2016 01:06
Hi Everyone.. Can anyone lend a hand?
Eina
@thelittleblacksmith
Jan 07 2016 01:06
sure
chipymunk
@chipymunk
Jan 07 2016 01:06
I'm stuck on the Checkpoint Stand in Line.. It wants me to write a function queue that takes an "array" and an "item" as arguments.
Eina
@thelittleblacksmith
Jan 07 2016 01:07
what do you have so far?
chipymunk
@chipymunk
Jan 07 2016 01:07
Thats easy, but then I need to add the item onto the end of the array (a push?) and remove the first element (a pop?)...
Brianna
@ycrtw93
Jan 07 2016 01:07

// 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;
} else if (prop === "tracks" && value !== "") {
collection[id].tracks.push(value);
}
else if (value === "") {
delete collection[id][prop];
}
return collection;
}

// Alter values below to test your code
update(1245, "tracks", "Addicted to Love");

what did i do wrong :S
Carole Anne Hannon
@CaroleAnneHannon
Jan 07 2016 01:08
wiki checkpoint stand in line
CamperBot
@camperbot
Jan 07 2016 01:08

:point_right: checkpoint stand in line [wiki]

Checkpoint: Stand In Line

About queues

In Computer Science a queue is an abstract Data Structure where items are kept in order. New items can be added at the back of the queue and old items are taken off from the front of the queue.

Instructions

Write a function queue which takes an "array" and an "item" as arguments.

Add the item onto the end of the array, then remove the first element of the array.

The queue function should return the element that was removed.

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

:pencil: read more about checkpoint stand in line on the FCC Wiki

chipymunk
@chipymunk
Jan 07 2016 01:08

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

function queue(arr, item) {
// Your code here

arr = arr + (item.push); // Change this line
}

Sarah Sivilich
@ssivilich
Jan 07 2016 01:08
@chipymunk I think all the props need to be in brackets
chipymunk
@chipymunk
Jan 07 2016 01:09
I think I need to walk away from this for amoment before i throw my laptop out the window
Boris
@boris-in-london
Jan 07 2016 01:09
Eina
@thelittleblacksmith
Jan 07 2016 01:09
push doesn't work like that
Sarah Sivilich
@ssivilich
Jan 07 2016 01:09
@chipymunk collection[id][prop]=value;
Carole Anne Hannon
@CaroleAnneHannon
Jan 07 2016 01:10
@ycrtw93 you may want to have your if and first else if reversed
Manish Giri
@Manish-Giri
Jan 07 2016 01:10
@chipymunk what’s the waypoint
chipymunk
@chipymunk
Jan 07 2016 01:10
Checkpoint: Stand in Line
Sarah Sivilich
@ssivilich
Jan 07 2016 01:10
oh u have that
Carole Anne Hannon
@CaroleAnneHannon
Jan 07 2016 01:10
@ycrtw93 it'll never get to do the tracks version because it'll reach the first if and value isn't "" (it's "additcted to love")
Boris
@boris-in-london
Jan 07 2016 01:10
i think walking away for ten mins and coming back with fresh eyes does a lot of good.
Brianna
@ycrtw93
Jan 07 2016 01:11
@CaroleAnneHannon life saver!! thank you :)
CamperBot
@camperbot
Jan 07 2016 01:11
ycrtw93 sends brownie points to @caroleannehannon :sparkles: :thumbsup: :sparkles:
:star: 644 | @caroleannehannon | http://www.freecodecamp.com/caroleannehannon
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:12
@chipymunk Think of it as two separate actions. It's not a one-liner.
Brittany
@brittanyleigh
Jan 07 2016 01:17
Ugh, I'm stuck on Waypoint : Nesting for Loops. What am I missing, I feel like this should work?!
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (var i = 0; i < arr.length; i++) {
    for (var j = 0; j < arr.length; j++) {
      product *= arr[i][j];
    }
  }
  // Only change code above this line
  return product;
}
I keep getting NaN as the result :(
Carole Anne Hannon
@CaroleAnneHannon
Jan 07 2016 01:18
@brittanyleigh you're really close, it's your second loop
Eina
@thelittleblacksmith
Jan 07 2016 01:19
@brittanyleigh look at the example given for your second loop :smile:
Carole Anne Hannon
@CaroleAnneHannon
Jan 07 2016 01:19
@brittanyleigh the second loop is going through the array inside arr[i], so the length isn't the full arr
CompGeekGirl
@LisaRamos
Jan 07 2016 01:20

Can someone help me with Checkpoint: Word Blanks? I don't understand what I'm doing here and I need help.

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

// Your code above this line

return result;
}

// Change the words here to test your function
wordBlanks("cat", "little", "hit", "slowly");

How can I fix this code so that way it will run properly?

Eina
@thelittleblacksmith
Jan 07 2016 01:21
@LisaRamos you don't need to assign strings to the function's parameters
Brittany
@brittanyleigh
Jan 07 2016 01:21
Ahh! I missed arr[i].length, I can't believe that. But I changed that and it's still not working... I'm getting a number now but it's the wrong number. :/
CompGeekGirl
@LisaRamos
Jan 07 2016 01:21
@thelittleblacksmith How do I do that?
Eina
@thelittleblacksmith
Jan 07 2016 01:21
you just need to concatenate the myNoun etc with spaces in between
@LisaRamos when wordBlanks gets run at the bottom there with cat and little, it replaces myNoun, myAdjective etc. so inside the function, you need to do something to those parameters (myNoun, etc)
mecotterman
@mecotterman
Jan 07 2016 01:22
Could I get some help with Nest an Anchor Element within a Paragraph? I'm stuck at: Your p element should have the text "View more " (with a space after it).
I've tried 50 combinations of: <p>"View more " <a href="http://www.freecatphotoapp.com">cat photos</a></p>
CompGeekGirl
@LisaRamos
Jan 07 2016 01:24
@thelittleblacksmith What do I do to those parameters?
Carole Anne Hannon
@CaroleAnneHannon
Jan 07 2016 01:24
@brittanyleigh really? when I took your code and put in arr[i].length for the second loop it worked
Eina
@thelittleblacksmith
Jan 07 2016 01:24
@LisaRamos you would want to assign them to results and then concatenate/string them together with a space between each
abhaill
@abhaill
Jan 07 2016 01:24
@LisaRamos You need to change the value of your result var so that it concatenates the words.
Brittany
@brittanyleigh
Jan 07 2016 01:24
Ah, never mind, I got it! Thank you @CaroleAnneHannon & @thelittleblacksmith
CamperBot
@camperbot
Jan 07 2016 01:24
brittanyleigh sends brownie points to @caroleannehannon and @thelittleblacksmith :sparkles: :thumbsup: :sparkles:
:star: 195 | @thelittleblacksmith | http://www.freecodecamp.com/thelittleblacksmith
:star: 645 | @caroleannehannon | http://www.freecodecamp.com/caroleannehannon
abhaill
@abhaill
Jan 07 2016 01:25
@LisaRamos With spaces in between, natch!
Eina
@thelittleblacksmith
Jan 07 2016 01:25
yay
marcgetter
@marcgetter
Jan 07 2016 01:28
Hey all...is there a bug in Checkpoint: Stand in Line?
I keep getting "Maximum call stack size exceeded"
Manish Giri
@Manish-Giri
Jan 07 2016 01:28
@marcgetter refresh the page
Brian
@sludge256
Jan 07 2016 01:29
Bot that spits out formatted help requests in help room from processing user input from PMs as a feature? :thumbsup: :thumbsdown:
CamperBot
@camperbot
Jan 07 2016 01:29
no wiki entry for: that spits out formatted help requests in help room from processing input from pms as a feature thumbsup thumbsdown
marcgetter
@marcgetter
Jan 07 2016 01:29
Thanks!
is this a common issue with fcc?
Brian
@sludge256
Jan 07 2016 01:29
@marcgetter as of the new upate yes :(
marcgetter
@marcgetter
Jan 07 2016 01:30
alright..thanks..i'll remember to try first next time.
mecotterman
@mecotterman
Jan 07 2016 01:30
I'm unsure if my issue with Waypoint 22 on HTML/CSS is something I should submit as a bug? I've tried on various computers and asked on the help chat, but I haven't gotten any ideas. I'm close to finishing HTML/CSS and want to get this figured out
chipymunk
@chipymunk
Jan 07 2016 01:31
@marcgetter I'm stuck there too. I got that error a few times... I had to walk away before I threw my laptop out the window
Brian
@sludge256
Jan 07 2016 01:31
@mecotterman I will attempt to resolve your issue
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:31
@mecotterman What's the issue?
Brian
@sludge256
Jan 07 2016 01:31
@chipymunk Usually it resolves with one or more refreshes or a browser restart
as long as it's not your code causing it
mecotterman
@mecotterman
Jan 07 2016 01:31
I'm stuck at: Your p element should have the text "View more " (with a space after it).
I've tried 50 combinations of: <p>"View more " <a href="http://www.freecatphotoapp.com">cat photos</a></p>
Thanks for the support, @sludge256, @devepo
CamperBot
@camperbot
Jan 07 2016 01:32
mecotterman sends brownie points to @sludge256 and @devepo :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for devepo
:star: 577 | @sludge256 | http://www.freecodecamp.com/sludge256
Jeannie Stevenson
@JSDesign
Jan 07 2016 01:32
thanks @thelittleblacksmith and @CaroleAnneHannon also from me - that was helpful with word blanks :)
CamperBot
@camperbot
Jan 07 2016 01:32
jsdesign sends brownie points to @thelittleblacksmith and @caroleannehannon :sparkles: :thumbsup: :sparkles:
:star: 196 | @thelittleblacksmith | http://www.freecodecamp.com/thelittleblacksmith
:star: 646 | @caroleannehannon | http://www.freecodecamp.com/caroleannehannon
mecotterman
@mecotterman
Jan 07 2016 01:33
@DevPoetsSociety I appreciate the help - its so early its annoying to be unable to figure it out
Khademul Islam Mahin
@Mahin2k
Jan 07 2016 01:33
@mecotterman there shouldn't be quotes inside the p element
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:34
Oh, lol.
I've done that.
Brian
@sludge256
Jan 07 2016 01:34
Most of the time when the instructions have quotes around words you can likely ignore the quotes.
It's probably due to them attempting to signify that it should be treated as a string
Maxwell Nare
@maxinare
Jan 07 2016 01:35
Checkpoint: Convert Celsius to Fahrenheit, pliz help Im stuck a lil
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:35
Shoot @maxinare
Greg D
@mosaic-greg
Jan 07 2016 01:35
@maxinare hi what is the hard part
mecotterman
@mecotterman
Jan 07 2016 01:35
@Mahin2k THANK YOU!
CamperBot
@camperbot
Jan 07 2016 01:35
mecotterman sends brownie points to @mahin2k :sparkles: :thumbsup: :sparkles:
:star: 197 | @mahin2k | http://www.freecodecamp.com/mahin2k
CompGeekGirl
@LisaRamos
Jan 07 2016 01:36

I'm still struggling with Checkpoint: Word Blanks. How do I do this whole concatenation thing?

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line
myNoun = "cat";
myAdjective = "little";
myVerb = "hit";
myAdverb = "slowly";
// Your code above this line
return result;
}

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

Can someone walk me through it?

Maxwell Nare
@maxinare
Jan 07 2016 01:36
@mosaic-greg this is what I added to the code to convert to fereinheit , var celcius = 9/5;
var celcius +=32;
Khademul Islam Mahin
@Mahin2k
Jan 07 2016 01:36
can some one help me with the golf code checkpoint?
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:36
@LisaRamos The variables are assigned already by the function call.
Khademul Islam Mahin
@Mahin2k
Jan 07 2016 01:37

```
function golfScore(par, strokes) {

// Only change code below this line
if(strokes === 1){
return "Hole-in-one!";
}
else if(strokes <= par - 2){
return "Eagle";
}
else if(par - 1){
return "Birdie";
}
else if (par){
return "Par";
}
else if(par + 1){
return "Bogey";
}
else if(par + 2){
return "Double Bogey";
}
else if (strokes >= par + 3){
return "Go Home!";
}
// Only change code above this line

}

// Change these values to test

golfScore(5, 5);

function golfScore(par, strokes) {

  // Only change code below this line
  if(strokes === 1){
    return "Hole-in-one!";
  }
  else if(strokes <= par - 2){
    return "Eagle";
  }
  else if(par - 1){
    return "Birdie";
  }
  else if (par){
    return    "Par";
  }
  else if(par + 1){
    return "Bogey";
  }
  else if(par + 2){
    return "Double Bogey";
  }
  else if (strokes >= par + 3){
  return "Go Home!";  
  }
  // Only change code above this line

}

// Change these values to test

golfScore(5, 5);
can someone help me with this?
Vishwanath Kamble
@vishukamble
Jan 07 2016 01:37

Can anyone help me with this?

// Setup
var myStorage = {
  "car": {
    "inside": {
      "glove box": "maps",
      "passenger seat": "crumbs"
     },
    "outside": {
      "trunk": "jack"
    }
  }
};

// Only change code below this line

var gloveBoxContents = myStorage.car("inside[glove box]"); // Change this line

Access the myStorage JSON object to retrieve the contents of the glove box. Only use object notation for properties with a space in their name.

Greg D
@mosaic-greg
Jan 07 2016 01:37
@maxinare use (9/5)+32
Gaby Woulf
@poopwoulf
Jan 07 2016 01:38
Hi! I'm also on Checkpoint 37: Word Blanks. My mad lib "works" but it won't let me pass. Here is my code:

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

// Your code above this line

return result;
}

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

Maxwell Nare
@maxinare
Jan 07 2016 01:38
thanks @mosaic-greg , let me try that solution;
CamperBot
@camperbot
Jan 07 2016 01:38
maxinare sends brownie points to @mosaic-greg :sparkles: :thumbsup: :sparkles:
Vishwanath Kamble
@vishukamble
Jan 07 2016 01:38
nevermind I figured it. :)
CamperBot
@camperbot
Jan 07 2016 01:38
:star: 252 | @mosaic-greg | http://www.freecodecamp.com/mosaic-greg
Adriel Lubarsky
@alubarsky
Jan 07 2016 01:38
Having trouble with comments- always seem to have a ;; hanging out that i can’t get rid of
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 01:38
@Mahin2k whats the problem with it? Could you post the problem
frsRaza
@frsRaza
Jan 07 2016 01:39
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (var i = 0; i < arr.length; i++) {
    for (var j = 0; j < arr[i].length; j++){
      return 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]]);
Stuck at Nesting For Loops. Please Help.
Khademul Islam Mahin
@Mahin2k
Jan 07 2016 01:39
@jelocanlas some of the checkpoints tests are not passing
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:39
@Mahin2k You're not doing the evaluations right.
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 01:39
@Mahin2k I think @DevPoetsSociety is right.
Franco Zapata
@Francozt01
Jan 07 2016 01:39
@frsRaza you need to make the product be equal to product*arr[i][j];
Khademul Islam Mahin
@Mahin2k
Jan 07 2016 01:40
@DevPoetsSociety so how would i do it right?
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:40
@Mahin2k It needs to evaluate to true or false.
scottmike0
@scottmike0
Jan 07 2016 01:40
@frsRaza you do not want to return 2 different things, rather you are multiplying the array via product
Maxwell Nare
@maxinare
Jan 07 2016 01:40
@mosaic-greg it didnt work brother
Khademul Islam Mahin
@Mahin2k
Jan 07 2016 01:41
@DevPoetsSociety the instructions say nothing about making it true or falsse
Alexis Reina
@alexisreina
Jan 07 2016 01:41
@ganeshkmurthy thanks I fixed the last issues: 0/0, 0/N, adding 0 on the right 000, and floating point precission
CamperBot
@camperbot
Jan 07 2016 01:41
alexisreina sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:star: 249 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
Fabiano Adelino
@technotebrasil
Jan 07 2016 01:41
hello guys! what I'm missing here -> var fahrenheit = (-30 * (9/5) + 32); ?
Adriel Lubarsky
@alubarsky
Jan 07 2016 01:41
Screen Shot 2016-01-06 at 8.40.02 PM.png
Why is the ;; still there?
abhaill
@abhaill
Jan 07 2016 01:41
@technotebrasil What happens if the input isn't -30?
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 01:41
@Mahin2k Mahink. From Birdie to Double Bogey. I think you should do ifs using strokes
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:41
@Mahin2k If statements do. That's what they do.
Adriel Lubarsky
@alubarsky
Jan 07 2016 01:41
Seems like I closed the comment
frsRaza
@frsRaza
Jan 07 2016 01:42
@Francozt01 @scottmike0 Thanks for clearing that up!
CamperBot
@camperbot
Jan 07 2016 01:42
frsraza sends brownie points to @francozt01 and @scottmike0 :sparkles: :thumbsup: :sparkles:
:star: 226 | @scottmike0 | http://www.freecodecamp.com/scottmike0
:star: 432 | @francozt01 | http://www.freecodecamp.com/francozt01
Alexis Reina
@alexisreina
Jan 07 2016 01:42
if someone else want's to test it I think the logic is now how it should be http://codepen.io/alexisreina/full/dGvYYR/
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 01:42
@Mahin2k strokes == par-1
@Mahin2k birdie
Franco Zapata
@Francozt01
Jan 07 2016 01:42
@frsRaza np good luck
rhys
@rhysshadow
Jan 07 2016 01:42

can anyone point me to why this is not returning right? this is the palindrome bonfire:

function palindrome(str) {
// Good luck!

var newStr = str.replace(/[^a-z]+/g, "").toLowerCase();
return str === newStr.split("").reverse().join("");

}

Fabiano Adelino
@technotebrasil
Jan 07 2016 01:42
@abhaill changes the value, but I'm intrigued with the convert();
Khademul Islam Mahin
@Mahin2k
Jan 07 2016 01:43
@jelocanlas i think so to but i dont know how the syntax would go
scottmike0
@scottmike0
Jan 07 2016 01:43
@rhysshadow what is the objective.
Franco Zapata
@Francozt01
Jan 07 2016 01:43
@technotebrasil you have to delcare a variable farenheit
scottmike0
@scottmike0
Jan 07 2016 01:43
@rhysshadow also what does .reverse() and split("") do ?
rhys
@rhysshadow
Jan 07 2016 01:43

to return true on palindromes, and false on the not-palindromes.

it is failing when there are white spaces involved. i have also tried /\/W/

Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 01:43
@Mahin2k
else if(strokes == par - 1){
return "Birdie";
}
else if (strokes == par){
return "Par";
}
else if(strokes == par + 1){
return "Bogey";
}
else if(strokes ==par + 2){
return "Double Bogey";
}
Try replacing your old code.
Paul
@izzo70
Jan 07 2016 01:43

var count = 0;

function cc(card) {
// Only change code below this line
switch (card) {
case 2:
case 3:
case 4:
case 5:
case 6:
currentCount = count ++ ;
break;
case 7:
case 8:
case 9:
currentCount = count ;
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
currentCount = count -- ;

}

console.log(currentCount);
if (currentCount > 0) {
return "Bet";
}
else if (currentCount < 0 || currentCount === 0) {
return "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');```

Greg D
@mosaic-greg
Jan 07 2016 01:43
@technotebrasil @maxinare use return celsius * 9/5 +32;
abhaill
@abhaill
Jan 07 2016 01:43
@technotebrasil Maybe I've misunderstood your question, but the way you wrote it would always give you the conversion for -30, as it doesn't make reference to the input.
Jocelyn
@jocelyn-ong
Jan 07 2016 01:43
@rhysshadow your newStr will all be in lower case whereas your str will have the original upper and lower case letters
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:43
@rhysshadow Hint: you can check for things-that-are-not-words, and then check for underscores (which are considered word chars in JS)
rhys
@rhysshadow
Jan 07 2016 01:44
thank you guys. i will try this.
Paul
@izzo70
Jan 07 2016 01:44
I dont understand counting cards?
Khademul Islam Mahin
@Mahin2k
Jan 07 2016 01:44
@jelocanlas thank you, that solved the problem
CamperBot
@camperbot
Jan 07 2016 01:44
mahin2k sends brownie points to @jelocanlas :sparkles: :thumbsup: :sparkles:
:star: 217 | @jelocanlas | http://www.freecodecamp.com/jelocanlas
Fabiano Adelino
@technotebrasil
Jan 07 2016 01:44
@abhaill yep, that's it, I missing the input
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:44
@izzo70 The concept or the waypoint?
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 01:44
@Mahin2k No problem. (y)
CompGeekGirl
@LisaRamos
Jan 07 2016 01:44
This message was deleted
Fabiano Adelino
@technotebrasil
Jan 07 2016 01:44
@mosaic-greg thanks, I'll try that
CamperBot
@camperbot
Jan 07 2016 01:44
technotebrasil sends brownie points to @mosaic-greg :sparkles: :thumbsup: :sparkles:
:star: 253 | @mosaic-greg | http://www.freecodecamp.com/mosaic-greg
abhaill
@abhaill
Jan 07 2016 01:44
@technotebrasil No problem. I hope it works for you now!
Adriel Lubarsky
@alubarsky
Jan 07 2016 01:44
Can anyone help me out?
Paul
@izzo70
Jan 07 2016 01:45
no i get the concept cause i saw "21" but my code no good. See 20:43
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 01:45
@alubarsky Just post the problem. We'll help you out
Fabiano Adelino
@technotebrasil
Jan 07 2016 01:45
@abhaill thanks brother
CamperBot
@camperbot
Jan 07 2016 01:45
technotebrasil sends brownie points to @abhaill :sparkles: :thumbsup: :sparkles:
:star: 254 | @abhaill | http://www.freecodecamp.com/abhaill
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:45
@izzo70 See what?
Paul
@izzo70
Jan 07 2016 01:45

var count = 0;

function cc(card) {
// Only change code below this line
switch (card) {
case 2:
case 3:
case 4:
case 5:
case 6:
currentCount = count ++ ;
break;
case 7:
case 8:
case 9:
currentCount = count ;
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
currentCount = count -- ;

}

console.log(currentCount);
if (currentCount > 0) {
return "Bet";
}
else if (currentCount < 0 || currentCount === 0) {
return "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');

Adriel Lubarsky
@alubarsky
Jan 07 2016 01:45
@jelocanlas can’t get rid of the ;; even when I close the comment
abhaill
@abhaill
Jan 07 2016 01:45
@technotebrasil np. Happy coding!
Adriel Lubarsky
@alubarsky
Jan 07 2016 01:45
Screen Shot 2016-01-06 at 8.40.02 PM.png
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 01:46
@alubarsky post your editor.
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:46
@izzo70 You can throw out the 7-9 stuff
Sarah Sivilich
@ssivilich
Jan 07 2016 01:46
could someone please tell me what the factorial method is? fact() doesn't work, and I can't seem to find it under arthimatic operators eithre
CompGeekGirl
@LisaRamos
Jan 07 2016 01:46

@abhaill I typed in this code.

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

console.log(result.concat(""));
// Your code above this line

return result;
}

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

I'm still very confused and don't know what to do here.

Adriel Lubarsky
@alubarsky
Jan 07 2016 01:46
@jelocanlas

<h1>Hello World</h1>

<h2>CatPhotoApp</h2>

<p>Hello Paragraph</p>

Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 01:46
@alubarsky have you tried refreshing your page?
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:46
@izzo70 You still need to return something
Adriel Lubarsky
@alubarsky
Jan 07 2016 01:46
yeah I did
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 01:47
@alubarsky thats odd.
abhaill
@abhaill
Jan 07 2016 01:47
@LisaRamos You need to use the concat function to redefine return.
Franco Zapata
@Francozt01
Jan 07 2016 01:47
@technotebrasil after declaring the variable farenheit you have to assign the formula that will take the celsius and convert to farenheit »» var fahrenheit = celsius * (9/5) +32;
nbgit
@nbgit
Jan 07 2016 01:47
@ALUBARSKY i'm getting that too
Eina
@thelittleblacksmith
Jan 07 2016 01:47
@LisaRamos you just need to use + for that checkpoint
Adriel Lubarsky
@alubarsky
Jan 07 2016 01:47
Maybe I’ll just assume it’s a bug and move on
nbgit
@nbgit
Jan 07 2016 01:47
@alubarsky not a clue about it
Eina
@thelittleblacksmith
Jan 07 2016 01:47
@LisaRamos myNoun + ' ' + myAdjective and so on
Fabiano Adelino
@technotebrasil
Jan 07 2016 01:47
@mosaic-greg :smile: works like a charm
Paul
@izzo70
Jan 07 2016 01:47
@DevPoetsSociety ok i thought i returned it
abhaill
@abhaill
Jan 07 2016 01:47
@thelittleblacksmith Thanks for pointing that out.
CamperBot
@camperbot
Jan 07 2016 01:47
abhaill sends brownie points to @thelittleblacksmith :sparkles: :thumbsup: :sparkles:
:star: 197 | @thelittleblacksmith | http://www.freecodecamp.com/thelittleblacksmith
nbgit
@nbgit
Jan 07 2016 01:47
@alubarsky pretty sure it might be a bug
Adriel Lubarsky
@alubarsky
Jan 07 2016 01:47
A bug on the 3rd lesson of a coding school…rough start!
Eric
@eti313
Jan 07 2016 01:47
@alubarsky I see the same thing. I wouldn't worry about it.
Fabiano Adelino
@technotebrasil
Jan 07 2016 01:47
@Francozt01 thanks brother :smile:
CamperBot
@camperbot
Jan 07 2016 01:47
technotebrasil sends brownie points to @francozt01 :sparkles: :thumbsup: :sparkles:
:star: 433 | @francozt01 | http://www.freecodecamp.com/francozt01
nbgit
@nbgit
Jan 07 2016 01:47
lol
CompGeekGirl
@LisaRamos
Jan 07 2016 01:47
@abhaill How do I redefine return? @thelittleblacksmith How do I use + for the checkpoint?
Boris
@boris-in-london
Jan 07 2016 01:48
lol @alubarsky, you get what you pay for?
just kidding
Adriel Lubarsky
@alubarsky
Jan 07 2016 01:48
@nbgit if you delete all comments and move your headings up to line 1, it works. Kind of a cheat, I suppose
abhaill
@abhaill
Jan 07 2016 01:48
@LisaRamos You need to use it to change result. So result = "string" + " " + "nextString" etc.
Franco Zapata
@Francozt01
Jan 07 2016 01:48
@technotebrasil neighboor
np
Eina
@thelittleblacksmith
Jan 07 2016 01:48
@LisaRamos result = parameter + ' ' + parameter
abhaill
@abhaill
Jan 07 2016 01:49
@LisaRamos Except that you have parameters defined, so do what @thelittleblacksmith said.
Bill
@kirah1314
Jan 07 2016 01:49
@alubarsky what's the waypoint title? I don't think it's a bug
Adriel Lubarsky
@alubarsky
Jan 07 2016 01:50
@kirah1314 uncomment html. It’s the 4th lesson
Bill
@kirah1314
Jan 07 2016 01:51

@alubarsky wait 4th or 3rd? You said 3rd on top

A bug on the 3rd lesson of a coding school…rough start!

Adriel Lubarsky
@alubarsky
Jan 07 2016 01:51
sorry, meant 4th
Eina
@thelittleblacksmith
Jan 07 2016 01:52
@alubarsky what's wrong with it? i just tested it out?
jmesa92
@jmesa92
Jan 07 2016 01:52
2/3 done with checkpoint: Stand in line... Just lost on how to make it return the removed element
CompGeekGirl
@LisaRamos
Jan 07 2016 01:52

@abhaill So I typed this in.

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

result = myNoun + "cat" + myAdjective + "little" + myVerb + "hit" + myAdverb + "slowly";
// Your code above this line

return result;
}

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

It didn't go through. What should I change here?

DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:52
@jmesa92 Remember you can return 2+2 or similar
Bill
@kirah1314
Jan 07 2016 01:53
@alubarsky passed for me, what issue did you noticed? You mean the image you posted?
Eina
@thelittleblacksmith
Jan 07 2016 01:53
@LisaRamos try removing the strings and replacing them with just blank spaces
@LisaRamos so + " " +
Jeannie Stevenson
@JSDesign
Jan 07 2016 01:53
@LisaRamos you don't need to define the word parameters inside the function. that's what the function call part is for.
Paul
@izzo70
Jan 07 2016 01:54
how can i print my code in the chat rooms in black anyone?
CompGeekGirl
@LisaRamos
Jan 07 2016 01:54
@thelittleblacksmith I got it. Thanks.
CamperBot
@camperbot
Jan 07 2016 01:54
lisaramos sends brownie points to @thelittleblacksmith :sparkles: :thumbsup: :sparkles:
Eina
@thelittleblacksmith
Jan 07 2016 01:54
help format
CamperBot
@camperbot
Jan 07 2016 01:54
:star: 198 | @thelittleblacksmith | http://www.freecodecamp.com/thelittleblacksmith

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

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

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

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

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

Brian
@sludge256
Jan 07 2016 01:54
They don't learn about functions and calls until after word blanks though
abhaill
@abhaill
Jan 07 2016 01:54
@LisaRamos If you look at the output box, you'll probably see something like "catcatlittlelittle...".
Dr. Paul Kenneth Shreeman
@pkshreeman
Jan 07 2016 01:54
@izzo70 you put “```” before and after code.
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:54
Use three backpacks (probably top left key on your board)
BackTics
Dr. Paul Kenneth Shreeman
@pkshreeman
Jan 07 2016 01:54
testing testing testing
abhaill
@abhaill
Jan 07 2016 01:55
@LisaRamos The output box is really helpful in debugging your own code -- it can help you figure out where things went wrong and what kind of wrong they went.
Dr. Paul Kenneth Shreeman
@pkshreeman
Jan 07 2016 01:55
testing javascript javascript
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 01:55
You can return a variable or whatever to check if it's what you expect it to be.
CompGeekGirl
@LisaRamos
Jan 07 2016 01:56
@abhaill Thanks
CamperBot
@camperbot
Jan 07 2016 01:56
lisaramos sends brownie points to @abhaill :sparkles: :thumbsup: :sparkles:
:star: 255 | @abhaill | http://www.freecodecamp.com/abhaill
Lanitta
@DivaWeb
Jan 07 2016 01:56
hello all
abhaill
@abhaill
Jan 07 2016 01:56
@LisaRamos Np. Happy coding!
Eina
@thelittleblacksmith
Jan 07 2016 01:57
hello @DivaWeb
frsRaza
@frsRaza
Jan 07 2016 01:57
function factorialize(num) {
  var n = 1;
  for (var i = 0; i <= num; i++) {
    n *= 1;
  }
  return num;
}

factorialize(5);
factorialize(10);
factorialize(20);
factorialize(0);
what am I missing?
Maxwell Nare
@maxinare
Jan 07 2016 01:57
Im gonna quit for the day as im stuck on the convert Fahrenheit, it gives me 33.8

function convert(celsius) {
// Only change code below this line
var fahrenheit = 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);

DJ
@qualitymanifest
Jan 07 2016 01:58
@frsRaza you're just multiplying n by 1.. which will always equal n
Paul
@izzo70
Jan 07 2016 01:58
@DevPoetsSociety copy paste code here then ???? is this right?
Bill
@kirah1314
Jan 07 2016 01:59
@maxinare you have to add your parameter celsius in your equation somewhere to make the function working
frsRaza
@frsRaza
Jan 07 2016 01:59
how do you multiply by increments? @qualitymanifest
DJ
@qualitymanifest
Jan 07 2016 01:59
@frsRaza you'll want to multiply n by i, but not initialize i at 0 since anything times 0 is 0
@frsRaza i is your iterator here, being incremented by one for each loop cycle
Maxwell Nare
@maxinare
Jan 07 2016 02:00
@kirah1314 dont wanna lie bro , Im dead lost when you start mentioning parameters now, what celcius
Paul
@izzo70
Jan 07 2016 02:00
can anyone help me with pasting code into the chat so it stays in black like on code camp? ive heard 3 back ticks but thats not working. im obviously doing something wrong.
frsRaza
@frsRaza
Jan 07 2016 02:01
@qualitymanifest if I initialize i = 1 I still get the same answer
DJ
@qualitymanifest
Jan 07 2016 02:01
@frsRaza yeah because you're returning num not n
Brian
@sludge256
Jan 07 2016 02:02
@izzo70 Is it not allowing you to submit the message when you're done?
Paul
@izzo70
Jan 07 2016 02:02

```var count = 0;

function cc(card) {
// Only change code below this line
switch (card) {
case 2:
case 3:
case 4:
case 5:
case 6:
currentCount = count ++ ;
break;
case 7:
case 8:
case 9:
currentCount = count ;
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
currentCount = count -- ;

}

console.log(currentCount);
if (currentCount > 0) {
return "Bet";
}
else if (currentCount < 0 || currentCount === 0) {
return "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'); ```

Jamie Walker
@Chaymee
Jan 07 2016 02:02

// Setup
var myArr = [1,2,3,4,5];

function queue(arr, item) {
  // Your code here
  var removed;
  removed = arr.shift();
  arr.push(item);
  return removed;  // Change this line
}

// Display Code
console.log("Before: " + JSON.stringify(myArr));
console.log(queue(myArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(myArr));
I am stuck getting queue([], 1) to return 1. all other parts return correctly
Paul
@izzo70
Jan 07 2016 02:02
@sludge256 this is what i got
Brian
@sludge256
Jan 07 2016 02:02
@izzo70 make sure to use shift+enter after and before each ``` to ensure they're on their own line
You can also go back and edit your message
Bill
@kirah1314
Jan 07 2016 02:02
@maxinare this one:
function convert(celsius)
as part of the function, it receives a parameter/argument and if you look at the bottom you'll see
convert(-30);
which means you're entering -30 as celsius and your function is going to convert this -30 celsius into fahrenheit
frsRaza
@frsRaza
Jan 07 2016 02:03
@qualitymanifest still not working :/
CompGeekGirl
@LisaRamos
Jan 07 2016 02:03

I am not getting Waypoint: Access MultiDimensional Arrays With Indexes. I don't know what I'm doing here but I'm having difficulty.

How do I fix this code so that way it would go through?

// Setup
var myArray = [[1,2,3], [4,5,6], [7,8,9], [[10,11,12], 13, 14]];

// Only change code below this line.
var myData = myArray[2][4];

Brian
@sludge256
Jan 07 2016 02:04
@izzo70 if you start your message with ``` then press shift+enter, paste your code, then ctrl+enter it should be formatted fine
Bill
@kirah1314
Jan 07 2016 02:04
@maxinare read more about functions here http://www.w3schools.com/js/js_functions.asp
Maxwell Nare
@maxinare
Jan 07 2016 02:04
@kirah1314 it must give me -22 when I use -30
Paul
@izzo70
Jan 07 2016 02:04

```var count = 0;

function cc(card) {
// Only change code below this line
switch (card) {
case 2:
case 3:
case 4:
case 5:
case 6:
currentCount = count ++ ;
break;
case 7:
case 8:
case 9:
currentCount = count ;
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
currentCount = count -- ;

}

console.log(currentCount);
if (currentCount > 0) {
return "Bet";
}
else if (currentCount < 0 || currentCount === 0) {
return "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');
```

DJ
@qualitymanifest
Jan 07 2016 02:04
@frsRaza are you multiplying by 1 still?
Maxwell Nare
@maxinare
Jan 07 2016 02:04
thanks will do so @kirah1314
CamperBot
@camperbot
Jan 07 2016 02:04
maxinare sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 767 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Brian
@sludge256
Jan 07 2016 02:05
@izzo70 just the top one now
Bill
@kirah1314
Jan 07 2016 02:05
@maxinare so just add the parameter celsius in your equation as shown on the left instructions section
Brian
@sludge256
Jan 07 2016 02:05
you can edit your old messages instead of sending a new one also
so it doesn't spam chat
frsRaza
@frsRaza
Jan 07 2016 02:05
@qualitymanifest what should I be multiplying by? I've tried n*=num but it's not making sense
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:05
@izzo70 You have to return something
DJ
@qualitymanifest
Jan 07 2016 02:05
@frsRaza like i said, you need to multiply n *= i since i is the number that changes each loop cycle and n is where you want to store that math
Paul
@izzo70
Jan 07 2016 02:07
@sludge256 can you type it out for me phoneticlly if you get a chance
frsRaza
@frsRaza
Jan 07 2016 02:07
@qualitymanifest that fixed it. Thanks man! Still don't properly understand the code though. if my local variable or variable inside the loop is initialized = 0 then it wont work. But it will when they are BOTH initialized to 1.
CamperBot
@camperbot
Jan 07 2016 02:07
:star: 735 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
frsraza sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
Brian
@sludge256
Jan 07 2016 02:08
var count = 0;
function cc(card) {
// Only change code below this line
switch (card) {
case 2:
case 3:
case 4:
case 5:
case 6:
currentCount = count ++ ;
break;
case 7:
case 8:
case 9:
currentCount = count ;
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
currentCount = count -- ;
}
console.log(currentCount);
if (currentCount > 0) {
return "Bet";
}
else if (currentCount < 0 || currentCount === 0) {
return "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');
@izzo70
DJ
@qualitymanifest
Jan 07 2016 02:08
@frsRaza if you multiply anything by 0 the answer is 0. so if you start out multiplying by 0 the number will be 0 from then on out.
frsRaza
@frsRaza
Jan 07 2016 02:10
@qualitymanifest thanks again
CamperBot
@camperbot
Jan 07 2016 02:10
frsraza sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: frsraza already gave qualitymanifest points
Brian
@sludge256
Jan 07 2016 02:10
if you quote that message in the top right near the time stamp you can see the formatting but remove the first >
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:10
Everyone card counting: you can leave 7-9 out entirely. It does nothing. Change the global count variable directly.
That is: No need for a local function variable with this.
CompGeekGirl
@LisaRamos
Jan 07 2016 02:11
How do you make myData equal to 8 on Waypoint: Access MultiDimensional Arrays With Indexes?
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:13
@LisaRamos You can stack indexes.
So, myArray[0][0] gets the first element of the first sub-array in myArray.
CompGeekGirl
@LisaRamos
Jan 07 2016 02:13
@DevPoetsSociety How do you stack indexes?
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:14
Just like I did. myArray0 gets the second element of the first sub-array in myArray.
WTF?
zou difan
@zoudifan
Jan 07 2016 02:15
hello world!
CamperBot
@camperbot
Jan 07 2016 02:15

welcome to FreeCodeCamp @zoudifan!

DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:15
myArray0
Some formatting weirdness there.
Spencer
@SwedishFoot
Jan 07 2016 02:15
Can anyone possibly give me a hand with one of my bootstrap exercises?
Sabbir-Noire
@Sabbir-Noire
Jan 07 2016 02:15
I am having a problem in Waypoint: Set the ID of an Element
can anyone help ?
CompGeekGirl
@LisaRamos
Jan 07 2016 02:16
@DevPoetsSociety I'm still getting confused. :worried:
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:16
Dammit. Code's getting wonky. Hang on.
Manish Giri
@Manish-Giri
Jan 07 2016 02:17
@Sabbir-Noire what’s your question
Mustafa
@Coder-Mustafa
Jan 07 2016 02:17
Hi!!! friends
CompGeekGirl
@LisaRamos
Jan 07 2016 02:17
@DevPoetsSociety Okay
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:17
myArray[1][0]
Goes to the second sub-array and gets the first element.
Spencer
@SwedishFoot
Jan 07 2016 02:17
image.png
mauroyamaguchi
@mauroyamaguchi
Jan 07 2016 02:17
@kirah1314 thanks!
CamperBot
@camperbot
Jan 07 2016 02:17
mauroyamaguchi sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 768 | @kirah1314 | http://www.freecodecamp.com/kirah1314
CompGeekGirl
@LisaRamos
Jan 07 2016 02:18
@DevPoetsSociety What I got was 4 when I typed that in.
Mustafa
@Coder-Mustafa
Jan 07 2016 02:18
i have just completed my html5 and css in freecodecamp learning, should i refer other materials for learning or what i have learnt here is enough ??
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:18
@LisaRamos Yeah, use the concept and work it out
@Coder-Mustafa Refer to other material. This is great but you have to work stuff out yourself after a point.
Mustafa
@Coder-Mustafa
Jan 07 2016 02:20
@DevPoetsSociety thank you !!!
CamperBot
@camperbot
Jan 07 2016 02:20
coder-mustafa sends brownie points to @devpoetssociety :sparkles: :thumbsup: :sparkles:
:star: 264 | @devpoetssociety | http://www.freecodecamp.com/devpoetssociety
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:21
np
Spencer
@SwedishFoot
Jan 07 2016 02:22
@DevPoetsSociety can you give me a hand with my current exercise?
Quin
@quintonp
Jan 07 2016 02:22
Waypoint: Override Class Declarations by Styling ID Attributes
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:22
@quintonp I'm about to change locations, but post your code and someone will jump in.
Quin
@quintonp
Jan 07 2016 02:23

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

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

Spencer
@SwedishFoot
Jan 07 2016 02:24
image.png
Eina
@thelittleblacksmith
Jan 07 2016 02:24
@quintonp you need to assign an id
Quin
@quintonp
Jan 07 2016 02:25
@thelittleblacksmith after h1 class?
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:25
^
Eina
@thelittleblacksmith
Jan 07 2016 02:25
@quintonp currently you have orange-text as a class and are calling it as a class. so you need to make it an id and then add a id="orange-text"in your h1
Look at the brown-text example they give you, that's what you have to do
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:26
@SwedishFoot Make sure the icons have a </i> in there (even if there's nothing b/t them.
DJ
@qualitymanifest
Jan 07 2016 02:27
@SwedishFoot also it looks like you got rid of type = "submit" inside your button and instead put "submit" in the button's class
@SwedishFoot and you didn't give input the class form-control
Spencer
@SwedishFoot
Jan 07 2016 02:29
@qualitymanifest can you give me an example? I've tried to do it every way I can think of but I keep butchering it beyond all belief
CompGeekGirl
@LisaRamos
Jan 07 2016 02:30

@DevPoetsSociety I'm still going nuts here. I've tried to find other sources on how to do this and there's nothing that relates to it. How do I get myData to equal 8?

// Setup
var myArray = [[1,2,3], [4,5,6], [7,8,9], [[10,11,12], 13, 14]];

// Only change code below this line.
var myData = myArray[1][3];

DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:31
@LisaRamos The first index ([n]) refers to the sub-array. The second to the element within that sub-array. Just count.
From zero, remember.
CompGeekGirl
@LisaRamos
Jan 07 2016 02:32

I tried doing this.

var myData = myArray([0])[1][3];

It said myArray is not a function.

Manish Giri
@Manish-Giri
Jan 07 2016 02:33
@LisaRamos what’s the question ask to do
Eina
@thelittleblacksmith
Jan 07 2016 02:33
@LisaRamos that's because you have a parenthesis there
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:33
It's not. drop the ()
You don't need to reference every array. Drop the [0], but count from zero.
CompGeekGirl
@LisaRamos
Jan 07 2016 02:34
@DevPoetsSociety I dropped the parenthesis @Manish-Giri The question asks read from myArray using bracket notation so that myData is equal to 8.
Eina
@thelittleblacksmith
Jan 07 2016 02:35
@LisaRamos first figure out what the location is of the sub-array that contains 8, then where is 8 in that sub-array myArray[location of 8's array][location of 8 in that array]
DevPoetsSociety
@DevPoetsSociety
Jan 07 2016 02:35
OK, need to move. GL!
Eina
@thelittleblacksmith
Jan 07 2016 02:35
See ya @DevPoetsSociety
Manish Giri
@Manish-Giri
Jan 07 2016 02:36
@LisaRamos if var myArray = [[1,2,3], [4,5,6], [7,8,9], [[10,11,12], 13, 14]];, and you need to fetch 8, then first get the 3rd array, and the second element in the third array - myArray[2][1];
CompGeekGirl
@LisaRamos
Jan 07 2016 02:37
@Manish-Giri I got it. I was very confused. Thanks.
CamperBot
@camperbot
Jan 07 2016 02:37
lisaramos sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star: 575 | @manish-giri | http://www.freecodecamp.com/manish-giri
Timmie J Kenneh
@texantim7777
Jan 07 2016 02:41
Waypoint: Storing Values with the Equal Operator I'm having trouble with a should be assigned to b with =
Jacob Andra
@jacob4
Jan 07 2016 02:41

So, for the Record Collection checkpoint, the starting code, before I've done anything, is:

// 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) {


  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");

The instructions say to write a function which takes an id, a property (prop), and a value. Looking at the collection object, the id is obviously the 4 digit number preceding each album object. However, what is the property and what is the value?

Spencer
@SwedishFoot
Jan 07 2016 02:42
image.png
cannelflow
@cannelflow
Jan 07 2016 02:42
@texantim7777 Assign the contents of a to variable b. means simply b=a;
@SwedishFoot its better if you paste your formatted code here
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 02:43
@jacob4 If you could see a function named update you are passing parameters such as prop and value.
Spencer
@SwedishFoot
Jan 07 2016 02:43
<form action="/submit-cat-photo">
<div class="row">
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
</div>
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
</div>
</div>
<div class="row">
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Loving</label>
</div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Lazy</label>
</div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Crazy</label>
</div>
</div>
<input type="text" placeholder="cat photo URL" required>
<input type="form-control">
<button type="submit">Submit<i class="fa fa-paper-plane"></i></button>
</form>
</div>
Alexander Køpke
@alexanderkopke
Jan 07 2016 02:44
@jacob4 [prop] would be album, artist, tracks. value would be "1999", "Prince", the array of ["1999", "Little Red Corvette"] etc
Jacob Andra
@jacob4
Jan 07 2016 02:44
@jelocanlas Oh, so a property might be "artist" and a value might be "ABBA"? Like that?
Timmie J Kenneh
@texantim7777
Jan 07 2016 02:44
thanks!!! cannel
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 02:45
@jacob4 yup. Its the property of the object and the value of the said property
cannelflow
@cannelflow
Jan 07 2016 02:45
@SwedishFoot add class like this in submit<button type="submit fa fa-paper-plane">Submit<</i></button>
CompGeekGirl
@LisaRamos
Jan 07 2016 02:45

Checkpoint: Shopping List trouble. It says that there should be 5 arrays in the list and that the second elements in each sub-array should be numbers. I'm having difficulty and I would like for someone to explain how I can correct this code I have here.

var myList = ["Banana", "Mango", "Pineapple", "Kale", "Spinach"];
var list = myList.slice(5);

John Irle
@JohnIrle
Jan 07 2016 02:45
I need help with Accessing Nested Arrays in JSON.
Jacob Andra
@jacob4
Jan 07 2016 02:46
Thanks, @alexanderkopke @jelocanlas helps a lot
CamperBot
@camperbot
Jan 07 2016 02:46
jacob4 sends brownie points to @alexanderkopke and @jelocanlas :sparkles: :thumbsup: :sparkles:
:star: 392 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
:star: 236 | @jelocanlas | http://www.freecodecamp.com/jelocanlas
Jacob Andra
@jacob4
Jan 07 2016 02:46
Why are brownies not being served?
Spencer
@SwedishFoot
Jan 07 2016 02:46
image.png
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 02:46

@SwedishFoot Hi there. Try replacing the 3 and 4 from the last line of your code from

<input type="form-control">

<button type="submit">Submit<i class="fa fa-paper-plane"></i></button>

to

<input type="text" class="form-control">

<button type="submit" class="btn primary">Submit<i class="fa fa-paper-plane"></i></button>

scottmike0
@scottmike0
Jan 07 2016 02:46
@SwedishFoot you are missing the part of adding classes.
Jacob Andra
@jacob4
Jan 07 2016 02:47
Serve some brownies to my friends @alexanderkopke and @jelocanlas. Thanks!
CamperBot
@camperbot
Jan 07 2016 02:47
jacob4 sends brownie points to @alexanderkopke and @jelocanlas :sparkles: :thumbsup: :sparkles:
:warning: jacob4 already gave jelocanlas points
:warning: jacob4 already gave alexanderkopke points
Jacob Andra
@jacob4
Jan 07 2016 02:47
Perhaps the brownie elves are napping
scottmike0
@scottmike0
Jan 07 2016 02:47
@SwedishFoot when it says submit button, it is refering to the type.
Jacob Andra
@jacob4
Jan 07 2016 02:47
Or the oven is down
Alexander Køpke
@alexanderkopke
Jan 07 2016 02:48
they have to bake them first xD
Franco Zapata
@Francozt01
Jan 07 2016 02:48
u already gave brownie points to them
Jacob Andra
@jacob4
Jan 07 2016 02:48
Anyone else experiencing this?
cannelflow
@cannelflow
Jan 07 2016 02:48
@SwedishFoot worked ?
Alexander Køpke
@alexanderkopke
Jan 07 2016 02:48
happens sometimes.
Rick Markins
@rkmarks
Jan 07 2016 02:49
// Setup
var myArr = [1,2,3,4,5];

function queue(arr, item) {
  // Your code here
  arr = myArr.push(item);
  myArr.shift();
  return item;  // Change this line
}

// Display Code
console.log("Before: " + JSON.stringify(myArr));
console.log(queue(myArr[2], 1)); // Modify this line to test
console.log("After: " + JSON.stringify(myArr));
Stuck on Checkpoint stand in line. I am passing the 1st and last checkmarks but queue(2, 1) should return 2 is not passing. Anyone mind helping out?
John Irle
@JohnIrle
Jan 07 2016 02:49
Can anyone help me? with JSON?
Gabriel Dennis Parangan
@gparangan
Jan 07 2016 02:50
@rkmarks Item should be change by removing the arr
Franco Zapata
@Francozt01
Jan 07 2016 02:50
@rkmarks u have to return myArr.shift()
Spencer
@SwedishFoot
Jan 07 2016 02:50
@jelocanlas thank you so much, I appreciate it. I have been stuck for so long. been pulling hair out haha.
CamperBot
@camperbot
Jan 07 2016 02:50
swedishfoot sends brownie points to @jelocanlas :sparkles: :thumbsup: :sparkles:
Jacob Andra
@jacob4
Jan 07 2016 02:50
o
CamperBot
@camperbot
Jan 07 2016 02:50
:star: 237 | @jelocanlas | http://www.freecodecamp.com/jelocanlas
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 02:50
@jacob4 iam at that stage lol
cannelflow
@cannelflow
Jan 07 2016 02:50
@rkmarks its arr.shift() not myArr and return arr.shift()
John Irle
@JohnIrle
Jan 07 2016 02:51
// Setup
var myPlants = [
  { 
    type: "flowers",
    list: [
      "rose",
      "tulip",
      "dandelion"
    ]
  },
  {
    type: "trees",
    list: [
      "fir",
      "pine",
      "birch"
    ]
  }  
];

// Only change code below this line

var secondTree = myPlants[1].trees[1]; // Change this
Jacob Andra
@jacob4
Jan 07 2016 02:51
For some reason the brownies were not showing up on my end until I refreshed @jelocanlas
scottmike0
@scottmike0
Jan 07 2016 02:51
@doudeman what is the goal of that code?
Franco Zapata
@Francozt01
Jan 07 2016 02:51
@doudeman the nested arrays you have toassign to the variable the location of the second tree in list
cannelflow
@cannelflow
Jan 07 2016 02:51
@doudeman we will try
John Irle
@JohnIrle
Jan 07 2016 02:51
I'm trying to access the second tree
Franco Zapata
@Francozt01
Jan 07 2016 02:51
@doudeman its ok just change the trees to list[1]
cuz the ype is trees
Rick Markins
@rkmarks
Jan 07 2016 02:52
@cannelflow I tried to make it arr.shift() but it states that arr.shift() is not a function.
Franco Zapata
@Francozt01
Jan 07 2016 02:52
but u want to acces the second tree and that tree is inside list
John Irle
@JohnIrle
Jan 07 2016 02:52
Wow that was too easy. Thanks @Francozt01
CamperBot
@camperbot
Jan 07 2016 02:52
doudeman sends brownie points to @francozt01 :sparkles: :thumbsup: :sparkles:
Jacob Andra
@jacob4
Jan 07 2016 02:52
@mukhtaarabdi You're working on the record collection?
Franco Zapata
@Francozt01
Jan 07 2016 02:52
the type is trees}
CamperBot
@camperbot
Jan 07 2016 02:52
:star: 434 | @francozt01 | http://www.freecodecamp.com/francozt01
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 02:52
i have no idea what am doing :(
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 (prop !==""){
  collection.push({"artist":"ABBA"});
}
  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");
cannelflow
@cannelflow
Jan 07 2016 02:53
@rkmarks worked?
Franco Zapata
@Francozt01
Jan 07 2016 02:53
@doudeman yeah
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 02:53
@jacob4 yeah
Rick Markins
@rkmarks
Jan 07 2016 02:53
@cannelflow nope
Jacob Andra
@jacob4
Jan 07 2016 02:53
@mukhtaarabdi Are you getting it?
Eina
@thelittleblacksmith
Jan 07 2016 02:53
@mukhtaarabdi you need to push in the parameters not the key/value pair
Franco Zapata
@Francozt01
Jan 07 2016 02:53
@mukhtaarabdi check if the prop is equal tracks and value is empty in the first if()
cannelflow
@cannelflow
Jan 07 2016 02:53
@doudeman which exercise
Franco Zapata
@Francozt01
Jan 07 2016 02:54
@mukhtaarabdi after that check if value is empty make the prop to have the value by pushing onto the end of prop and the third is to delete if prop is empty
Bootkit
@Bootkit
Jan 07 2016 02:54
so if i stuch somewhere can i ask there ?
stuck*
Jacob Andra
@jacob4
Jan 07 2016 02:55
@Bootkit That's what we're all here for ;)
cannelflow
@cannelflow
Jan 07 2016 02:55
This is what i did @rkmarks
// Setup
var myArr = [1,2,3,4,5];

function queue(arr, item) {
  // Your code here
/*  if(arr.length===0){
    return 1;
  }else{arr.push(item);}
  return arr.shift();  // Change this line
  */
  arr.push(item);
  return arr.shift();
}

// Display Code
console.log("Before: " + JSON.stringify(myArr));
console.log(queue(myArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(myArr));
Franco Zapata
@Francozt01
Jan 07 2016 02:55
@mukhtaarabdi use if () if else () and if else () again
Bootkit
@Bootkit
Jan 07 2016 02:56
@jacob4 ty
Franco Zapata
@Francozt01
Jan 07 2016 02:56
@rkmarks
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 02:56
@Francozt01 @thelittleblacksmith ok...
@Francozt01 yes but i was asking if the first if() is correct or not?
Franco Zapata
@Francozt01
Jan 07 2016 02:58
@rkmarks arr.push(item); is pushing the item into the end of the array and the u have to return the item u substracted of the begining of the array by using shift() ... u have to return arr.shift();
no
cannelflow
@cannelflow
Jan 07 2016 02:59
@rkmarks is it good now
Jacob Andra
@jacob4
Jan 07 2016 02:59
OK, help, please, with my record collection code:
    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 === "") {
    delete(this.prop);
  } 
  else if (this.prop === "tracks") {
    tracks.push(value);
  }
  else {
    update(this.prop(value));
  }


  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");
Rick Markins
@rkmarks
Jan 07 2016 02:59
working on it. i think my browser is being buggy @cannelflow . It makes sense now and it should work once my browser stops acting up.
Franco Zapata
@Francozt01
Jan 07 2016 03:00
@mukhtaarabdi @jacob4 you have to check if prop === "tracks" and if value is !== "" not empty
@jacob4 jacob u don't need to use this.prop
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 03:01
@Francozt01 like this?
if (prop !==""&&prop==="tracks"){
Franco Zapata
@Francozt01
Jan 07 2016 03:01
only prop
Jacob Andra
@jacob4
Jan 07 2016 03:01
@Francozt01 So, for my own learning, why can't I check if it IS empty and delete it if so?
Franco Zapata
@Francozt01
Jan 07 2016 03:02
@mukhtaarabdi one for prop and the other for value the first should be value !== "" cuz u already wrote prop === "tracks" in the second
Rick Markins
@rkmarks
Jan 07 2016 03:02
@cannelflow finally worked after i switched to a private browser. dang caching lol
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 03:03
@Francozt01 lool omg i didnt notice that :D
Rick Markins
@rkmarks
Jan 07 2016 03:03
@Francozt01 & @cannelflow thanks for the help.
CamperBot
@camperbot
Jan 07 2016 03:03
rkmarks sends brownie points to @francozt01 and @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 320 | @cannelflow | http://www.freecodecamp.com/cannelflow
:star: 435 | @francozt01 | http://www.freecodecamp.com/francozt01
Franco Zapata
@Francozt01
Jan 07 2016 03:03
@jacob4 without using this. before prop i did the same structure but it requires to be first prop === "tracks" && value !== "" i don't know why
but that's the way it worked
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 03:04
hey @jacob4 you are missing a condition on your second if statement
Franco Zapata
@Francozt01
Jan 07 2016 03:04
@rkmarks np bro
Jacob Andra
@jacob4
Jan 07 2016 03:04
@Francozt01 I can't remember the syntax: is it prop.delete or delete.prop or what?
cannelflow
@cannelflow
Jan 07 2016 03:04
@rkmarks yes maybe that was the case refresh it and then try
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 03:04
@jacob4 delete.prop
Franco Zapata
@Francozt01
Jan 07 2016 03:04
delete space prop but not only the word prop
@jacob4 you need the location of prop in this case should be collection[id][prop];
Jacob Andra
@jacob4
Jan 07 2016 03:08
@Francozt01 @jelocanlas thanks for the help! Another question: I'm getting an error in trying to call update. Can you see what I need to do differently?
else {
    update collection[id][prop];
  }
CamperBot
@camperbot
Jan 07 2016 03:08
jacob4 sends brownie points to @francozt01 and @jelocanlas :sparkles: :thumbsup: :sparkles:
:warning: jacob4 already gave jelocanlas points
:star: 436 | @francozt01 | http://www.freecodecamp.com/francozt01
Franco Zapata
@Francozt01
Jan 07 2016 03:08
@jacob4 @mukhtaarabdi for you too this checkpoint ask you to use the location of id prop and value you need to use collection (the object that contains the record collection) the second item to idetify is the ''id'' that u have as a parameter in this case is the number of each record and the property of that record is the artist you are receiving as a parameter
@jacob4 you don't need to use the word update cuz the function will update with the if statement and if else u have to do to pass this exercise

For the given id in collection:

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.

Matt Fay
@username1001
Jan 07 2016 03:12
Please help. What am I doing wrong. My second day working on this!!

var count = 0;

function cc(card) {
// Only change code below this line
switch(card) {
case 2:
case 3:
case 4:
case 5:
case 6:
card = "5 Bet";
break;
case 7:
case 8:
case 9:
card = "0 Hold";
break;
case 10:
case "J":
case "Q":
case "K":
case "A":
card = "-5 Hold";

}

if(card > 0) {
count++;
return "Bet";
}
else if(card <= 0){
count--;
return "Hold";
}

}

cc(2); cc(3); cc(7); cc('K'); cc('6');

Franco Zapata
@Francozt01
Jan 07 2016 03:12
@username1001 with?
ok
CompGeekGirl
@LisaRamos
Jan 07 2016 03:13

I'm still struggling with Checkpoint: Shopping List. It says there should be at least 5 sub-arrays in the list and that the second elements in the sub-arrays must be numbers. How am I going to do that? I tried to do what I can and it didn't go through.

var myList = ["Banana", "Mango", "Pineapple", "Kale", "Spinach"];
var list = myList.slice(5);

How can I fix this issue?

Matt Fay
@username1001
Jan 07 2016 03:13
@Francozt01 Sorry it took so long, I was removing the comments so it didn't clutter up the chat so much
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 03:14
@LisaRamos you should add items such as ["Banana",20],["Mango",25] and so on
mecotterman
@mecotterman
Jan 07 2016 03:14
This message was deleted
Franco Zapata
@Francozt01
Jan 07 2016 03:15
@username1001 you have modify your switch statement instead using card = "5 Bet" you need to make count increase positive 1 by each of that cases so you use count++; instead card = "5 Bet"
Talon
@t-hughes
Jan 07 2016 03:15
What am i doing wrong? <a href="http://freecatphotoapp.com">cat photos</a>
scottmike0
@scottmike0
Jan 07 2016 03:15
@username1001 do not look at the return on the left
@username1001 just refer to the instructions
CompGeekGirl
@LisaRamos
Jan 07 2016 03:16

@jelocanlas I've done that and I got an unexpected string message.

var myList = ["Banana", 20 "Mango", 25 "Pineapple", 30 "Kale", 35 "Spinach", 40];
var list = myList.slice(5);

What am I doing wron here?

Franco Zapata
@Francozt01
Jan 07 2016 03:16
@username1001 the second case of 7,8,9 ask you to make those cases to be equal 0 so you make count = 0;
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 03:16
@LisaRamos Enclose it in brackets
scottmike0
@scottmike0
Jan 07 2016 03:16
@username1001 the input was serously confusing, so just do what you have did in the previous waypoints
Matt Fay
@username1001
Jan 07 2016 03:16
@Francozt01 I just did it, it's still not doing anything.
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 03:16
[["Banana",20],["Mango",25]]
scottmike0
@scottmike0
Jan 07 2016 03:16
@username1001 also dont try to do it all in a switch statement
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 03:16
@LisaRamos
Franco Zapata
@Francozt01
Jan 07 2016 03:17
@username1001 wait. the third have to decrease 1 by each case, make count--; to decrease -1 by each card
Matt Fay
@username1001
Jan 07 2016 03:17
@scottmike0 Can you tell me what I'll need? I was thinking a for loop, but I tried and failed :worried:
Talon
@t-hughes
Jan 07 2016 03:18
What am I doing wrong with this anchor? <a href="http://freecatphotoapp.com">cat photos</a>
greg
@wearenotgroot
Jan 07 2016 03:18
@username1001 you need to increment or decrement the counter then test it with if after war then return count + " Hold" else return count + " Bet"
scottmike0
@scottmike0
Jan 07 2016 03:18
@username1001 remember, the previous waypoint, you were using switch statements, so you will aim to use switch statements, and also a conditional :P
@username1001 that should help ya in understanding what you will use :D
greg
@wearenotgroot
Jan 07 2016 03:19
@username1001 replace card = "5 Bet" with count++ and the other one with count--
Franco Zapata
@Francozt01
Jan 07 2016 03:19
@username1001 in my case i used if statements to determinate if a count is positive to concat the count + string with the word " Bet" or "Hold" depending on the negative or positive values
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 03:19
@LisaRamos have you done it?
scottmike0
@scottmike0
Jan 07 2016 03:20
@Francozt01 did the same :P, but that kinda gives way the answer D:
Matt Fay
@username1001
Jan 07 2016 03:20
@Francozt01 Ok, got it. I'm definitely going to figure this out tonight. @wearenotgroot Ah, I think I got you. And @scottmike0 Alright, I will check them out!
Jacob Andra
@jacob4
Jan 07 2016 03:20
OK, here's what I've got. Are my if and else if statements right? Also, what should I be doing for my final else statement?
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 !== "" && prop === "tracks") {
    tracks.push(value);
  } 
  else if (prop === "") {
    delete collection[id][prop];
  }
  else {

  }


  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");
Talon
@t-hughes
Jan 07 2016 03:20
Can anyone tellme what I am doing wrong-seems simple but it wont submit. <a href="http://freecatphotoapp.com">cat photos</a>
scottmike0
@scottmike0
Jan 07 2016 03:20
@t-hughes what is the instructions?
greg
@wearenotgroot
Jan 07 2016 03:21
@t-hughes which exercise?
Matt Fay
@username1001
Jan 07 2016 03:21
@Francozt01 That's what I think I understand you. JS is soo confusing haha
Thank you everyone for replying. Though, I'll probably be back in a few minutes...
Franco Zapata
@Francozt01
Jan 07 2016 03:21
@username1001 use if statements and if the condition is what the exercise ask you to return the respective string " Bet" or " Hold" concat using with the count
scottmike0
@scottmike0
Jan 07 2016 03:21
@username1001 tell me how it goes :P
Talon
@t-hughes
Jan 07 2016 03:21
@scottmike0 @wearenotgroot it is either 27 or 28-wants meto ancho "cat photos" to the link
Alexander Køpke
@alexanderkopke
Jan 07 2016 03:23
@jacob4 there is one more instruction: If value is non-blank (value !== ""), then update or set the value for the prop.
Franco Zapata
@Francozt01
Jan 07 2016 03:23
@scottmike0 some exercises are very stressful
scottmike0
@scottmike0
Jan 07 2016 03:23
@Francozt01 but thats where the going gets tough :D
@Francozt01 I was confused until i ignored the input and just read the instructions
CompGeekGirl
@LisaRamos
Jan 07 2016 03:24

I still don't know what I'm doing with this Checkpoint: Shopping List.

var myList = ["Banana", 20, "Mango", 25, "Pineapple", 30, "Kale", 35, "Spinach", 40];
var list = myList.slice(5);

http://www.freecodecamp.com/challenges/checkpoint-shopping-list#?solution=var%20myList%20%3D%20%5B%22Banana%22%2C%2020%2C%20%22Mango%22%2C%2025%2C%20%22Pineapple%22%2C%2030%2C%20%22Kale%22%2C%2035%2C%20%22Spinach%22%2C%2040%5D%3B%0Avar%20list%20%3D%20myList.slice(5)%3B%0A%20

Jocelyn
@jocelyn-ong
Jan 07 2016 03:24
@t-hughes do you get all the green checkmarks?
piggsoft
@piggsoft
Jan 07 2016 03:24
hello, all, i`m pigg
Eina
@thelittleblacksmith
Jan 07 2016 03:24
@LisaRamos you need to make arrays inside that array
greg
@wearenotgroot
Jan 07 2016 03:24
@t-hughes post the instruction si it be easier to locate
Talon
@t-hughes
Jan 07 2016 03:24
@jocelyn-ong no it is telling me that I am not anchoring to the text "cat photos"
Jacob Andra
@jacob4
Jan 07 2016 03:24
@alexanderkopke Right, but what is the syntax? @Francozt01 said not to use update.
CompGeekGirl
@LisaRamos
Jan 07 2016 03:24
@thelittleblacksmith Now how do I do that?
Eina
@thelittleblacksmith
Jan 07 2016 03:24
so [[fruit, number], [fruit, number ]] @LisaRamos
Jacob Andra
@jacob4
Jan 07 2016 03:24
@piggsoft hi pigg
scottmike0
@scottmike0
Jan 07 2016 03:24
@t-hughes can you copy and paste the instructions?
Talon
@t-hughes
Jan 07 2016 03:25
-Your a element should have the anchor text of "cat photos".
-You need an a element that links to http://freecatphotoapp.com
-Make sure your a element has a closing tag.
scottmike0
@scottmike0
Jan 07 2016 03:25
@t-hughes you are making a text
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 03:25
@LisaRamos var myList = [["Banana", 20], ["Mango", 25], ["Pineapple", 30], ["Kale", 35], ["Spinach", 40]];
var list = myList.slice(5);
scottmike0
@scottmike0
Jan 07 2016 03:26
@t-hughes thats all ya had to do, is put Cat photos
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 03:26
@LisaRamos Sorry for not making things clear on my first response. But this should do it.
Eina
@thelittleblacksmith
Jan 07 2016 03:26
@LisaRamos why is there a slice method there?
Jacob Andra
@jacob4
Jan 07 2016 03:26
@alexanderkopke I feel ridiculous, like the update syntax in my else function should be something I already know, but for now, this is what I've got. I know it's not right, but I'm grasping at straws.
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 !== "" && prop === "tracks") {
    tracks.push(value);
  } 
  else if (prop === "") {
    delete collection[id][prop];
  }
  else {
    collection[id][prop] = collection[id][value];
  }


  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");
Jelo Lawrence C. Canlas
@jelocanlas
Jan 07 2016 03:26
@thelittleblacksmith there should really be a slice because exercises change almost everyday.
Franco Zapata
@Francozt01
Jan 07 2016 03:26
@scottmike0 hahaha sometimes we don't read carefully the instructions, and the result is that take longer to pass the exercises
Jocelyn
@jocelyn-ong
Jan 07 2016 03:26
@t-hughes your code works fine for me though
greg
@wearenotgroot
Jan 07 2016 03:27
@t-hughes maybe put the <img> between the <a>
Eina
@thelittleblacksmith
Jan 07 2016 03:27
@jelocanlas ah make sense, i was just wondering since i don't have it on mine haha
CompGeekGirl
@LisaRamos
Jan 07 2016 03:27
@thelittleblacksmith Now I got it. Thanks.
CamperBot
@camperbot
Jan 07 2016 03:27
lisaramos sends brownie points to @thelittleblacksmith :sparkles: :thumbsup: :sparkles:
Jocelyn
@jocelyn-ong
Jan 07 2016 03:27
@t-hughes how's the rest of your code look like?
CamperBot
@camperbot
Jan 07 2016 03:27
:star: 200 | @thelittleblacksmith | http://www.freecodecamp.com/thelittleblacksmith
Talon
@t-hughes
Jan 07 2016 03:27
@jocelyn-ong hmm, must be a bug-I thought it was correct, but it wasn't submitting
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 03:27
@jacob4 i think the first if should be like this
if (value !==""){
  value=prop;
}
Alexander Køpke
@alexanderkopke
Jan 07 2016 03:27
 else if(value !== ""){
    collection[id][prop] = value;
        }
this is what I did.
Jocelyn
@jocelyn-ong
Jan 07 2016 03:27
@t-hughes try refreshing your page. sometimes the submission doesn't work for me too
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 03:28
@alexanderkopke but there's no prop in that id
Talon
@t-hughes
Jan 07 2016 03:28
Thanks @jocelyn-ong @wearenotgroot @scottmike0
CamperBot
@camperbot
Jan 07 2016 03:28
t-hughes sends brownie points to @jocelyn-ong and @wearenotgroot and @scottmike0 :sparkles: :thumbsup: :sparkles:
:star: 236 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
:star: 234 | @scottmike0 | http://www.freecodecamp.com/scottmike0
:star: 415 | @jocelyn-ong | http://www.freecodecamp.com/jocelyn-ong
scottmike0
@scottmike0
Jan 07 2016 03:28
@Francozt01 all i know is in that checkpoint, screw those return stuff
Billboz
@Billboz
Jan 07 2016 03:29
I can't figure this pattern out. The last example that equals 11 and that doesn't make sense to me. Anyone understand how this pattern works well enough to explain it to me please?
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
arr[3][0][1]; // equals 11
Joe P
@JP50515
Jan 07 2016 03:29
Same question
Eina
@thelittleblacksmith
Jan 07 2016 03:30
@Billboz 11 is in the 4th item in arr
Alexander Køpke
@alexanderkopke
Jan 07 2016 03:30
@mukhtaarabdi I don't understand what you mean
Eina
@thelittleblacksmith
Jan 07 2016 03:30
then the array that contains 11 is the first item in that array
Jocelyn
@jocelyn-ong
Jan 07 2016 03:30
@Billboz arr3 gives you [[10,11,12], 13, 14]
Eina
@thelittleblacksmith
Jan 07 2016 03:30
then 11 is the second item in the array
scottmike0
@scottmike0
Jan 07 2016 03:30
@Billboz write the format exactly like the example
Jocelyn
@jocelyn-ong
Jan 07 2016 03:30
@Billboz then arr[3][0] gives you [10,11,12]
scottmike0
@scottmike0
Jan 07 2016 03:30
@Billboz it will make 100% more sense
Joe P
@JP50515
Jan 07 2016 03:30
@scottmike0 thanks dude that explained it
CamperBot
@camperbot
Jan 07 2016 03:30
jp50515 sends brownie points to @scottmike0 :sparkles: :thumbsup: :sparkles:
:star: 236 | @scottmike0 | http://www.freecodecamp.com/scottmike0
Jocelyn
@jocelyn-ong
Jan 07 2016 03:31
@Billboz then arr31 gives you 11
Alexander Køpke
@alexanderkopke
Jan 07 2016 03:31
@mukhtaarabdi The instructions said this: If value is non-blank (value !== ""), then update or set the value for the prop.
scottmike0
@scottmike0
Jan 07 2016 03:31
@alexanderkopke .prop removes the last piece of the array
Eina
@thelittleblacksmith
Jan 07 2016 03:32
backticks the square braces, markdown makes them links lol
scottmike0
@scottmike0
Jan 07 2016 03:32
@alexanderkopke it just gives you the option of doing one or the other
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 03:32
@alexanderkopke which is means this
if (value !==""){
  value=prop;
}
John Irle
@JohnIrle
Jan 07 2016 03:32
I need help with the record collection checkpoint.
// 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) {
  collection.id.prop = value;

  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");
Bill
@kirah1314
Jan 07 2016 03:32
@scottmike0 I believe .pop() does that, not .prop
Jocelyn
@jocelyn-ong
Jan 07 2016 03:32
@thelittleblacksmith haha okay thanks!
CamperBot
@camperbot
Jan 07 2016 03:32
jocelyn-ong sends brownie points to @thelittleblacksmith :sparkles: :thumbsup: :sparkles:
:star: 201 | @thelittleblacksmith | http://www.freecodecamp.com/thelittleblacksmith
scottmike0
@scottmike0
Jan 07 2016 03:32
@kirah1314 i was close :P
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 03:33
@doudeman try something lol
Franco Zapata
@Francozt01
Jan 07 2016 03:33
@jacob4 tracks.push should be »»» collection[id][prop].push(value); and the else u used at the end you need to make it an else if ( ) also the assignment of value to prop only needs to be collection[id][prop] = value; cuz u are assigning a parameter
Billboz
@Billboz
Jan 07 2016 03:33
Thanks! I was doing addition for some reason??? It is the position. thanks @jocelyn-ong @scottmike0 @thelittleblacksmith
CamperBot
@camperbot
Jan 07 2016 03:33
billboz sends brownie points to @jocelyn-ong and @scottmike0 and @thelittleblacksmith :sparkles: :thumbsup: :sparkles:
:star: 237 | @scottmike0 | http://www.freecodecamp.com/scottmike0
:star: 416 | @jocelyn-ong | http://www.freecodecamp.com/jocelyn-ong
:star: 202 | @thelittleblacksmith | http://www.freecodecamp.com/thelittleblacksmith
Alexander Køpke
@alexanderkopke
Jan 07 2016 03:34
@mukhtaarabdi well, I set the prop to the value too.. Yours is more slick I'll give you that :)
onlinehandyman
@onlinehandyman
Jan 07 2016 03:34
Hey Room was wondering if anyone could explain what I am doing wrong here
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 03:34
@alexanderkopke hhhhh
onlinehandyman
@onlinehandyman
Jan 07 2016 03:35

function convert(celsius) {
// Only change code below this line

celcius = convert;

var farhenheit = celcius 9/5;

farhrenheit = celcius;
farhrenheit = console.log

// 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);

Corey
@coreyjuliandavis
Jan 07 2016 03:35
@Francozt01 doesn’t push not work because it is an object?
Jacob Andra
@jacob4
Jan 07 2016 03:35
@Francozt01 @alexanderkopke Whew! That was rough but I got it with some help! Thanks!
CamperBot
@camperbot
Jan 07 2016 03:35
jacob4 sends brownie points to @francozt01 and @alexanderkopke :sparkles: :thumbsup: :sparkles:
:warning: jacob4 already gave alexanderkopke points
:warning: jacob4 already gave francozt01 points
John Irle
@JohnIrle
Jan 07 2016 03:35
@mukhtaarabdi I did try something.
scottmike0
@scottmike0
Jan 07 2016 03:36
@onlinehandyman the instructions say celsius times 9/5 + 32, is the equation for farenheit
Alexander Køpke
@alexanderkopke
Jan 07 2016 03:36
@onlinehandyman your calculation isn't quite right
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 03:36
@onlinehandyman check the formula in description very well
Alexander Køpke
@alexanderkopke
Jan 07 2016 03:36
@jacob4 good job!
onlinehandyman
@onlinehandyman
Jan 07 2016 03:37
ok so should be on one line? let me try it
getting unexpected number
Bill
@kirah1314
Jan 07 2016 03:38
@onlinehandyman post your updated codes?
scottmike0
@scottmike0
Jan 07 2016 03:38
@onlinehandyman what i mean is, celsius * 9/5 + 32;
@onlinehandyman did you forget to make sure farenheit is a variable?
Franco Zapata
@Francozt01
Jan 07 2016 03:40
@coreyjuliandavis you have to work with the location of the property which u are going to push the value to that's why u use the object name collection[id][prop] «« that property and id are the parameters gave to locate the property of X artist if the artist don't have a name the value (name of the artist ) will be pushed into the location of collection[record number][artist][name] ««
@jacob4 done?
greg
@wearenotgroot
Jan 07 2016 03:41
anyone solve has solved this?

// 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;
}
else if (prop === "tracks" && value !== "") {
collection[id][prop].tracks.push(value);
}
else if(value === ""){
delete collection[id][prop];
}
return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");

Jacob Andra
@jacob4
Jan 07 2016 03:41
@wearenotgroot haha just did that one
Franco Zapata
@Francozt01
Jan 07 2016 03:42
@wearenotgroot u just need to change the second stamente the if else to the first if stamente and visevera
greg
@wearenotgroot
Jan 07 2016 03:42
@jacob4 still got one error
@Francozt01 ok thanks
CamperBot
@camperbot
Jan 07 2016 03:42
wearenotgroot sends brownie points to @francozt01 :sparkles: :thumbsup: :sparkles:
:star: 437 | @francozt01 | http://www.freecodecamp.com/francozt01
Franco Zapata
@Francozt01
Jan 07 2016 03:42
just change the positions from 1 to 2 and 2 to 1
np good luck
Jacob Andra
@jacob4
Jan 07 2016 03:43

by the way, if you post your code in code format like so:

var ourArray = [];

for (var i = 0; i < 5; i++) {
  ourArray.push(i);
}

// Setup
var myArray = [];

it is much easier to parse. You do it by placing three backtick symbols before and three after the code

Talon
@t-hughes
Jan 07 2016 03:43
Remove the last two p elements and create an unordered list of three things that cats love at the bottom of the page.
Jacob Andra
@jacob4
Jan 07 2016 03:43
just fyi @wearenotgroot :)
Franco Zapata
@Francozt01
Jan 07 2016 03:43
also @wearenotgroot delete tracks word from collection[id][prop].tracks.push(value);
Talon
@t-hughes
Jan 07 2016 03:44

Remove the last two p elements and create an unordered list of three things that cats love at the bottom of the page.

<ul>
<li>Playing with yarn</li>
<li>Drinking milk</li>
<li>Not giving af</li>
</ul>

:clap:

Franco Zapata
@Francozt01
Jan 07 2016 03:44
you don't need to use that.. just the location of collection[id][prop].push(value);
@wearenotgroot read up
delete tracks from collection[id][prop].tracks.push(value);
scottmike0
@scottmike0
Jan 07 2016 03:46
In what case do you have a semicolon after a circle bracket?
Dieudonne Mukunzi
@MukunziChild
Jan 07 2016 03:47
Hi folks, what is a script element? I'm starting JQuery and I want to add the .ready function but don't know where
h4r1m4u
@h4r1m4u
Jan 07 2016 03:48
@MukunziTinHorizon
<script>
// the JS code, including the doc.ready function, goes here
</script>
Pablo K
@pablok47
Jan 07 2016 03:48
hello...can someone help me figure out why this is not passing through....

// Setup
function phoneticLookup(val) {
var result = "";

// Only change code below this line

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

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

// Change this value to test
phoneticLookup(lookup["charlie"]);

scottmike0
@scottmike0
Jan 07 2016 03:49
@pablok47 workin on the same one, try placing result under each call :P
Dieudonne Mukunzi
@MukunziChild
Jan 07 2016 03:49
Thanks @h4r1m4u
CamperBot
@camperbot
Jan 07 2016 03:49
mukunzitinhorizon sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1243 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Jan 07 2016 03:50
@pablok47 that's not the way it should be done. you should use val, the argument passed to the function, inside the function to get the property value from the lookup object. so the function should be called as phoneticLookup("charlie")
Pablo K
@pablok47
Jan 07 2016 03:51
@scottmike0 im confused on where to place the return result
h4r1m4u
@h4r1m4u
Jan 07 2016 03:51
@pablok47 all you need to do is to use val to get the property value from lookup inside the function and store it in result before you return it from the function
milpool
@milpool
Jan 07 2016 03:53
Waypoint: Escape Sequences in Strings. I don't understand what is wanted.
Pranav Doshi
@pranavdoshi
Jan 07 2016 03:53
@milpool try getting help from the camper bot
milpool
@milpool
Jan 07 2016 03:53
what is that?
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 03:54
help
CamperBot
@camperbot
Jan 07 2016 03:54

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

Pranav Doshi
@pranavdoshi
Jan 07 2016 03:55
@milpool can u post the waypoint link
milpool
@milpool
Jan 07 2016 03:55
Waypoint: Escape Sequences in Strings
Franco Zapata
@Francozt01
Jan 07 2016 03:55
@scottmike0 after declare the variable lookup and make it an object u need to return lookup[val]
Pranav Doshi
@pranavdoshi
Jan 07 2016 03:55
link?
Franco Zapata
@Francozt01
Jan 07 2016 03:55
@pablok47 read 2 lines up
milpool
@milpool
Jan 07 2016 03:56
the page address?
Angela
@kbmom5
Jan 07 2016 03:57

Can you look at this? 10 needs to return "inside".

function myTest(val) {
// Only change code below this line

if (val <= 10 || val >= 20) {
return "Outside";
}
// Only change code above this line
return "Inside";
}

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

it's the line of the "if"statement that I can't get
Corey
@coreyjuliandavis
Jan 07 2016 03:57
On Record Collection: this does produce a new track for id 1245, but does not meet the consoles requirements. Is it the syntax?
// 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; 
  }
  else if (prop === "tracks" && value !== "") {
    collection[id][prop].push(value);
  }
  else if (value === "") {
    delete collection[id][prop];
  } else {
    return "";
  }    

  return collection;
}


// Alter values below to test your code
update(1245, "tracks", "Addicted to Love");
Pablo K
@pablok47
Jan 07 2016 03:57
@Francozt01 thanks
Franco Zapata
@Francozt01
Jan 07 2016 03:57
@pablok47 np bro
Pablo K
@pablok47
Jan 07 2016 03:57
@scottmike0 thanks
CamperBot
@camperbot
Jan 07 2016 03:57
pablok47 sends brownie points to @scottmike0 :sparkles: :thumbsup: :sparkles:
:star: 242 | @scottmike0 | http://www.freecodecamp.com/scottmike0
Pablo K
@pablok47
Jan 07 2016 03:58
@h4r1m4u thanks
CamperBot
@camperbot
Jan 07 2016 03:58
pablok47 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1244 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Pranav Doshi
@pranavdoshi
Jan 07 2016 03:58
@milpool the url address
Brad940
@Brad940
Jan 07 2016 03:58

Waypoint: Multiple Identical Options in Switch Statements. I need assistance to understand why this code isn't returning anything in the dev console. ``` function myTest(val) {
var answer = "";
// Only change code below this line
switch (val) {
case 1:
case 2:
case 3:
result = "Low";
break;
case 4:
case 5:
case 6:
result = "Mid";
break;
case 7:
case 8:
case 9:
result = "High";
}

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

// Change this value to test
myTest(2); ```

Franco Zapata
@Francozt01
Jan 07 2016 03:58
@coreyjuliandavis it is the syntax but change position of the 1 if () with the second if ()
the if () with the first if else ()
Pranav Doshi
@pranavdoshi
Jan 07 2016 03:59
@Brad940 why there are empty case statements?
Corey
@coreyjuliandavis
Jan 07 2016 04:00
thanks @Francozt01
CamperBot
@camperbot
Jan 07 2016 04:00
coreyjuliandavis sends brownie points to @francozt01 :sparkles: :thumbsup: :sparkles:
:star: 438 | @francozt01 | http://www.freecodecamp.com/francozt01
Franco Zapata
@Francozt01
Jan 07 2016 04:00
@coreyjuliandavis np :+1:
Brad940
@Brad940
Jan 07 2016 04:00
@pranavdoshi Sorry not sure what you mean "empty case statements"?
Pranav Doshi
@pranavdoshi
Jan 07 2016 04:01
case1: blank
Mrs. B.
@jazzydelta99
Jan 07 2016 04:01
@mrmrbungle hi, I tried return arr.shift(); al i get now is Range error: maximum call stack size exceeded
James Seaman
@myhijim
Jan 07 2016 04:01
@pranavdoshi It falls through to the next case
Pranav Doshi
@pranavdoshi
Jan 07 2016 04:01
case 2:blank
James Seaman
@myhijim
Jan 07 2016 04:01
But not really needed
Pranav Doshi
@pranavdoshi
Jan 07 2016 04:01
thats what
James Seaman
@myhijim
Jan 07 2016 04:01
Basically, if case 1,2 or 3
Lou Verdun
@LouVerdun
Jan 07 2016 04:01
Hi, did u have a problem passing the Local Scope and Functions, I'm sure tha twhat I did is right but it won't validate
James Seaman
@myhijim
Jan 07 2016 04:01
Then low
h4r1m4u
@h4r1m4u
Jan 07 2016 04:01
@Brad940 you're saving the result into result but returning answer from the function
Franco Zapata
@Francozt01
Jan 07 2016 04:02
@Brad940 instead use the word "result" to asign the value to the cases u should use the word answer = "Low" "Mid" and "High" just change result for answer
scottmike0
@scottmike0
Jan 07 2016 04:03
@Francozt01 good thing i did not read what ya said, :P i figured it out shortly after e.e
Franco Zapata
@Francozt01
Jan 07 2016 04:03
@pranavdoshi that case isn't blank bro the cases 1 2 3 4 have the same answer
Angela
@kbmom5
Jan 07 2016 04:03
Any logic people in the house?
Pranav Doshi
@pranavdoshi
Jan 07 2016 04:03
@milpool u have to escape backslashes tabs
James Seaman
@myhijim
Jan 07 2016 04:03
4 doesn't
Franco Zapata
@Francozt01
Jan 07 2016 04:03
@scottmike0 with the return lookup ?
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 04:03
@kbmom5 logic for?
Brad940
@Brad940
Jan 07 2016 04:04
Thanks @Francozt01 that got it! I was following the example on the left too literally but not paying attention to my own code.
CamperBot
@camperbot
Jan 07 2016 04:04
brad940 sends brownie points to @francozt01 :sparkles: :thumbsup: :sparkles:
:star: 439 | @francozt01 | http://www.freecodecamp.com/francozt01
Franco Zapata
@Francozt01
Jan 07 2016 04:04
@kbmom5 hard to know
Angela
@kbmom5
Jan 07 2016 04:04

I posted above, will post again. It makes sense when I read it but it's wrong.
function myTest(val) {
// Only change code below this line

if (val <= 10 || val >= 20) {
return "Outside";
}
// Only change code above this line
return "Inside";
}

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

Franco Zapata
@Francozt01
Jan 07 2016 04:04
@Brad940 we have to get use to it :smile:
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 07 2016 04:04
@kbmom5 what is the waypoint number?
James Seaman
@myhijim
Jan 07 2016 04:04
@kbmom5 That should return Outside
scottmike0
@scottmike0
Jan 07 2016 04:04
@kbemom5 the inclusive part is confusing, just ignore it, and see it as it if it was not there
Angela
@kbmom5
Jan 07 2016 04:05
@scottmike0 bingo!! thanks!
CamperBot
@camperbot
Jan 07 2016 04:05
kbmom5 sends brownie points to @scottmike0 :sparkles: :thumbsup: :sparkles:
:star: 244 | @scottmike0 | http://www.freecodecamp.com/scottmike0
scottmike0
@scottmike0
Jan 07 2016 04:05
@kbmom5 yeah i went through that torture
milpool
@milpool
Jan 07 2016 04:05
it doesn't matter how I write it I get undefined. I don't know I am supposed to be writing. I put in all the codes and got undefined
James Seaman
@myhijim
Jan 07 2016 04:06
@milpool Code?
scottmike0
@scottmike0
Jan 07 2016 04:06
@milpool which code?
Angela
@kbmom5
Jan 07 2016 04:06
@scottmike0 how far are you?
scottmike0
@scottmike0
Jan 07 2016 04:06
@kbmom5 everything up to Waypoint: Testing Objects for Properties
milpool
@milpool
Jan 07 2016 04:06
\ \t \t \r \n.
Pranav Doshi
@pranavdoshi
Jan 07 2016 04:07
for back slash its \ \t @milpool
scottmike0
@scottmike0
Jan 07 2016 04:07
@kbmom5 there wwill be a few tricks and goons when you get close to me
Pranav Doshi
@pranavdoshi
Jan 07 2016 04:07
sorry wait \
\ \t
two backslash in order to escape single backslash
Angela
@kbmom5
Jan 07 2016 04:07
@scottmike0 I've been so proud of myself when I've caught some of them, but this one was just not fair!!
scottmike0
@scottmike0
Jan 07 2016 04:07
@kbmom5 i agree, inclusively should be removed :P
Angela
@kbmom5
Jan 07 2016 04:08
exactly @scottmike0
milpool
@milpool
Jan 07 2016 04:09
I thought I tried that already but now it works. thanks
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 04:14
can someone explain to me why this output 20:
// Setup
var myArr = [ 2, 3, 4, 5, 6];
var total=0;

for(i=0;i<myArr.length;i++){
  total=total+myArr[i]; // output 20
}
Pranav Doshi
@pranavdoshi
Jan 07 2016 04:14
@milpool gr8
@mukhtaarabdi addition of all elements
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 04:16
@pranavdoshi thank , that was simple
CamperBot
@camperbot
Jan 07 2016 04:16
mukhtaarabdi sends brownie points to @pranavdoshi :sparkles: :thumbsup: :sparkles:
:star: 284 | @pranavdoshi | http://www.freecodecamp.com/pranavdoshi
Pranav Doshi
@pranavdoshi
Jan 07 2016 04:16
np dude
simple things can sometime be very difficult
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 04:16
@pranavdoshi :)
cannelflow
@cannelflow
Jan 07 2016 04:18
Need help with this code note passing mutation(["hello", "hey"])
function mutation(arr) {
   var target=arr[0].toLowerCase();
  var test=arr[1].toLowerCase();
  for(var i=0;i<test.length;i++){
    if(target.indexOf(test[i])<0){
      return false;
    }else {
      return true;
    }
  }
  return arr;

}

mutation(["hello", "hey"]);
Vadali Soumitri
@svadali2
Jan 07 2016 04:18
hey guys
scottmike0
@scottmike0
Jan 07 2016 04:18
@cannelflow you have no check if it is lower case
Vadali Soumitri
@svadali2
Jan 07 2016 04:19
i have a problem in my first zipline, so i want to do a background image for a div
and what is hapening is that it is always too small
it only covers the text, whereas i want it to cover something bigger
cannelflow
@cannelflow
Jan 07 2016 04:19
@scottmike0 but whatever coming i turned them to lower case
Jason
@gitPhunky
Jan 07 2016 04:20
whats the resolution size of the image? @svadali2
Vincent Nguyen,
@Venduro
Jan 07 2016 04:20
hey @scottmike0
can you help me
scottmike0
@scottmike0
Jan 07 2016 04:20
@cannelflow what you did is tried to use test.length, instead of arr.length
Vincent Nguyen,
@Venduro
Jan 07 2016 04:20
function myTest(val) {
  var answer = "";
  // Only change code below this line
  switch (val) {
    case myTest(1):
      answer = "alpha";
      break;
    case myTest(2):
      answer = "beta";
    case myTest(3):
      answer = "gamma";
    case myTest(4):
      answer = "delta";
  }
  // Only change code above this line  
  return answer;  
}

// Change this value to test
myTest(1);
Instructions
Write a switch statement which tests val and sets answer for the following conditions:
1 - "alpha"
2 - "beta"
3 - "gamma"
4 - "delta"
scottmike0
@scottmike0
Jan 07 2016 04:20
@Venduro yes, you are over thinking it
@Venduro a switch is based off 1 number or string
@Venduro so try removing myTest, and instead using the numbers
Vadali Soumitri
@svadali2
Jan 07 2016 04:21
portfolio background issue.png
@gitPhunky here is a picture of it!
scottmike0
@scottmike0
Jan 07 2016 04:22
@Venduro did that make more sense?
Vadali Soumitri
@svadali2
Jan 07 2016 04:22
i want the background to be bigger you know?
cannelflow
@cannelflow
Jan 07 2016 04:22
@scottmike0 but i used that only
Vadali Soumitri
@svadali2
Jan 07 2016 04:22
not just covering the text
like it is right now
Vincent Nguyen,
@Venduro
Jan 07 2016 04:22
function myTest(val) {
  var answer = "";
  // Only change code below this line
  switch (val) {
    case (1):
      answer = "alpha";
      break;
    case (2):
      answer = "beta";
      break;
    case (3):
      answer = "gamma";
      break;
    case (4):
      answer = "delta";
      break;
  }
  // Only change code above this line  
  return answer;  
}

// Change this value to test
myTest(1);
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 04:22
@scottmike0 @Venduro and also he needs break ? after each case
Ed W
@ManOnACodingMission
Jan 07 2016 04:22
@Venduro use "case 1", not "case myTest(1)"
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 04:22
@Venduro without brackets
scottmike0
@scottmike0
Jan 07 2016 04:22
@Venduro remove the damn parenthesis
@Venduro set a fire on the parenthesis :fire:
Kevin Voshell
@kvoshell
Jan 07 2016 04:23

Can someone shed some light on what is needed for this?

```

Vincent Nguyen,
@Venduro
Jan 07 2016 04:23
ok Thank you @mukhtaarabdi @scottmike0
CamperBot
@camperbot
Jan 07 2016 04:23
venduro sends brownie points to @mukhtaarabdi and @scottmike0 :sparkles: :thumbsup: :sparkles:
:star: 246 | @scottmike0 | http://www.freecodecamp.com/scottmike0
:star: 235 | @mukhtaarabdi | http://www.freecodecamp.com/mukhtaarabdi
Jason
@gitPhunky
Jan 07 2016 04:24
@svadali2 oh try increasing the div size, like for that div in css use something like height:100vh to set it to match the height of the device
scottmike0
@scottmike0
Jan 07 2016 04:24
@cannelflow so did ya get it?
cannelflow
@cannelflow
Jan 07 2016 04:24
This message was deleted
scottmike0
@scottmike0
Jan 07 2016 04:25
@cannelflow the post got deleted D:
cannelflow
@cannelflow
Jan 07 2016 04:25
every thing went good except mutation(["hello", "hey"])
@scottmike0
scottmike0
@scottmike0
Jan 07 2016 04:25
@cannelflow post the new code :P
Pranav Doshi
@pranavdoshi
Jan 07 2016 04:25
@gitPhunky can u explain 100vh the vh
cannelflow
@cannelflow
Jan 07 2016 04:26
@scottmike0
function mutation(arr) {
   var target=arr[0].toLowerCase();
  var test=arr[1].toLowerCase();
  for(var i=0;i<test.length;i++){
    if(target.indexOf(test[i])<0){
      return false;
    }else {
      return true;
    }
  }
  return arr;

}

mutation(["hello", "hey"]);
Pranav Doshi
@pranavdoshi
Jan 07 2016 04:26
whats that vh ?
can u explain
Eina
@thelittleblacksmith
Jan 07 2016 04:27
vh = viewport height?
Maulik Darji
@maulikdarji
Jan 07 2016 04:27
@cannelflow you just need true or false result, no need to return arr;
Jason
@gitPhunky
Jan 07 2016 04:27
@pranavdoshi youknow how in css you use px, well if you are importing the device(window) dimensions using the meta viewport... what @thelittleblacksmith said
Pablo K
@pablok47
Jan 07 2016 04:27
can someone help me out with this one....

// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};

function checkObj(checkProp) {
// Your Code Here
if (myObj.hasOwnProperty(checkProp)){
return myObj.gift;

} return "Not Found";

}

// Test your code by modifying these values
checkObj("gift");

scottmike0
@scottmike0
Jan 07 2016 04:27
@cannelflow (for var i = 0; 1< arr.length i++)
Pranav Doshi
@pranavdoshi
Jan 07 2016 04:27
wats the use of it @gitPhunky
Pablo K
@pablok47
Jan 07 2016 04:28
I need it to return whatever key is tested
Maulik Darji
@maulikdarji
Jan 07 2016 04:28
@pablok47 use bracket notation
scottmike0
@scottmike0
Jan 07 2016 04:28
@cannelflow okok, which waypoint.
Pablo K
@pablok47
Jan 07 2016 04:29
@maulikdarji where? instead of .gift
greg
@wearenotgroot
Jan 07 2016 04:29
@pablok47 else
Maulik Darji
@maulikdarji
Jan 07 2016 04:29
@pablok47 use bracket notation, and [chekProp instead .gift
cannelflow
@cannelflow
Jan 07 2016 04:29
@scottmike0 @maulikdarji yes it is true and false and no need to return arr; thank you
CamperBot
@camperbot
Jan 07 2016 04:29
cannelflow sends brownie points to @scottmike0 and @maulikdarji :sparkles: :thumbsup: :sparkles:
:star: 247 | @scottmike0 | http://www.freecodecamp.com/scottmike0
:star: 313 | @maulikdarji | http://www.freecodecamp.com/maulikdarji
Pablo K
@pablok47
Jan 07 2016 04:30
@maulikdarji thanks
CamperBot
@camperbot
Jan 07 2016 04:30
pablok47 sends brownie points to @maulikdarji :sparkles: :thumbsup: :sparkles:
:star: 314 | @maulikdarji | http://www.freecodecamp.com/maulikdarji
Maulik Darji
@maulikdarji
Jan 07 2016 04:30
@pablok47 @cannelflow :+1:
Jason
@gitPhunky
Jan 07 2016 04:30
@pranavdoshi not sure if he implemented it here, but in the first zipline, i am using it to accomplish how the background image is done here http://codepen.io/FreeCodeCamp/full/VemmoX/
Franco Zapata
@Francozt01
Jan 07 2016 04:31
@gitPhunky @pranavdoshi he did used meta viewport in the Portfolio Zippline
Jason
@gitPhunky
Jan 07 2016 04:32
@pranavdoshi it basically sets the height or width of an element to a specific percentage of the window/browser the viewer is using
Anthony
@aurbina83
Jan 07 2016 04:32
// Setup
function phoneticLookup(val) {
  var result = "";

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

// Change this value to test
phoneticLookup("charlie");
I'm having a really hard time with this, has anyone been able to crack this yet?
Jason
@gitPhunky
Jan 07 2016 04:32
@Francozt01 yes the viewport meta is needed to make any web page responsive in bootstrap
cannelflow
@cannelflow
Jan 07 2016 04:32
@aurbina83 which exercise
Eina
@thelittleblacksmith
Jan 07 2016 04:33
@aurbina83 you should put alpha and bravo etc in quotes
Matt Fay
@username1001
Jan 07 2016 04:33

var count = 0;

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

if(card <= cc) {
return count-- + " " + "Hold";
}

switch(card) {
case 2:
case 3:
case 4:
case 5:
case 6:
return "5 Bet";
break;
case 7:
case 8:
case 9:
return "0 Hold";
break;
case 10:
case "J":
case "Q":
case "K":
case "A":
return "-5 Hold";

}

}

cc(2); cc(3); cc(7); cc('K'); cc("J");

Anthony
@aurbina83
Jan 07 2016 04:33
Waypoint: Using Objects for Lookups
Maulik Darji
@maulikdarji
Jan 07 2016 04:33
@aurbina83 return lookup[val];
Franco Zapata
@Francozt01
Jan 07 2016 04:33
@aurbina83 ur alpha nravo charlie should be between "" and u need to return lookup[val];
Matt Fay
@username1001
Jan 07 2016 04:33
If I put the "if" below the switch, the third checkpoint will work, but if it's above the switch, the last checkpoint works
Franco Zapata
@Francozt01
Jan 07 2016 04:33
@gitPhunky yea at the scale of 1.0
Matt Fay
@username1001
Jan 07 2016 04:34
But if I move it, then one of the checkpoints doesn't work
Anthony
@aurbina83
Jan 07 2016 04:34
@Francozt01 thank you
CamperBot
@camperbot
Jan 07 2016 04:34
aurbina83 sends brownie points to @francozt01 :sparkles: :thumbsup: :sparkles:
:star: 440 | @francozt01 | http://www.freecodecamp.com/francozt01
Matt Fay
@username1001
Jan 07 2016 04:34
can someone help me? should I remove the last bit of the switch and convert it into an if/else ?
Franco Zapata
@Francozt01
Jan 07 2016 04:34
@aurbina83 np
Anthony
@aurbina83
Jan 07 2016 04:34
That's what it was! I had it figured out a couple of days ago, but went back to it and forgot what I did to get it to work!
Matt Fay
@username1001
Jan 07 2016 04:35
@Francozt01 , I think I almost got it..
cannelflow
@cannelflow
Jan 07 2016 04:37
@username1001 remove if
Franco Zapata
@Francozt01
Jan 07 2016 04:37
@username1001 pay attention // you need to declare after the cases 2,3,4,5,6 the common answer in this case they ask you to increase +1 if one card if equal to 2, ,3 ,4, 5 or 6 so you use count++; to increase the variable var count = 0;
mevloy
@mevloy
Jan 07 2016 04:37
Hey there! I've got a question on some code logic here. On this checkpoint, the second scenario, "if (strokes <= par - 2)" why isn't the code "if (strokes === par -2)" ?
Matt Fay
@username1001
Jan 07 2016 04:37
@cannelflow , but if I do that, then the last checkpoint turns red...
cannelflow
@cannelflow
Jan 07 2016 04:38
@username1001 show me your code after rempving
Franco Zapata
@Francozt01
Jan 07 2016 04:38
@username1001 then the secon case ask you to make count = 0; if one card is equal to 7,8,9 so u set answer of these cases to count = 0;
cannelflow
@cannelflow
Jan 07 2016 04:39
@username1001 you can use either switch of if not both
mukhtaarabdi
@mukhtaarabdi
Jan 07 2016 04:39
plz help with this
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for(i=0;i>arr.length;i++){
    for(j=0;j>arr[i].length;i++){
      product*=arr[j];
    }
  }
  // Only change code above this line
  return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
Vadali Soumitri
@svadali2
Jan 07 2016 04:39
@gitPhunky not working my friend :(
Jason
@gitPhunky
Jan 07 2016 04:39
@Francozt01 oh i wasn't asking a question, but i thought you were asking a question, my mistake. my comment wasn't on whether or not he used viewport, it was on whether or not he implemented it by using vh in div, because i did not look at the code.
Vadali Soumitri
@svadali2
Jan 07 2016 04:39
portfolio background issue.png
anyone can help with this problem?
Matt Fay
@username1001
Jan 07 2016 04:39
@Francozt01 So I should use if/ else ? and @cannelflow I can't someone combine them?
Eina
@thelittleblacksmith
Jan 07 2016 04:40
@mukhtaarabdi it should be arr[i][j]
Franco Zapata
@Francozt01
Jan 07 2016 04:40
@username1001 and the third case of 10, J,Q,K ask you to decrease the count variable -1 if one of these card is given as a parameter you set the answe for these cases as count--;
cannelflow
@cannelflow
Jan 07 2016 04:40
@mukhtaarabdi i think it should product*=arr[i][j]; which exercise
@username1001 dont combine