These are chat archives for FreeCodeCamp/Help

10th
Jan 2016
Reuben Ayres
@reubenayres
Jan 10 2016 00:01
if #right-well contains 3 .targets, i would think $("#right-well:nth-child(2)") would select the second .target since .target is child of $right-well, but actually $(".target:nth-child(2)") selects the second .target
is this actually not confusing and crazy?
because it seems that way to me
Mathew
@mathewjcohen
Jan 10 2016 00:02
I replace "nth" in my mind with the number in the parenthesis.
Tim Myers
@denvercoder
Jan 10 2016 00:03
@reubenayres I personally wish EVERYTHING in the computer science realm would be zero based but sadly there are exceptions.
Mathew
@mathewjcohen
Jan 10 2016 00:03
so in the case of $(".target:nth-child(2)"), my mind reads it as $(".target:2nd-child")
Reuben Ayres
@reubenayres
Jan 10 2016 00:03
ya i feel ya about zero vs 1 as starting number
Mathew
@mathewjcohen
Jan 10 2016 00:04
@timmyers1978 I wish that too... would make many things easier
Reuben Ayres
@reubenayres
Jan 10 2016 00:04
but i understand that inconsistency but the thing i can't swallow
is using "child" to represent something that really isn't a "child"
Mathew
@mathewjcohen
Jan 10 2016 00:05
its one of the things we're forced to file away in the "quirks of the language" folder.
Reuben Ayres
@reubenayres
Jan 10 2016 00:05
indeed
Ayush Ojha
@ashojha21
Jan 10 2016 00:08
anyone there? I am having problem here with my first code :(
FarionLord
@FarionLord
Jan 10 2016 00:09

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


}
</style>

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

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

so how do i change the font size? Where should i put my font size?
Ayush Ojha
@ashojha21
Jan 10 2016 00:09
@reubenayres @mathewjcohen ??
FarionLord
@FarionLord
Jan 10 2016 00:10
@ashojha21 I eill try to help.
will*
Tim Myers
@denvercoder
Jan 10 2016 00:11
yes ask away
Can anyone help with the record collection checkpoint?
Ayush Ojha
@ashojha21
Jan 10 2016 00:13
my runtest button doesnt work
it doesnt run even <h1>Hello World</h1>
Tim Myers
@denvercoder
Jan 10 2016 00:13
Neverming
Ayush Ojha
@ashojha21
Jan 10 2016 00:14
nothing displays on the iphone on the right
Tim Myers
@denvercoder
Jan 10 2016 00:14
@ashojha21 should be auto updating
do you have any script blocker plugins
Ryan Thomas
@Placid7
Jan 10 2016 00:14
Can someone help with the Decrement a number with javascript?
Tim Myers
@denvercoder
Jan 10 2016 00:14
What browser and OS?
@Placid7 Sure
Ayush Ojha
@ashojha21
Jan 10 2016 00:15
chrome windows 10
Tim Myers
@denvercoder
Jan 10 2016 00:15
No plugins?
paste all of the code from the black window into here
Ryan Thomas
@Placid7
Jan 10 2016 00:15
@timmyers1978 thx need a value of 11
CamperBot
@camperbot
Jan 10 2016 00:15
placid7 sends brownie points to @timmyers1978 :sparkles: :thumbsup: :sparkles:
:star: 228 | @timmyers1978 | http://www.freecodecamp.com/timmyers1978
Ayush Ojha
@ashojha21
Jan 10 2016 00:15
i dont have any script blocker plugins
Ryan Thomas
@Placid7
Jan 10 2016 00:15
@timmyers1978 var myVar = 11;
Ayush Ojha
@ashojha21
Jan 10 2016 00:16
<h1>Hello World </h1> this is the code
Ryan Thomas
@Placid7
Jan 10 2016 00:16
// Only change code below this line
myVar = myVar--;
myVar = myVar--;
Tim Myers
@denvercoder
Jan 10 2016 00:16
@Placid7 myVar--;
you don't set it then decrement it
Ryan Thomas
@Placid7
Jan 10 2016 00:16
myVar should equal 10
Use the -- operator on myVar
Do not change code above the line
thx
I miss understood what i was asking
Tim Myers
@denvercoder
Jan 10 2016 00:17
//wrong
myVar = myVar--;

//correct
myVar--;
Ryan Thomas
@Placid7
Jan 10 2016 00:17
yep
Tim Myers
@denvercoder
Jan 10 2016 00:17
no problem. The unary operator is tricky if you are not used to it.
FarionLord
@FarionLord
Jan 10 2016 00:17
testing
Ayush Ojha
@ashojha21
Jan 10 2016 00:17
anyone? @Placid7 @timmyers1978 i am stuck on my first code on FCC
FarionLord
@FarionLord
Jan 10 2016 00:17
  .red-text {
    color: red;


  }
</style>

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p> Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. </p>
yay
Ryan Thomas
@Placid7
Jan 10 2016 00:18
@timmyers1978 agreed I'm need to code. Not going to lie my head is spinning a little
@ashojha21 sure
Tim Myers
@denvercoder
Jan 10 2016 00:18
@ashojha21 Refresh your browser and try again
Ayush Ojha
@ashojha21
Jan 10 2016 00:18
i tried to refresh several times @timmyers1978
doesnt work
Tim Myers
@denvercoder
Jan 10 2016 00:19
I don't know what to say. Did you try closing the browser and open again? Try FireFox or Edge?
Ayush Ojha
@ashojha21
Jan 10 2016 00:19
did everything @timmyers1978
Ryan Thomas
@Placid7
Jan 10 2016 00:19
@ashojha21 hold shift and use your cursor to click refresh button
Tim Myers
@denvercoder
Jan 10 2016 00:20
I just brought it up and it worked as soon as It started up
has to be something wrong with your system
Can't really help without seeing it
Ayush Ojha
@ashojha21
Jan 10 2016 00:23
how to send a picture on this chat box. I can show you the console of the browser. May be you can tell me better then
Ruel Thomas
@dragonic-kaiser
Jan 10 2016 00:23
hey there everyone i'm ruel and i'm trying to learn coding as to better myself in the field
Tim Myers
@denvercoder
Jan 10 2016 00:23
just drag the picture to the chat box
teenager-being-tutored.jpg
Like so
@dragonic-kaiser What's up Ruel
Ayush Ojha
@ashojha21
Jan 10 2016 00:25
code3.JPG
Bakari Holmes
@bakarih
Jan 10 2016 00:25
Hello there all. I'm Bakari and I'm a soon-to-be CS graduate that wants to learn the full stack. Diving in head first!
Ayush Ojha
@ashojha21
Jan 10 2016 00:26
@timmyers1978 uploaded the picture
Tim Myers
@denvercoder
Jan 10 2016 00:26
@bakarih HI!
@ashojha21 Can you just humor me? Shut down all of your open Chrome browsers and go back to it?
ALL of the browsers
You may have some Cached CRAP
Ayush Ojha
@ashojha21
Jan 10 2016 00:29
i did it yesterday. I will do it again
Tim Myers
@denvercoder
Jan 10 2016 00:29
thanks
Jordan Shackelford
@JordanShackelford
Jan 10 2016 00:40

@JordanShackelford
I'm having difficulties with the exact change bonfire

function drawer(price, cash, cid) {
  var totalCid = 0.0;
  for(var cashUnit in cid){
    totalCid += cashUnit[1];
  }
  return totalCid;
  // Here is your change, ma'am.
}

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

I get NaN ("Not a Number" error) but I'm expecting a float

Ayush Ojha
@ashojha21
Jan 10 2016 00:42
@timmyers1978 i did. i installed cclearner, cleared all cache and cookies still doesnt work
Tim Myers
@denvercoder
Jan 10 2016 00:42
try ``` totalCid += cashUnit[1][1];
```totalCid += cashUnit1;
```js totalCid += cashUnit1;
hmm
totalCid += cashUnit[1][1];
P.O.S.
:)
Ayush Ojha
@ashojha21
Jan 10 2016 00:45
Help me out @timmyers1978 where might be the problem? Do you have any solution for this?
CamperBot
@camperbot
Jan 10 2016 00:45
no wiki entry for: me out @timmyers1978 where might be the problem do you have any solution for this
Tim Myers
@denvercoder
Jan 10 2016 00:45
Help please. I'm stuck on the Waypoint: Nesting For Loops
CamperBot
@camperbot
Jan 10 2016 00:45
no wiki entry for: please im stuck on the waypoint nesting for loops
Tim Myers
@denvercoder
Jan 10 2016 00:45
@ashojha21 Sorry man I don't know what to tell you. That first lesson you don't even do anything so I don't know. Try a different browser is my only other idea.
smk319
@smk319
Jan 10 2016 00:46
Could someone talk me through the checkpoint word blanks? I feel like the solution is gonna be stupidly easy but I'm at a total loss as to where to start.
Ayush Ojha
@ashojha21
Jan 10 2016 00:47
:( i am stuck here since last night
Tim Myers
@denvercoder
Jan 10 2016 00:47
@ashojha21 send me a screenshot of your whole screen
Ayush Ojha
@ashojha21
Jan 10 2016 00:48
code4.JPG
Tim Myers
@denvercoder
Jan 10 2016 00:49
index.png
can you move the chat window
Ayush Ojha
@ashojha21
Jan 10 2016 00:50
code5.JPG
Tim Myers
@denvercoder
Jan 10 2016 00:50
something is wrong with yours mine has two sets of ;; on the iphone lookin thing
Ayush Ojha
@ashojha21
Jan 10 2016 00:51
two sets of ;;?
Robert Richey
@0x0936
Jan 10 2016 00:52
@smk319 create a sentence with those variables, concatenating spaces and additional words (your choice) to form a complete sentence
Tim Myers
@denvercoder
Jan 10 2016 00:52
index.png
@ashojha21 Download FireFox and try that. That's all I can tell you.
Ayush Ojha
@ashojha21
Jan 10 2016 00:53
so where is the problem? should i reinstall chrome?
tommy
@tommygebru
Jan 10 2016 00:53
@timmyers1978 the product in this case is i
Tim Myers
@denvercoder
Jan 10 2016 00:53
what version of chrome do you have
Robert Richey
@0x0936
Jan 10 2016 00:53
@ashojha21 never seen that problem before. do you have another browser you can use to see if you get the same results?
Tim Myers
@denvercoder
Jan 10 2016 00:55
@tommygebru I don't get it?
Ayush Ojha
@ashojha21
Jan 10 2016 00:55
code6.JPG
tommy
@tommygebru
Jan 10 2016 00:55
@timmyers1978 the loops challenge
Ayush Ojha
@ashojha21
Jan 10 2016 00:55
am i cursed? :(
Tim Myers
@denvercoder
Jan 10 2016 00:56
@ashojha21 No one is going to be able to help you. Just download FireFox or try in IE and if that doesn't work click the "BUG" button.
@tommygebru Yeah, still don't get it. My array has 3 elements so after the loop i = 3 but it is supposed to = 76543*2 right?
``` 7 6 5 4 3 * 2
smk319
@smk319
Jan 10 2016 00:58
@0x0936 So I don't have to make my own variables (i.e. myNoun=lamp?) That's the part I'm confused on...like I've just tried using concatenating spaces to link just the myNoun/myAdjective etc. together and it's not working
Tim Myers
@denvercoder
Jan 10 2016 00:58
format
Ayush Ojha
@ashojha21
Jan 10 2016 00:59
it doesnt work in firefox either @timmyers1978 :(
Tim Myers
@denvercoder
Jan 10 2016 00:59
Then you'll just have to submit a bug
Robert Richey
@0x0936
Jan 10 2016 01:00
@smk319 "Let's all " + adverb + " " + verb + " to the " ... and finish up
smk319
@smk319
Jan 10 2016 01:01
@0x0936 thanks! Def. overthought it
CamperBot
@camperbot
Jan 10 2016 01:01
smk319 sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 848 | @0x0936 | http://www.freecodecamp.com/0x0936
Robert Richey
@0x0936
Jan 10 2016 01:01
:)
Tim Myers
@denvercoder
Jan 10 2016 01:01
I really need help someone. Waypoint: Nesting For Loops
Mike W.
@micwill007
Jan 10 2016 01:02
What are you stuck on?
@timmyers1978
Post your code and i'll help.
Tim Myers
@denvercoder
Jan 10 2016 01:02
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 = 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]]);
Rae
@cs-knight
Jan 10 2016 01:03
<p class="anchor text">cat <a href="http://freecatphotoapp.com"></a>ph
Tim Myers
@denvercoder
Jan 10 2016 01:03
the product is returning 4 and needs to be product of all items in array
Mike W.
@micwill007
Jan 10 2016 01:03
yes so
tommy
@tommygebru
Jan 10 2016 01:03
@timmyers1978 i * j I believe is multimpying an inner and outer array value...
Mike W.
@micwill007
Jan 10 2016 01:03
you are assigning product to i * j
what you really need is product *= arr[i][j];
Tim Myers
@denvercoder
Jan 10 2016 01:03
assigning i * j to product yea
Rae
@cs-knight
Jan 10 2016 01:03
still missing out how "a element should have anchor text"
Mike W.
@micwill007
Jan 10 2016 01:04
everything else in the for loops looks good though, so very close.
Tim Myers
@denvercoder
Jan 10 2016 01:04
thanks
tva10
@tva10
Jan 10 2016 01:04
@csrae In your code you miss text in <a> tag
Tim Myers
@denvercoder
Jan 10 2016 01:04
thanks @micwill007
CamperBot
@camperbot
Jan 10 2016 01:04
timmyers1978 sends brownie points to @micwill007 :sparkles: :thumbsup: :sparkles:
:star: 245 | @micwill007 | http://www.freecodecamp.com/micwill007
Mike W.
@micwill007
Jan 10 2016 01:04
np :)
tva10
@tva10
Jan 10 2016 01:05
@csrae <a href="link">Text of your link</a>
Rick Markins
@rkmarks
Jan 10 2016 01:34
having the same issue on the json checkpoint
function update(id, prop, value) {
  if (value !== ""){
    if (prop == "tracks"){
      collection[id][prop].push(value);
    } else if (prop == "artist") {
      collection[id][prop] = value;
    }
    else {
      delete collection[id][prop];
    }
  }
I'm not sure whats going wrong?
Raymond To
@rayto510
Jan 10 2016 01:37
hey guys. what did i do wrong here?
Rae
@cs-knight
Jan 10 2016 01:38
@tva10 thanks
CamperBot
@camperbot
Jan 10 2016 01:38
csrae sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 333 | @tva10 | http://www.freecodecamp.com/tva10
Raymond To
@rayto510
Jan 10 2016 01:38

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

// Only change code below this line

var phoneticLookup = {
"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");

Rae
@cs-knight
Jan 10 2016 01:38

here's my 2nd attempt ```

<p> here is a link
<a href="http://freecatphotoapp.com">cat photos </a></p>

Rick Markins
@rkmarks
Jan 10 2016 01:38
you need to set result to pull from that lookup
Raymond To
@rayto510
Jan 10 2016 01:39
set result?
Rick Markins
@rkmarks
Jan 10 2016 01:39
result = phoneticLookup[val];
Raymond To
@rayto510
Jan 10 2016 01:39
ohh
Rick Markins
@rkmarks
Jan 10 2016 01:39
so once result returns it pulls from the object.
Rae
@cs-knight
Jan 10 2016 01:39
<p> here is a link
  <a href="http://freecatphotoapp.com">cat photos </a></p>
Raymond To
@rayto510
Jan 10 2016 01:40
thanks! took me a long while to figure that out
Rick Markins
@rkmarks
Jan 10 2016 01:40
you're welcome!
Ricardo Sanchez
@ricsanm
Jan 10 2016 01:40
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here

  {if (myObj.hasOwnProperty(checkProp) === false) 
    return "Not Found";
    }

 return myObj.hasOwnProperty(checkProp);
}

// Test your code by modifying these values
checkObj("pet");
Hey guys, how can I make it so it returns the property value if it is found?
akhila112
@akhila112
Jan 10 2016 01:42
Hey guys. I am getting an error of " Maximum call stack size exceeded" on the below code.

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

function queue(arr, item) {
// Your code here
var arr1;
arr1=arr.push(item);
item=arr1.shift();
return item; // 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));

Ricardo Sanchez
@ricsanm
Jan 10 2016 01:42
@akhila112 You don't need to define what item is, or any of the variables for that matter.
you can just arr.action()
and return whatever you need
akhila112
@akhila112
Jan 10 2016 01:46
@ricsanm What does action() do? never came across that function till now in the tutorial
Eina
@thelittleblacksmith
Jan 10 2016 01:48
@akhila112 try refreshing your browser
Javier Madrid
@jamc92
Jan 10 2016 01:49
Hey
Dosoo
Rae
@cs-knight
Jan 10 2016 01:54
is this a bug
<p> here is link for
  <a href='http://freecatphotoapp.com'>cat photos</a> </p>
akhila112
@akhila112
Jan 10 2016 01:56
@thelittleblacksmith ...thanks for that. It helped finish the checkpoint :smile:
CamperBot
@camperbot
Jan 10 2016 01:56
akhila112 sends brownie points to @thelittleblacksmith :sparkles: :thumbsup: :sparkles:
:star: 233 | @thelittleblacksmith | http://www.freecodecamp.com/thelittleblacksmith
Phillip Stolić
@Deadmano
Jan 10 2016 01:56
@ricsanm so refreshing to see you help others now! :D
Mahtab
@RoadToCode822
Jan 10 2016 01:57
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {

  if (checkObj.hasOwnProperty(checkProp)) {

      return checkObj.checkProp;

  }

  else return ("Not Found");

}

// Test your code by modifying these values
checkObj("gift");
What am i doing wrong?
Phillip Stolić
@Deadmano
Jan 10 2016 01:58
@RoadToCode822 checkProp is a variable. It is not a property that exists, hence you can't use dot notation.
@RoadToCode822 try using [checkProp] instead. ;)
Eina
@thelittleblacksmith
Jan 10 2016 01:58
also checkProp is a property of myObj not the function's :)
tommy
@tommygebru
Jan 10 2016 01:59
This should have been simple,,please point the error in my ways
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";
      break;
  }

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

// Change this value to test
myTest(5);
Phillip Stolić
@Deadmano
Jan 10 2016 01:59
@thelittleblacksmith that's right. ;)
@tommygebru you aren't assigning result or calling it to anything? You're just returning answer.
You have stored the proper values into result but that's as far as it gets.
I can't remember that exact waypoint, but is it supposed to have result anyway? Can't you juse use answer? :)
tommy
@tommygebru
Jan 10 2016 02:01
@Deadmano therefore answer=result?
Phillip Stolić
@Deadmano
Jan 10 2016 02:01
Yeah, but why use an uninitialized variable anyway?
tommy
@tommygebru
Jan 10 2016 02:01
@Deadmano please explain?
Jordan Shackelford
@JordanShackelford
Jan 10 2016 02:02
This message was deleted
Anton Bredl
@antonbr13
Jan 10 2016 02:02
// Setup
var myArr = [1,2,3,4,5];

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


  return item;  // Change this line
}
Phillip Stolić
@Deadmano
Jan 10 2016 02:02
@tommygebru result is not linked to anything. You aren't returning it either. So you got the right value, but it is just lying dormant.
Anton Bredl
@antonbr13
Jan 10 2016 02:02
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.
Phillip Stolić
@Deadmano
Jan 10 2016 02:02
@tommygebru try change result to answer? Did they specifically tell you to use result?
Anton Bredl
@antonbr13
Jan 10 2016 02:03
could someone assist me with the above code?
Phillip Stolić
@Deadmano
Jan 10 2016 02:03
Otherwise, yes, answer = result would be the way to go with that return.
Mahtab
@RoadToCode822
Jan 10 2016 02:03
@Deadmano ok makes sense
Ron
@rphill03
Jan 10 2016 02:03
Struggling with this waypoint... any assistance would be appreciated. Please don't just tell me the answer without any type of explanation about why my syntax was wrong..thanks
// Setup
var myPlants = [
  { 
    type: "flowers",
    list: [
      "rose",
      "tulip",
      "dandelion"
    ]
  },
  {
    type: "trees",
    list: [
      "fir",
      "pine",
      "birch"
    ]
  }  
];

// Only change code below this line

var secondTree = '';
secondTree = myPlants.type.trees[01]; // Change this line
console.log(secondTree);
Mahtab
@RoadToCode822
Jan 10 2016 02:03
@thelittleblacksmith can you elaborate
DFC302
@DFC302
Jan 10 2016 02:03
Can anyone help me? How do you create a script element?
Phillip Stolić
@Deadmano
Jan 10 2016 02:03
@rphill03 what have you tried?
tommy
@tommygebru
Jan 10 2016 02:03
@Deadmano i see your point thanks!
CamperBot
@camperbot
Jan 10 2016 02:03
tommygebru sends brownie points to @deadmano :sparkles: :thumbsup: :sparkles:
Pawan
@pawan92
Jan 10 2016 02:03
@antonbr13 what do you need
CamperBot
@camperbot
Jan 10 2016 02:03
:star: 132 | @deadmano | http://www.freecodecamp.com/deadmano
Ron
@rphill03
Jan 10 2016 02:03
I have researched W3 and stack .. trying to see what is wrong
Phillip Stolić
@Deadmano
Jan 10 2016 02:03
@rphill03 look carefully. There are two arrays. To access the first array you would use myPlants[0] as arrays are zero-based indexes yeah?
Ron
@rphill03
Jan 10 2016 02:04
I tried tons of variations of syntax
yes
Phillip Stolić
@Deadmano
Jan 10 2016 02:04
So you missed that first.
You put .type instead.
Ron
@rphill03
Jan 10 2016 02:04
I keep getting the octal syntax error when I reference with 1
Eina
@thelittleblacksmith
Jan 10 2016 02:04
@RoadToCode822 on the code you pasted you had checkObj.checkPropcheckObj is the function, it doesn't have properties, but myObj the object does
Phillip Stolić
@Deadmano
Jan 10 2016 02:04
@tommygebru let me know if it works. :)
Anton Bredl
@antonbr13
Jan 10 2016 02:04
@pawan92 queue([], 1) should return 1
queue(2, 1) should return 2
After queue(myArr, 10), myArr[4] should be 10
Ron
@rphill03
Jan 10 2016 02:04
'1'
DFC302
@DFC302
Jan 10 2016 02:04
Anyone know how to make a script element?
Phillip Stolić
@Deadmano
Jan 10 2016 02:05
The array you need to access is trees. It is array 01. Then we must access .list1 to get pine no?
Ron
@rphill03
Jan 10 2016 02:05
myPlants.trees then?
Phillip Stolić
@Deadmano
Jan 10 2016 02:05
Do not use 01, just 0 or 1.
Pawan
@pawan92
Jan 10 2016 02:05
@antonbr13 you need to use array.shift and array.push
tommy
@tommygebru
Jan 10 2016 02:05
@DFC302 do you mean tags?
DFC302
@DFC302
Jan 10 2016 02:05

not exactly sure this is what its saying:

First, add a script element at the top of your page. Be sure to close it on the following line.

Your browser will run any JavaScript inside a script element, including jQuery.

Inside your script element, add this code: $(document).ready(function() { to your script. Then close it on the following line (still inside your script element) with: });

Mahtab
@RoadToCode822
Jan 10 2016 02:06
hmm yes, i see your point @thelittleblacksmith . thanks
CamperBot
@camperbot
Jan 10 2016 02:06
roadtocode822 sends brownie points to @thelittleblacksmith :sparkles: :thumbsup: :sparkles:
:star: 234 | @thelittleblacksmith | http://www.freecodecamp.com/thelittleblacksmith
Mahtab
@RoadToCode822
Jan 10 2016 02:06
thanks @Deadmano as well
CamperBot
@camperbot
Jan 10 2016 02:06
roadtocode822 sends brownie points to @deadmano :sparkles: :thumbsup: :sparkles:
:star: 133 | @deadmano | http://www.freecodecamp.com/deadmano
Ron
@rphill03
Jan 10 2016 02:06
secondTree = myPlants.trees[1];
Phillip Stolić
@Deadmano
Jan 10 2016 02:06
Sure thing, @RoadToCode822! :)
tommy
@tommygebru
Jan 10 2016 02:06
@DFC302 link please
Ron
@rphill03
Jan 10 2016 02:06
says TypeError: Cannot read property '1' of undefined
Phillip Stolić
@Deadmano
Jan 10 2016 02:07
You failed to access the array, @rphill03.
Anton Bredl
@antonbr13
Jan 10 2016 02:07
@pawan92 okay thanks for the confirmation - the last thing that is unclear for me - am i editing or alter the myArray or am i suppose to create a new one
CamperBot
@camperbot
Jan 10 2016 02:07
antonbr13 sends brownie points to @pawan92 :sparkles: :thumbsup: :sparkles:
:star: 277 | @pawan92 | http://www.freecodecamp.com/pawan92
DFC302
@DFC302
Jan 10 2016 02:07

@tommygebru

http://www.freecodecamp.com/challenges/waypoint-learn-how-script-tags-and-document-ready-work#?solution=%24(document).ready(function()%20%7B%7D)%3B%0A%0A%3C!--%20Only%20change%20code%20above%20this%20line.%20--%3E%0A%0A%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%3Ch3%20class%3D%22text-primary%20text-center%22%3EjQuery%20Playground%3C%2Fh3%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23left-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22left-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target1%22%3E%23target1%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target2%22%3E%23target2%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target3%22%3E%23target3%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23right-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22right-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target4%22%3E%23target4%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target5%22%3E%23target5%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target6%22%3E%23target6%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A

Phillip Stolić
@Deadmano
Jan 10 2016 02:07
Look carefully, what array number is the 2nd array?
DFC302
@DFC302
Jan 10 2016 02:07
didnt think it was gonna be that big lol sorry guys
Phillip Stolić
@Deadmano
Jan 10 2016 02:07
Right. So we would first have myPlants[1] as a start...
Then we would need to access the list property, how do we add that on to what we have?
Stay with me @rphill03. Let's do this.
Pawan
@pawan92
Jan 10 2016 02:08
@antonbr13 so your basically changing the array. not creating a new one. shift will give you the element you need to return and push will add the new element
Ron
@rphill03
Jan 10 2016 02:08
yeah thinking .. thank you .. just a minute
Ron
@rphill03
Jan 10 2016 02:08
working through it ;-)
Anton Bredl
@antonbr13
Jan 10 2016 02:08
okay thanks a lot @pawan92
CamperBot
@camperbot
Jan 10 2016 02:08
antonbr13 sends brownie points to @pawan92 :sparkles: :thumbsup: :sparkles:
:warning: antonbr13 already gave pawan92 points
Pawan
@pawan92
Jan 10 2016 02:09
@antonbr13 yup :smile:
Ron
@rphill03
Jan 10 2016 02:09
Got it myPlants[1].list[1];
Phillip Stolić
@Deadmano
Jan 10 2016 02:09
@rphill03 YES! Exactly! :)
Ron
@rphill03
Jan 10 2016 02:10
dude @Deadmano ..thank you sooo much .. I knew this was simple but it was killing me ha
CamperBot
@camperbot
Jan 10 2016 02:10
rphill03 sends brownie points to @deadmano :sparkles: :thumbsup: :sparkles:
Phillip Stolić
@Deadmano
Jan 10 2016 02:10
Because pine is the 2nd item on the 2nd array. 0 is the 1st, 1 is the 2nd since arrays are 0-indexed.
CamperBot
@camperbot
Jan 10 2016 02:10
:star: 134 | @deadmano | http://www.freecodecamp.com/deadmano
Ron
@rphill03
Jan 10 2016 02:10
thanks @Deadmano
CamperBot
@camperbot
Jan 10 2016 02:10
rphill03 sends brownie points to @deadmano :sparkles: :thumbsup: :sparkles:
:warning: rphill03 already gave deadmano points
Phillip Stolić
@Deadmano
Jan 10 2016 02:10
@rphill03 the small things my friend!! :) Anytime, feel free to ask if you get stuck. We're all here to help each other. ;)
Ron
@rphill03
Jan 10 2016 02:10
yeah I was missing identifying the first one
tommy
@tommygebru
Jan 10 2016 02:10
@DFC302 the entire jquery has to be within tags that open and close called script
Ron
@rphill03
Jan 10 2016 02:10
awesome!
jchoi18
@jchoi18
Jan 10 2016 02:12
Is there a reason why collection[id][tracks].push(value); will overwrite tracks array and replace it with just the value
collection is a JSON object
tommy
@tommygebru
Jan 10 2016 02:12
@Deadmano is this a bug ... double semicolons on the screen... :smile:
jchoi18
@jchoi18
Jan 10 2016 02:12
im trying to push things onto the end of the tracks prop of one of the inner objects but instead of adding an element to the end it overwrites the tracks prop with value
DFC302
@DFC302
Jan 10 2016 02:13
@tommygebru ok let me try ill let you know if it works
Phillip Stolić
@Deadmano
Jan 10 2016 02:13
@tommygebru where do you see that? If you see double, remove one.
Rick Markins
@rkmarks
Jan 10 2016 02:13
@jchoi18 I used this collection[id][prop].push(value);
FarionLord
@FarionLord
Jan 10 2016 02:13

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

}
</style>

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

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

woops
  .red-text {
    color: red; 
     { font-size: 16px"
   }


  }
</style>

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

<p class="red-text p { font-size: 16px"
   }
   >Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p> Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. </p>
Rick Markins
@rkmarks
Jan 10 2016 02:13
that seemed to work but still haven't completed it yet
DFC302
@DFC302
Jan 10 2016 02:14
awesome it worked thanks @tommygebru
CamperBot
@camperbot
Jan 10 2016 02:14
dfc302 sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 213 | @tommygebru | http://www.freecodecamp.com/tommygebru
FarionLord
@FarionLord
Jan 10 2016 02:14
so what did I do wrong to not make p tag font size 16px?
jchoi18
@jchoi18
Jan 10 2016 02:14
oh i found out my error (accessing the prop was working fine but it was the order of my if/else statements
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:14
it'll mark you wrong if you don't do exactly what it says. In one case I had everything right but the sentence was missing a period and it said it was incorrect
Phillip Stolić
@Deadmano
Jan 10 2016 02:15
@FarionLord that's not how you do mark-up. :P You're trying to do CSS in a attribute declaration.
Rick Markins
@rkmarks
Jan 10 2016 02:15
@jchoi18 mind pasting your result so I can see.
tommy
@tommygebru
Jan 10 2016 02:15
Screen Shot 2016-01-09 at 6.14.52 PM.png @Deadmano other people's code here is another example again ...
Phillip Stolić
@Deadmano
Jan 10 2016 02:15
Maybe try font size="16px" or such? Not sure why you doing it there. Can you not use CSS, either in-line or proper?
Rovshen Gurdov
@7urkm3n
Jan 10 2016 02:16
Your p element should contain the first few words of the provided additional kitty ipsum text.
<style>
  .red-text {
    color: red;
  }
</style>

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

<p class="red-text">kitty ipsum text</p>

<p class="red-text">kitty ipsum text</p>
Where is the problem ????
Anton Bredl
@antonbr13
Jan 10 2016 02:16

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.

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

function queue(arr, item) {
// Your code here
myArr = myArr.push(item);

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

Phillip Stolić
@Deadmano
Jan 10 2016 02:16
@tommygebru weird bug, report it! :)
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:16
I just used the kitty ipsum paragraph but only like 6 words
jchoi18
@jchoi18
Jan 10 2016 02:16
@rkmarks is there easy way to copy paste code
@rkmarks do ijust literally copy paste
Anton Bredl
@antonbr13
Jan 10 2016 02:16
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.
// Setup
var myArr = [1,2,3,4,5];

function queue(arr, item) {
  // Your code here
  myArr = myArr.push(item);

  return item;  // 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));
Rick Markins
@rkmarks
Jan 10 2016 02:17
yes if you want it formated in here use "```"
and then shift enter
Anton Bredl
@antonbr13
Jan 10 2016 02:17
I seem to be pretty stuck here - could someone help me
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:17
@antonbr13 the queue thing really messed me up badly. I can check to see what I did though!
FarionLord
@FarionLord
Jan 10 2016 02:17
@7urkm3n try <p> Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. </p>
Rick Markins
@rkmarks
Jan 10 2016 02:17
that will allow you to paste your code in a code format @jchoi18
Anton Bredl
@antonbr13
Jan 10 2016 02:17
@ajsnetiker thanks that would be awesome
CamperBot
@camperbot
Jan 10 2016 02:17
antonbr13 sends brownie points to @ajsnetiker :sparkles: :thumbsup: :sparkles:
:star: 223 | @ajsnetiker | http://www.freecodecamp.com/ajsnetiker
araff139
@araff139
Jan 10 2016 02:17
hello I need an answer to why "cat photos is not showing up as my anchor text <p>cat photos
<a href='http://freecatphotoapp.com'> </a> </p>
jchoi18
@jchoi18
Jan 10 2016 02:17
@rkmarks surround it with ''' '''?
CamperBot
@camperbot
Jan 10 2016 02:17
:bulb: to format code use backticks! ``` more info
Rovshen Gurdov
@7urkm3n
Jan 10 2016 02:17
thx
FarionLord
@FarionLord
Jan 10 2016 02:18
np
Phillip Stolić
@Deadmano
Jan 10 2016 02:18
help format
CamperBot
@camperbot
Jan 10 2016 02:18

: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

jchoi18
@jchoi18
Jan 10 2016 02:18
aha got it
lol thanks peeps

'''function update(id, prop, value) {
if (value == ""){
delete collection[id][prop];
}
else if (prop == "tracks"){
//if (collection[id].hasOwnProperty("tracks")){
collection[id][prop].push(value);
//}
//else {
//collection[id].tracks = [value];
//}
}
else {
collection[id][prop] = value;
}

return collection;
}

CamperBot
@camperbot
Jan 10 2016 02:18
:bulb: to format code use backticks! ``` more info
jchoi18
@jchoi18
Jan 10 2016 02:18
well
FarionLord
@FarionLord
Jan 10 2016 02:18
need to add space
``` function*
jchoi18
@jchoi18
Jan 10 2016 02:18

'''function update(id, prop, value) {
if (value == ""){
delete collection[id][prop];
}
else if (prop == "tracks"){
//if (collection[id].hasOwnProperty("tracks")){
collection[id][prop].push(value);
//}
//else {
//collection[id].tracks = [value];
//}
}
else {
collection[id][prop] = value;
}

return collection;
}

CamperBot
@camperbot
Jan 10 2016 02:18
:bulb: to format code use backticks! ``` more info
jchoi18
@jchoi18
Jan 10 2016 02:18

''' function update(id, prop, value) {
if (value == ""){
delete collection[id][prop];
}
else if (prop == "tracks"){
//if (collection[id].hasOwnProperty("tracks")){
collection[id][prop].push(value);
//}
//else {
//collection[id].tracks = [value];
//}
}
else {
collection[id][prop] = value;
}

return collection;
}

CamperBot
@camperbot
Jan 10 2016 02:18
:bulb: to format code use backticks! ``` more info
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:18
@antonbr13 do you remember what section it was in or what # it was? I cant seem to find it on the map
FarionLord
@FarionLord
Jan 10 2016 02:19
still missing space after the ticks
@jchoi18
jchoi18
@jchoi18
Jan 10 2016 02:19
hmm its there
jchoi18
@jchoi18
Jan 10 2016 02:19
'''
CamperBot
@camperbot
Jan 10 2016 02:19
:bulb: to format code use backticks! ``` more info
FarionLord
@FarionLord
Jan 10 2016 02:19
oh ending
tommy
@tommygebru
Jan 10 2016 02:19
@Zackaroo1228 if the problem for styling the text red , was the extra semicolons on the screen I sent a bug report, just ignore for now :smile:
Phillip Stolić
@Deadmano
Jan 10 2016 02:19
Backticks ``` not single quotes '''.
CamperBot
@camperbot
Jan 10 2016 02:19
:bulb: to format code use backticks! ``` more info
FarionLord
@FarionLord
Jan 10 2016 02:19
return collection;
} ```*
jchoi18
@jchoi18
Jan 10 2016 02:19
@Deadmano haha thanks
CamperBot
@camperbot
Jan 10 2016 02:19
jchoi18 sends brownie points to @deadmano :sparkles: :thumbsup: :sparkles:
:star: 135 | @deadmano | http://www.freecodecamp.com/deadmano
Mahtab
@RoadToCode822
Jan 10 2016 02:19
Hmm still struggling…
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  if (myObj["checkProp"]) {
    return myObj.checkProp;
  }

  else{
  return "Not Found";
  }
}

// Test your code by modifying these values
checkObj("gift");
Anton Bredl
@antonbr13
Jan 10 2016 02:20
Basic JavaScript (10hrs) - Checkpoint: Stand in Line @ajsnetiker
jchoi18
@jchoi18
Jan 10 2016 02:20
function update(id, prop, value) {
  if (value == ""){
    delete collection[id][prop];
  }
  else if (prop == "tracks"){
    //if (collection[id].hasOwnProperty("tracks")){
    collection[id][prop].push(value);
    //}
    //else {
      //collection[id].tracks = [value];
    //}
  }
  else {
    collection[id][prop] = value;
  }

  return collection;
}
@rkmarks there you go
FarionLord
@FarionLord
Jan 10 2016 02:20
hmm
Rick Markins
@rkmarks
Jan 10 2016 02:21
Thank you @jchoi18 now i see where I went wrong as well
CamperBot
@camperbot
Jan 10 2016 02:21
rkmarks sends brownie points to @jchoi18 :sparkles: :thumbsup: :sparkles:
:star: 289 | @jchoi18 | http://www.freecodecamp.com/jchoi18
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:21
how do you do the black boxes of code again?
Rick Markins
@rkmarks
Jan 10 2016 02:22
camperbot code formatting
Anton Bredl
@antonbr13
Jan 10 2016 02:22
```
Mahtab
@RoadToCode822
Jan 10 2016 02:22
This message was deleted
Anton Bredl
@antonbr13
Jan 10 2016 02:22
code in the middle and finish on the next line with 3 more
```
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:22
yeah i cant find that character my ' is straight
Rick Markins
@rkmarks
Jan 10 2016 02:23
its above tab
Anton Bredl
@antonbr13
Jan 10 2016 02:23
on the upper left side of keyboard
Rick Markins
@rkmarks
Jan 10 2016 02:23
on the keyboard
Anton Bredl
@antonbr13
Jan 10 2016 02:23
yes above tab
Mahtab
@RoadToCode822
Jan 10 2016 02:23
This message was deleted
FarionLord
@FarionLord
Jan 10 2016 02:23
or ~
under esc
DFC302
@DFC302
Jan 10 2016 02:23

ok, can anyone show me what I am doing wrong here?

For example, let's make all of your button elements bounce. Just add this code inside your document ready function:

$("button").addClass("animated bounce");

MY CODE:

<script>
$(document).ready(function() {
$("button").addClass("animatedbounce");
});
</script>

Adam Snetiker
@ajsnetiker
Jan 10 2016 02:24
@antonbr13 thanks
function queue(arr, item) {
  // Your code here
  myArr.push(item);
  var removed = myArr.shift();
  return removed;  // Change this line
}
CamperBot
@camperbot
Jan 10 2016 02:24
ajsnetiker sends brownie points to @antonbr13 :sparkles: :thumbsup: :sparkles:
:star: 206 | @antonbr13 | http://www.freecodecamp.com/antonbr13
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:24
that's the middle part of mine
jchoi18
@jchoi18
Jan 10 2016 02:24
@DFC302 think it's your class string
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:24
pushed the second item, removed the first. took ages for me to figure that out though!
FarionLord
@FarionLord
Jan 10 2016 02:25
mehh do Set payload windows/meterpreter/reverse_tcp no don't do it....
Anton Bredl
@antonbr13
Jan 10 2016 02:25
@ajsnetiker dude thanks so much
CamperBot
@camperbot
Jan 10 2016 02:25
antonbr13 sends brownie points to @ajsnetiker :sparkles: :thumbsup: :sparkles:
:warning: antonbr13 already gave ajsnetiker points
DFC302
@DFC302
Jan 10 2016 02:25
@jchoi18 not sure exactly what that means, sorry
Shahid Foy
@shahidfoy
Jan 10 2016 02:25
@DFC302 add a space between animated and bounce
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:26
i'm stuck on another one but i wanna figure it out for myself
DFC302
@DFC302
Jan 10 2016 02:26
ok let me try that
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:26
some of these are tough even though they sounded easy when i first saw them
tommy
@tommygebru
Jan 10 2016 02:26
@DFC302 should the targeted element "button" be a class as well ?
jchoi18
@jchoi18
Jan 10 2016 02:26
@DFC302 yea in the instruction it says animated bounce but you had animatedbounce
@tommygebru i think its just a <button> tag
DFC302
@DFC302
Jan 10 2016 02:27
gotcha ok let me try separating it
jchoi18
@jchoi18
Jan 10 2016 02:27
not a <div class="button">
FarionLord
@FarionLord
Jan 10 2016 02:27
@ajsnetiker JUST DO IT!!! DON'T LET YOUR DREAMS BE DREAMS!!! Insert image with triangle over crotch area ~ Shia
Erland Lami
@Texber
Jan 10 2016 02:27
So I have a quick question...If I write a variable inside a function and don't write var in front of it, does it become global in scope?
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:27
yeah you need a space between classes
jchoi18
@jchoi18
Jan 10 2016 02:27
@Texber yes
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:27
@FarionLord what?
Erland Lami
@Texber
Jan 10 2016 02:27
so always write variables with var no matter what @jchoi18 thanks
CamperBot
@camperbot
Jan 10 2016 02:27
texber sends brownie points to @jchoi18 :sparkles: :thumbsup: :sparkles:
:star: 292 | @jchoi18 | http://www.freecodecamp.com/jchoi18
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:28
@Texber no i think it becoms unknown. Global just means you define it outside a function, anything inside a function can only be used by that function
FarionLord
@FarionLord
Jan 10 2016 02:28
jchoi18
@jchoi18
Jan 10 2016 02:28
@ajsnetiker var defines the scope, if you don't use var to declare a new variable it becomes global which is not recommended
even if defined in a function
tommy
@tommygebru
Jan 10 2016 02:28
@FarionLord you are going to the top
DFC302
@DFC302
Jan 10 2016 02:28
that was it thanks @jchoi18 thanks @shahidfoy
CamperBot
@camperbot
Jan 10 2016 02:28
dfc302 sends brownie points to @jchoi18 and @shahidfoy :sparkles: :thumbsup: :sparkles:
:star: 293 | @jchoi18 | http://www.freecodecamp.com/jchoi18
:star: 320 | @shahidfoy | http://www.freecodecamp.com/shahidfoy
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:29
@FarionLord haha thanks for that
CamperBot
@camperbot
Jan 10 2016 02:29
ajsnetiker sends brownie points to @farionlord :sparkles: :thumbsup: :sparkles:
:star: 17 | @farionlord | http://www.freecodecamp.com/farionlord
Erland Lami
@Texber
Jan 10 2016 02:29
I see, cause the it asks me to write a variable inside the function without var but is not clear what happens
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:29
shia's a goon
FarionLord
@FarionLord
Jan 10 2016 02:29
@ajsnetiker np
jchoi18
@jchoi18
Jan 10 2016 02:29
@Texber if you see the rest of the code they give you it'll make sense. You are able to access that variable outside that function
Erland Lami
@Texber
Jan 10 2016 02:29
@ajsnetiker thanks
CamperBot
@camperbot
Jan 10 2016 02:29
texber sends brownie points to @ajsnetiker :sparkles: :thumbsup: :sparkles:
:star: 224 | @ajsnetiker | http://www.freecodecamp.com/ajsnetiker
jchoi18
@jchoi18
Jan 10 2016 02:29
@Texber in another func
Erland Lami
@Texber
Jan 10 2016 02:29
I see
jchoi18
@jchoi18
Jan 10 2016 02:30
i never knew the chat rooms were so active
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:30
i think im done for today actually i was trying to finish the long 10 hour section, i have like 5 more things but i'm stuck, need a break at least
Anton Bredl
@antonbr13
Jan 10 2016 02:30
RangeError: Maximum call stack size exceeded
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:30
@jchoi18 yeah they are. And depending on where you live there are meetups, i just joined the LA meetup, pretty cool group. Haven't met anyone yet but I plan on going soon
Anton Bredl
@antonbr13
Jan 10 2016 02:30
anyone have any idea why i would receive this from this code
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:31
trying to learn and looking for jobs, can't just sit back and hit' apply'...networking is the way to go
jchoi18
@jchoi18
Jan 10 2016 02:31
@antonbr13 think that happens when you have an algorithm that takes forever to complete
Anton Bredl
@antonbr13
Jan 10 2016 02:31
// Setup
var myArr = [1,2,3,4,5];

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

  return item;  // 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));
queue([], 1) should return 1
queue(2, 1) should return 2
After queue(myArr, 10), myArr[4] should be 10
jchoi18
@jchoi18
Jan 10 2016 02:31
@antonbr13 hmm myArr isn't a JSON
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:32
and conferences. Check out www.allremoteconfs.com they have a bunch, and they're online. You can buy packs where you get them for $100 each and they're all like 3 days. I'm attending the JS one, but there's Angular, React, Freelance and one for newbies along with a whole bunch more
jchoi18
@jchoi18
Jan 10 2016 02:32
is it your console logs that are causing the error?
@ajsnetiker thanks i'll look into them
CamperBot
@camperbot
Jan 10 2016 02:32
jchoi18 sends brownie points to @ajsnetiker :sparkles: :thumbsup: :sparkles:
:star: 225 | @ajsnetiker | http://www.freecodecamp.com/ajsnetiker
Anton Bredl
@antonbr13
Jan 10 2016 02:32
idk that is the test code that was prewritten
jchoi18
@jchoi18
Jan 10 2016 02:33
@antonbr13 oh interesting do you have anything in your queue function?
Adam Snetiker
@ajsnetiker
Jan 10 2016 02:33
I'll be back later probably, or tomorrow. I'm worn out for now, have a good one
jchoi18
@jchoi18
Jan 10 2016 02:33
i guess arrays are JSON
you too @ajsnetiker
Davy
@watchoutcritters
Jan 10 2016 02:34
@antonbr13 you'll need to use push() and shift()
Anton Bredl
@antonbr13
Jan 10 2016 02:34
@jchoi18 sorry yeah my current code is below:
// Setup
var myArr = [1,2,3,4,5];

function queue(arr, item) {
  // Your code here
  myArr.push(item);
  var removed = myArr.shift();
  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));
Davy
@watchoutcritters
Jan 10 2016 02:35
instead of myArr.push try arr.push
jchoi18
@jchoi18
Jan 10 2016 02:35
oh yea
Davy
@watchoutcritters
Jan 10 2016 02:35
and same with the shift
FarionLord
@FarionLord
Jan 10 2016 02:36
Does anyone of you want to learn how to hack? grammar 10/10
Anton Bredl
@antonbr13
Jan 10 2016 02:36
yeah i had tried that previously
no luck
Tim Myers
@denvercoder
Jan 10 2016 02:36
How to hack the Gibson?
Davy
@watchoutcritters
Jan 10 2016 02:37
This is what I did:
jchoi18
@jchoi18
Jan 10 2016 02:37
hmm arr.push(item) and arr.shift should be right
Anton Bredl
@antonbr13
Jan 10 2016 02:37
@watchoutcritters @jchoi18 the arr.push() and arr.shift() do not change the "Maximum call stack size exceeded error
tommy
@tommygebru
Jan 10 2016 02:37
did i miss something ?
Himad Mouhtar
@hmouhtar
Jan 10 2016 02:37
Waypoint: Escape Sequences in Strings
Davy
@watchoutcritters
Jan 10 2016 02:38
@antonbr13 function queue(arr, item) {
arr.push(item); // Your code here
var shifted = arr.shift();
return shifted; // Change this line
}
FarionLord
@FarionLord
Jan 10 2016 02:38
@timmyers1978 there you go http://xeushack.com/ oh and here the cookie monster https://www.youtube.com/watch?v=8wXBe2jTdx4
Anton Bredl
@antonbr13
Jan 10 2016 02:38
@watchoutcritters yeah that is essentially the same as my current
Tim Myers
@denvercoder
Jan 10 2016 02:39
Flu Shot, what the heck is a flu shot?
tommy
@tommygebru
Jan 10 2016 02:39
@hmouhtar remember that there is a space between each:smile:
Anton Bredl
@antonbr13
Jan 10 2016 02:39
i switched yours in and am still getting the same RangeError Message
Tim Myers
@denvercoder
Jan 10 2016 02:40
@antonbr13 I've been saying this all day but refresh your browser and try again
FarionLord
@FarionLord
Jan 10 2016 02:40
@timmyers1978 Just give it up.
Himad Mouhtar
@hmouhtar
Jan 10 2016 02:40
as = "hola";
return as;
this is a ilegal return statement
why?
jchoi18
@jchoi18
Jan 10 2016 02:41
@hmouhtar is it in a function?
Himad Mouhtar
@hmouhtar
Jan 10 2016 02:41
no
jchoi18
@jchoi18
Jan 10 2016 02:41
@hmouhtar only function returns things
Himad Mouhtar
@hmouhtar
Jan 10 2016 02:41
oh, got it haha thanks
jchoi18
@jchoi18
Jan 10 2016 02:41
haha np
Anton Bredl
@antonbr13
Jan 10 2016 02:42
yeah i went to the report a bug and that was the first thing it said to do - SUCCESS!
thanks @jchoi18 @watchoutcritters @timmyers1978
CamperBot
@camperbot
Jan 10 2016 02:42
antonbr13 sends brownie points to @jchoi18 and @watchoutcritters and @timmyers1978 :sparkles: :thumbsup: :sparkles:
:star: 247 | @timmyers1978 | http://www.freecodecamp.com/timmyers1978
:star: 212 | @watchoutcritters | http://www.freecodecamp.com/watchoutcritters
:star: 294 | @jchoi18 | http://www.freecodecamp.com/jchoi18
Raymond To
@rayto510
Jan 10 2016 02:59
what am i doing wrong here?

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

function checkObj(checkProp) {
// Your Code Here
if (myObj.hasOwnProperty(checkProp) === true)
{ return myObj.checkProp;
} else { return "Not Found";
}

}

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

btw, how do you copy the code onto github without it looking like this?
Eina
@thelittleblacksmith
Jan 10 2016 02:59
help format
CamperBot
@camperbot
Jan 10 2016 02:59

: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

Eina
@thelittleblacksmith
Jan 10 2016 02:59
@rayto510 access checkprop in your return with bracket notations
jchoi18
@jchoi18
Jan 10 2016 03:00
@rayto510 you can't use the dot notation for variable names since dot notations look for the literal thing
Abdul Awali
@awalthefirst
Jan 10 2016 03:00
@rayto510 if (myObj.hasOwnProperty[checkProp])
@rayto510 return myObj[checkProp]
jchoi18
@jchoi18
Jan 10 2016 03:01
@awalthefirst the function call should still be ()
Raymond To
@rayto510
Jan 10 2016 03:02

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

function checkObj(checkProp) {
// Your Code Here
if (myObj.hasOwnProperty(checkProp) === true)
{ return myObj[checkProp];
} else { return "Not Found";
}

}

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

okay i failed pasting onto here
but i got it. thanks guys!
Abdul Awali
@awalthefirst
Jan 10 2016 03:02
@jchoi18 everything is good except for the changes i posted
Raymond To
@rayto510
Jan 10 2016 03:03

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

function checkObj(checkProp) {
// Your Code Here
if (myObj.hasOwnProperty(checkProp) === true)
{ return myObj[checkProp];
} else { return "Not Found";
}

}

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

nvm
jchoi18
@jchoi18
Jan 10 2016 03:04
@awalthefirst i think you just meant the second change. You can't call the function hasOwnProperty using []
FarionLord
@FarionLord
Jan 10 2016 03:04

Your h2 element should use the font Lobster. Your h2 element should degrade to the font Monospace when Lobster is not available. ``` <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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

h2 {
font-family: <!-- Lobster -->, Monospace;

}

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

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

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

<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p> ``` what am I doing wrong?

Abdul Awali
@awalthefirst
Jan 10 2016 03:05
@jchoi18 right.. i missed it
jchoi18
@jchoi18
Jan 10 2016 03:06
np lol im sure you got it. @FarionLord you have Lobster commented out
FarionLord
@FarionLord
Jan 10 2016 03:06
Comment out your call to Google for the Lobster font by putting <!-- in front of it. Be sure to close your comment by adding -->.
cannelflow
@cannelflow
Jan 10 2016 03:06
help code format
CamperBot
@camperbot
Jan 10 2016 03:06

: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

cannelflow
@cannelflow
Jan 10 2016 03:07
@FarionLord
FarionLord
@FarionLord
Jan 10 2016 03:07
thanks @cannelflow
CamperBot
@camperbot
Jan 10 2016 03:07
farionlord sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 373 | @cannelflow | http://www.freecodecamp.com/cannelflow
FarionLord
@FarionLord
Jan 10 2016 03:07
have some points
cannelflow
@cannelflow
Jan 10 2016 03:07
:)
FarionLord
@FarionLord
Jan 10 2016 03:08
:smile:
jchoi18
@jchoi18
Jan 10 2016 03:08
@FarionLord oh nvm the goal is to degrade the font family. Hmm does the font family change on the live screen
when you comment it out
FarionLord
@FarionLord
Jan 10 2016 03:09
I did it!
jchoi18
@jchoi18
Jan 10 2016 03:09
nice :D
FarionLord
@FarionLord
Jan 10 2016 03:09
The instruction was not that clear so I thought they meant the h2 element not the call.
tommy
@tommygebru
Jan 10 2016 03:09
Checkpoint: Counting Cards http://www.freecodecamp.com/challenges/checkpoint-counting-cards#
var count = 0;

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


  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(-5); cc(-3); cc(5); cc('K'); cc('A');
cannelflow
@cannelflow
Jan 10 2016 03:10
@tommygebru tried something ?
FarionLord
@FarionLord
Jan 10 2016 03:10
well here goes nothing again <p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
well....
cannelflow
@cannelflow
Jan 10 2016 03:11
@tommygebru you are returning string by count = "+1"; use count++ instead
FarionLord
@FarionLord
Jan 10 2016 03:11
<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
cannelflow
@cannelflow
Jan 10 2016 03:11
@tommygebru remove count and return after case 9
FarionLord
@FarionLord
Jan 10 2016 03:11
<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
meh will go with this.
cannelflow
@cannelflow
Jan 10 2016 03:13
@tommygebru worked?
help repos
CamperBot
@camperbot
Jan 10 2016 03:14
no wiki entry for: repos
tommy
@tommygebru
Jan 10 2016 03:14
This message was deleted
cannelflow
@cannelflow
Jan 10 2016 03:14
@tommygebru implemented what i told yut ?
repos
Eric Koeppel
@ekoeppel
Jan 10 2016 03:14
Has anyone done the Js checkpoint: golf code? I am trying to figure out if I am supposed to use else if or else.
tommy
@tommygebru
Jan 10 2016 03:15
@cannelflow remove count and return after case9:
cannelflow
@cannelflow
Jan 10 2016 03:15
@tommygebru yes
FarionLord
@FarionLord
Jan 10 2016 03:15
@tommygebru need motivation? Well now you can go to https://www.reddit.com/r/getmotivated but wait theres more if you go to the link right now you can also watch this https://www.youtube.com/watch?v=ZXsQAXx_ao0
cannelflow
@cannelflow
Jan 10 2016 03:16
@ekoeppel or use switch
tommy
@tommygebru
Jan 10 2016 03:16
@cannelflow this would be easier visually
FarionLord
@FarionLord
Jan 10 2016 03:16
You are welcome
tommy
@tommygebru
Jan 10 2016 03:16
@FarionLord funny the first time :worried:
cannelflow
@cannelflow
Jan 10 2016 03:16
@tommygebru yes
FarionLord
@FarionLord
Jan 10 2016 03:16
I cri everytim!
jchoi18
@jchoi18
Jan 10 2016 03:17
has anyone done the camper news zipline project
FarionLord
@FarionLord
Jan 10 2016 03:17
hmm
thanks @tommygebru
CamperBot
@camperbot
Jan 10 2016 03:17
farionlord sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 217 | @tommygebru | http://www.freecodecamp.com/tommygebru
FarionLord
@FarionLord
Jan 10 2016 03:17
so you were saying?
cannelflow
@cannelflow
Jan 10 2016 03:17
@ekoeppel else if for counting cards then if else for return
cannelflow
@cannelflow
Jan 10 2016 03:17
help code formate @tommygebru
CamperBot
@camperbot
Jan 10 2016 03:17
no wiki entry for: code formate @tommygebru
cannelflow
@cannelflow
Jan 10 2016 03:18
help code formate
CamperBot
@camperbot
Jan 10 2016 03:18
no wiki entry for: code formate
Eric Koeppel
@ekoeppel
Jan 10 2016 03:18
@cannelflow ahh ok
@ekoeppel I don' think I havent gotten to switch yet, but I think i got the else if part mixed up
FarionLord
@FarionLord
Jan 10 2016 03:18
code format
tommy
@tommygebru
Jan 10 2016 03:18
@cannelflow Checkpoint: Counting Cards http://www.freecodecamp.com/challenges/checkpoint-counting-cards#
var count = 0;

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


  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(-5); cc(-3); cc(5); cc('K'); cc('A');
FarionLord
@FarionLord
Jan 10 2016 03:19
bot code format
CamperBot
@camperbot
Jan 10 2016 03:19

: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

cannelflow
@cannelflow
Jan 10 2016 03:19
@tommygebru count = "+1"; is a string not counting the value use count++ instead
FarionLord
@FarionLord
Jan 10 2016 03:19
@tommygebru here I will try to help you! What exercise are you on? nuber.
number*
cannelflow
@cannelflow
Jan 10 2016 03:20
@tommygebru no need of count at case 9 since it 0
and remove break and try after implementing everything
FarionLord
@FarionLord
Jan 10 2016 03:21
@tommygebru maybe you need some relaxing music? https://www.youtube.com/watch?v=IJiHDmyhE1A
tommy
@tommygebru
Jan 10 2016 03:22
So i passed not fully understanding give me a minute:smile
FarionLord
@FarionLord
Jan 10 2016 03:23
html<<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>.
```
welp I tried
Eric Koeppel
@ekoeppel
Jan 10 2016 03:24
if my function is function golfScore(par, strokes). my if statement should look like
if(golfScore <=1) correct?
cannelflow
@cannelflow
Jan 10 2016 03:24
@tommygebru worked ?
tommy
@tommygebru
Jan 10 2016 03:24
@cannelflow I guess i understand now apparently there is a loop action going on!
@FarionLord whats your question? :smile:
@ekoeppel worst problem of my day so far.... golfScore..... dont use the function as an argument in the if statement use the parameters par and stroke :smile:
@cannelflow am i right?
cannelflow
@cannelflow
Jan 10 2016 03:27
@ekoeppel no golfScore is a function here and variables are par and strokes so if(strokes==1) is correct
Eric Koeppel
@ekoeppel
Jan 10 2016 03:27
oooh ok
cannelflow
@cannelflow
Jan 10 2016 03:27
@tommygebru correct you are
Eric Koeppel
@ekoeppel
Jan 10 2016 03:28
thanks @tommygebru @cannelflow
CamperBot
@camperbot
Jan 10 2016 03:28
ekoeppel sends brownie points to @tommygebru and @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 374 | @cannelflow | http://www.freecodecamp.com/cannelflow
:star: 219 | @tommygebru | http://www.freecodecamp.com/tommygebru
FarionLord
@FarionLord
Jan 10 2016 03:29
@tommygebru please tell there is a program to solve this http://www.playzgame.com/online-flash-games/Eternity-II.php
me inser
t*
tommy
@tommygebru
Jan 10 2016 03:30
@FarionLord ?
FarionLord
@FarionLord
Jan 10 2016 03:31
go ahead play it.
maybe you will understand
tommy
@tommygebru
Jan 10 2016 03:32
@FarionLord you are a bit too distracting lol
FarionLord
@FarionLord
Jan 10 2016 03:32
thabks lol
thanks*
my spelling is sooo good.
Eva
@Ewei001
Jan 10 2016 03:35
'Use the provided code three times. One for each slot.')
'You should have used $('.slot')[0] at least once.')
'You should have used $('.slot')[1] at least once.')
'You should have used $('.slot')[2] at least once.')
'You should have used the slotOne value at least once.')
'You should have used the slotTwo value at least once.')
'You should have used the slotThree value at least once.')
// Only change code below this line.
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
$($('.slot')[1]).html('<img src = "' + images[slotTwo-1] + '">');
$($('.slot')[2]).html('<img src = "' + images[slotThree-1] + '">');

// Only change code above this line.
Excuse me, where is the wrong?
Eina
@thelittleblacksmith
Jan 10 2016 03:37
@Ewei001 what is the challenge called?
Eva
@Ewei001
Jan 10 2016 03:37
Waypoint: Give your JavaScript Slot Machine some Stylish Images
@thelittleblacksmith Waypoint: Give your JavaScript Slot Machine some Stylish Images
tommy
@tommygebru
Jan 10 2016 03:38
@thelittleblacksmith @Ewei001 or post a link !
Eva
@Ewei001
Jan 10 2016 03:39
Sorry, I don't understand what you mean.
Eina
@thelittleblacksmith
Jan 10 2016 03:39
@Ewei001 do you have a link? i can't seem to find the waypoint on the map o_O
cannelflow
@cannelflow
Jan 10 2016 03:42
@Ewei001 why i canot find this waypiont
@thelittleblacksmith me to
107
basic javascript
Eina
@thelittleblacksmith
Jan 10 2016 03:44
Huh, that's interesting
Brad940
@Brad940
Jan 10 2016 03:45
Hi, could I please get some guidance for Waypoint: Return Early Pattern for Functions? I don't understand what it's asking for.
Alexander Køpke
@alexanderkopke
Jan 10 2016 03:46
Instructions
Modify the function abTest so that if a or b are less than 0 the function will immediately exit with a value of undefined.
tommy
@tommygebru
Jan 10 2016 03:46
@Brad940 this one is straightforward if "a or b" is < 0 :smile:
João Mateus
@Jmateus88
Jan 10 2016 03:48
Hello everyone
Brad940
@Brad940
Jan 10 2016 03:48
Thanks @tommygebru Sorry I just played around a bit more and got it! I thought it should be straightforward but I was over thinking it.
Eric Koeppel
@ekoeppel
Jan 10 2016 03:48
hi]
CamperBot
@camperbot
Jan 10 2016 03:48
brad940 sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 220 | @tommygebru | http://www.freecodecamp.com/tommygebru
João Mateus
@Jmateus88
Jan 10 2016 03:48
can anyone help me out on the trunkated string bonfire?
CamperBot
@camperbot
Jan 10 2016 03:48
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Eva
@Ewei001
Jan 10 2016 03:48
Maybe I used the wrong address, has been updated.
tommy
@tommygebru
Jan 10 2016 03:49
@Jmateus88 have you tried the bonfire challenges chatroom?
João Mateus
@Jmateus88
Jan 10 2016 03:49
@tommygebru hi mate, im there now thanks
CamperBot
@camperbot
Jan 10 2016 03:49
jmateus88 sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 221 | @tommygebru | http://www.freecodecamp.com/tommygebru
Rovshen Gurdov
@7urkm3n
Jan 10 2016 03:52
Italicize the text in your target4 button by adding HTML tags.

<script>
  $(document).ready(function() {
      $("#target1").css("color", "red");
      $('#target4').html('<i>#target4<i/>')
  });
</script>
WHATS WRONG ????
Gabriel Dennis Parangan
@gparangan
Jan 10 2016 03:53
Can you help me on changing If/Else If to Switch Case?
function myTest(val) {
  var answer = "";
  // Only change code below this line

  switch (val) {
    case "bob":
        return "Marley"
        break;      
    case 42:
    return "The Answer";
      break;
    case 1:
    return "There is no #1";
      break;
    case 99: 
    return "Missed me by this much!";
      break;
    default: 
    return "Ate Nine";
  }
  // Only change code above this line  
  return answer;  
}

// Change this value to test
myTest(bob);
Rovshen Gurdov
@7urkm3n
Jan 10 2016 03:54
@gparangan U dnt need BREAK if you are returning it !
@gparangan What your test supposed to look like ?
tommy
@tommygebru
Jan 10 2016 03:55
@7urkm3n when using html it wipes away content, you have to make it new again :smile:
Jelani Thompson
@JelaniThompson
Jan 10 2016 03:55
Hey guys, does anyone know why this isn't logging to the console?
       <span class="controls workButton workMinus noSelect">-</span>
Gabriel Dennis Parangan
@gparangan
Jan 10 2016 03:56
@7urkm3n Idk what to do because the condition need 4 breaks
Jelani Thompson
@JelaniThompson
Jan 10 2016 03:56
$(".workMinus").on('click', function() {
    //time.setMinutes(minutes -= 1);
    console.log("test");
});
Gabriel Dennis Parangan
@gparangan
Jan 10 2016 03:56
@7urkm3n What do you mean text?
mb0207
@angelwyan
Jan 10 2016 03:56
Hey guys, quick question on Waypoint: Filter Arrays with filter
Rovshen Gurdov
@7urkm3n
Jan 10 2016 03:56
@gparangan Then u need smth like this, answer = "Marley"
mb0207
@angelwyan
Jan 10 2016 03:56

Can someone tell me why this doesn't work?
var oldArray = [1,2,3,4,5,6,7,8,9,10];
var newArray = [];

// Only change code below this line.

newArray = oldArray.filter(function(val){
return val > 5;
});

Rovshen Gurdov
@7urkm3n
Jan 10 2016 03:57
@gparangan assing to answer then return answer !
@gparangan u dnt need return there !
@gparangan
```
Gabriel Dennis Parangan
@gparangan
Jan 10 2016 03:57
@7urkm3n Ok thanks!
CamperBot
@camperbot
Jan 10 2016 03:57
gparangan sends brownie points to @7urkm3n :sparkles: :thumbsup: :sparkles:
:star: 260 | @7urkm3n | http://www.freecodecamp.com/7urkm3n
Rovshen Gurdov
@7urkm3n
Jan 10 2016 03:58
@gparangan
  switch (val) {
    case "bob":
        answer =  "Marley"
        break;      
    case 42:
    return "The Answer";
      break;
    case 1:
@tommygebru I tried few different ways. I dnt know whats wrong with this test
tommy
@tommygebru
Jan 10 2016 03:58
This message was deleted
mb0207
@angelwyan
Jan 10 2016 03:59
Nevermind..got it!
tommy
@tommygebru
Jan 10 2016 03:59
@7urkm3n text content will be changed therefore <>new content is italicized<>
Gabriel Dennis Parangan
@gparangan
Jan 10 2016 03:59
@7urkm3n Now I get.
Rovshen Gurdov
@7urkm3n
Jan 10 2016 03:59
@gparangan nice
@tommygebru so can u give me an answer which works
Gabriel Dennis Parangan
@gparangan
Jan 10 2016 04:00
@7urkm3n What is the proper way to put breaks? Can you explain?
tommy
@tommygebru
Jan 10 2016 04:01
@7urkm3n your answer should be return
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:01
@gparangan Break stops to looping as like return !
@gparangan
var answer = ''
answer = "me answer";
Gabriel Dennis Parangan
@gparangan
Jan 10 2016 04:02
@7urkm3n I see coz they require to break atleast 4
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:03

@gparangan

in your case have to use breaks, it stops going further in matches with switch case

tommy
@tommygebru
Jan 10 2016 04:03

@7urkm3n

switch (num) {
  case value1:
    statement1
    break;

repeat last three lines as an if and else if argument +statement and break ends the cycle but does not return... :smile:

Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:04

@gparangan

and Return does almost the same thing. just depends on Tests...

@gparangan

switch (num) {
  case value1:
    statement1
    break;

  case valu2:
return statement2;

same thing...

Gabriel Dennis Parangan
@gparangan
Jan 10 2016 04:05
Thanks again @7urkm3n
CamperBot
@camperbot
Jan 10 2016 04:05
gparangan sends brownie points to @7urkm3n :sparkles: :thumbsup: :sparkles:
:warning: gparangan already gave 7urkm3n points
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:05
@tommygebru
i need a that JQUERY code...
Raymond To
@rayto510
Jan 10 2016 04:06
// Setup
var myPlants = [
  { 
    type: "flowers",
    list: [
      "rose",
      "tulip",
      "dandelion"
    ]
  },
  {
    type: "trees",
    list: [
      "fir",
      "pine",
      "birch"
    ]
  }  
];

// Only change code below this line

var secondTree = myPlants; // Change this line
how do you get "pine" from this?
tommy
@tommygebru
Jan 10 2016 04:07

@7urkm3n ? are you referring to this
Italicize the text in your target4 button by adding HTML tags.

<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$('#target4').html('<i>#target4<i/>')
});
</script>

Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:07
@tommygebru Of course.

@rayto510

myPlants1.list1

try this one

Raymond To
@rayto510
Jan 10 2016 04:08
doesn't work
Franco Zapata
@Francozt01
Jan 10 2016 04:08
@rayto510 you need to use bracket notation there you have 1 main object with 2 objects inside adn each has 2 more objects... in this case you select the main myPlants[1].list[1];
TobyChow
@TobyChow
Jan 10 2016 04:08
function every(collection, pre) {
  //
  var falsy = /false|null|undefined|0|NaN|''/g ;
  for (pre in collection[pre]){
    if (falsy.test(collection[pre])){
      return false;
    }
    else {
      return true;
    }
  }  
}
why does my program not enter the for(pre..) loop?
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:08
@rayto510
myPlants[1].list[1]
Raymond To
@rayto510
Jan 10 2016 04:08
got it!
Franco Zapata
@Francozt01
Jan 10 2016 04:09
@rayto510 u need to assing that to the variable secondTree
Raymond To
@rayto510
Jan 10 2016 04:09
thanks
Boris Parov
@hackai
Jan 10 2016 04:09
hi everyone
tommy
@tommygebru
Jan 10 2016 04:10
@7urkm3n it must be an issue with double quotes !! sorry if i confused you earlier :smile:
Franco Zapata
@Francozt01
Jan 10 2016 04:10
@rayto510 would be better if u thanks with @ name of who helped u that way u would be giving him 1 point
CamperBot
@camperbot
Jan 10 2016 04:10
francozt01 sends brownie points to @rayto510 :sparkles: :thumbsup: :sparkles:
:star: 216 | @rayto510 | http://www.freecodecamp.com/rayto510
Jelani Thompson
@JelaniThompson
Jan 10 2016 04:10
Hey there, anyone available to help me out?
Franco Zapata
@Francozt01
Jan 10 2016 04:11
@JelaniThompson what u need
Boris Parov
@hackai
Jan 10 2016 04:11
i'm trying to move to next level in JS and this is a bit confusing. It's asking me the following: Assign the contents of a to variable b.
Raymond To
@rayto510
Jan 10 2016 04:12
haha okay. thank you @Francozt01
CamperBot
@camperbot
Jan 10 2016 04:12
rayto510 sends brownie points to @francozt01 :sparkles: :thumbsup: :sparkles:
:star: 445 | @francozt01 | http://www.freecodecamp.com/francozt01
Franco Zapata
@Francozt01
Jan 10 2016 04:12
@hackai if u have a variable ''a'' var a = 1; u can assign that variable to be by delcarin var b = a;
tommy
@tommygebru
Jan 10 2016 04:12
@gparangan show the code next time for quicker help :smile:
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:12

@tommygebru

did u do that JQUERY assignment ?

Franco Zapata
@Francozt01
Jan 10 2016 04:12
@rayto510 hahah np :D :+1:
tommy
@tommygebru
Jan 10 2016 04:12
@7urkm3n yes we have the same code :smile:
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:13
@tommygebru but mine gives error still
Franco Zapata
@Francozt01
Jan 10 2016 04:13
@hackai assign a to B by declaring var b = a;
tommy
@tommygebru
Jan 10 2016 04:13
@7urkm3n ok sometimes you have to clear the code you've written and reset the page to original, or close browser and start up again...
Franco Zapata
@Francozt01
Jan 10 2016 04:14
@hackai or the second variable to the one the exercise is asking you to declare with the first as an assignment
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:14
@tommygebru xd ))
tommy
@tommygebru
Jan 10 2016 04:15
@7urkm3n ?
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:15
@tommygebru probably yes...
tommy
@tommygebru
Jan 10 2016 04:15
@7urkm3n also ignore the quote thing my challenge passed.... therefore yours should as well :smile:
Jelani Thompson
@JelaniThompson
Jan 10 2016 04:15
@Francozt01 Oh for this when I click the specified class it won't dislpay anything
or, doesn't do as instructed
Boris Parov
@hackai
Jan 10 2016 04:16
@Francozt01 thanks for u help
CamperBot
@camperbot
Jan 10 2016 04:16
hackai sends brownie points to @francozt01 :sparkles: :thumbsup: :sparkles:
:star: 446 | @francozt01 | http://www.freecodecamp.com/francozt01
Jelani Thompson
@JelaniThompson
Jan 10 2016 04:16
$(".workMinus").on('click', function() {
    //time.setMinutes(minutes -= 1);
    console.log("test");
});
Franco Zapata
@Francozt01
Jan 10 2016 04:16
@hackai worked?
Jelani Thompson
@JelaniThompson
Jan 10 2016 04:16
and
                <span class="controls workButton workMinus noSelect">-</span>
@Francozt01 Do you know hwat the issue might be?
Boris Parov
@hackai
Jan 10 2016 04:17
yep! i had var a = b; and it didn't , but switched the var b=a; and it worked, thanks again
Eric Koeppel
@ekoeppel
Jan 10 2016 04:17
anyone else get their butt kicked on the Checkpoint: Golf code, I haven't done switches yet so I can't imagine it wants me to use them.
tommy
@tommygebru
Jan 10 2016 04:17
This message was deleted
Franco Zapata
@Francozt01
Jan 10 2016 04:18
@hackai ok :+1:
@JelaniThompson u want to make a click and execute the function with the console.log("test")
@JelaniThompson can u provide the link to the exercise pls?
Jelani Thompson
@JelaniThompson
Jan 10 2016 04:22
uh sure
tommy
@tommygebru
Jan 10 2016 04:23
@ekoeppel Golf code is asked to be a rather large if /else statement and done top to bottom as shown in the chart :smile:
Ricardo Sanchez
@ricsanm
Jan 10 2016 04:23
// Setup
var myPlants = [
  { 
    type: "flowers",
    list: [
      "rose",
      "tulip",
      "dandelion"
    ]
  },
  {
    type: "trees",
    list: [
      "fir",
      "pine",
      "birch"
    ]
  }  
];

// Only change code below this line

var secondTree = myPlants.trees[1]; // Change this line
Hey guys. Any clue as to what I'm doing wrong? the waypoint asks to Retrieve the second tree from the variable myPlants using object dot and array bracket notation.
tommy
@tommygebru
Jan 10 2016 04:24
@ricsanm remember that to get to trees you are accessing an array :smile:
Jelani Thompson
@JelaniThompson
Jan 10 2016 04:24
@Francozt01
Bonefire Pomodoro
Oh, I thought that was a command lol
oh wait
That explains it
Franco Zapata
@Francozt01
Jan 10 2016 04:25
@ricsanm u need to select the 1 object in plants and then u select the rest so u need myPlants[1].list[1];
Jelani Thompson
@JelaniThompson
Jan 10 2016 04:25
It's a zipline lol
Franco Zapata
@Francozt01
Jan 10 2016 04:25
lol
Eric Koeppel
@ekoeppel
Jan 10 2016 04:26
@tommygebru
oops lol
tommy
@tommygebru
Jan 10 2016 04:26
@ricsanm did you understand?
Ricardo Sanchez
@ricsanm
Jan 10 2016 04:26
var ourPets = { 
  "cats": [
    "Meowzer",
    "Fluffy",
    "Kit-Cat"
  ],
  "dogs": [
    "Spot",
    "Bowser",
    "Frankie"
  ]
};
ourPets.cats[1]; // "Fluffy"
ourPets.dogs[0]; // "Spot"
That doesn't seem to work. This is the example given by the Waypoint of how to access nested arrays in JSON @Francozt01 @tommygebru
Literally doing the same as the example
tommy
@tommygebru
Jan 10 2016 04:26
@ekoeppel were you able to pass?
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:27
@tommygebru I just skipped for now... maybe some bugs there...
Franco Zapata
@Francozt01
Jan 10 2016 04:27
@JelaniThompson to be honest i haven't do any zippline :D
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:27
@ricsanm
Eric Koeppel
@ekoeppel
Jan 10 2016 04:27
@tommygebru working on it right now, I guess im not sure what to put when it says <= par -2. Is that if(par <= -2)
Ricardo Sanchez
@ricsanm
Jan 10 2016 04:27
@7urkm3n Yes?
tommy
@tommygebru
Jan 10 2016 04:27
@7urkm3n truth.... don't worry come back to it later :+1:
@ekoeppel strokes <=par-2
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:28
@ricsanm
whats problem ?
Ricardo Sanchez
@ricsanm
Jan 10 2016 04:28
@7urkm3n
// Setup
var myPlants = [
  { 
    type: "flowers",
    list: [
      "rose",
      "tulip",
      "dandelion"
    ]
  },
  {
    type: "trees",
    list: [
      "fir",
      "pine",
      "birch"
    ]
  }  
];

// Only change code below this line

var secondTree = myPlants.trees[1]; // Change this line
tommy
@tommygebru
Jan 10 2016 04:29
@ekoeppel like those x and y charts when plotting a graph
Ricardo Sanchez
@ricsanm
Jan 10 2016 04:29
Thats the code, while this is the example given to solve it
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:29
@ricsanm what u have to get ?
Ricardo Sanchez
@ricsanm
Jan 10 2016 04:29
var ourPets = { 
  "cats": [
    "Meowzer",
    "Fluffy",
    "Kit-Cat"
  ],
  "dogs": [
    "Spot",
    "Bowser",
    "Frankie"
  ]
};
ourPets.cats[1]; // "Fluffy"
ourPets.dogs[0]; // "Spot"
Eric Koeppel
@ekoeppel
Jan 10 2016 04:29
@tommygebru ok, thanks
CamperBot
@camperbot
Jan 10 2016 04:29
ekoeppel sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 222 | @tommygebru | http://www.freecodecamp.com/tommygebru
Ricardo Sanchez
@ricsanm
Jan 10 2016 04:29
The second tree from the myPlants variable
Franco Zapata
@Francozt01
Jan 10 2016 04:29
@ricsanm actually is the same bro cuz in the myPlants array u have 2 objects with 2 more inside each one ... the location to the second object which have Type and List as inner objects is myPlants1 and pine is inside the 2 object inside list
Ricardo Sanchez
@ricsanm
Jan 10 2016 04:30
Oh god, I hadn't realized that. Thanks @Francozt01
CamperBot
@camperbot
Jan 10 2016 04:30
ricsanm sends brownie points to @francozt01 :sparkles: :thumbsup: :sparkles:
:star: 447 | @francozt01 | http://www.freecodecamp.com/francozt01
Franco Zapata
@Francozt01
Jan 10 2016 04:30
@ricsanm np :+1:
Eric Koeppel
@ekoeppel
Jan 10 2016 04:31
so it should look like
if(strokes == 1)
return "Hole-in-one";
}
if(par<=-2)
return "Eagle";
}
and so on ? not sure where the else goes into it. If you are just trying to test each part of the chart, shouldnt it just be if statements?
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:32
@ekoeppel
if or switch statements both works
tommy
@tommygebru
Jan 10 2016 04:32
@7urkm3n correct but that is the next lesson
@ekoeppel else if , happens after first if statement
Eric Koeppel
@ekoeppel
Jan 10 2016 04:33
Else executes when the first statement is false correct? so use else wouldn't work? @7urkm3n They said to use switch statements earlier, but I havent gotten to that section yet, so I am assuming I have to use if/ else statements. I was just having a hard time wrapping my head around it heh and @tommygebru is super patient with me heh
Vishwanath Kamble
@vishukamble
Jan 10 2016 04:33
Can anyone help me understand what I am missing in this:
Use filter to remove all elements from oldArray that are greater than 5.
var oldArray = [1,2,3,4,5,6,7,8,9,10];
var newArray = [];

// Only change code below this line.

newArray = newArray.filter(function(oldArray)
      {
  return oldArray<=5;
});
Eric Koeppel
@ekoeppel
Jan 10 2016 04:33
ok so else if goes after
TobyChow
@TobyChow
Jan 10 2016 04:34
@vishukamble you used < instead of > I think?
tommy
@tommygebru
Jan 10 2016 04:34
if (condition) {
block of code to be executed if the condition is true
}
else if (condition){
block of code to be executed if the condition is false
}
else if (condition){
block of code to be executed if the condition is false
}
else {
block of code to be executed if the condition is false
}
Vishwanath Kamble
@vishukamble
Jan 10 2016 04:35
@Toe125 Nah doesn't work. Tried <, >, <=, >=
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:35

@ekoeppel

corrent, if false then jump to else ....

a = 1
b = 0
if(a < b){
print b
}else if( b < a){
print a
}else{
print equal
}
AgoraCoder
@AgoraCoder
Jan 10 2016 04:35
What the heck...? The Palindrome Bonfire challenge says to "remove non-alpha numeric characters"... but the last "test" is a bunch on non-alphanumeric characters... :/
blob
Eric Koeppel
@ekoeppel
Jan 10 2016 04:36
thanks for the help @7urkm3n @tommygebru. This is the first checkpoint I hit a wall with
CamperBot
@camperbot
Jan 10 2016 04:36
ekoeppel sends brownie points to @7urkm3n and @tommygebru :sparkles: :thumbsup: :sparkles:
:warning: ekoeppel already gave tommygebru points
:star: 267 | @7urkm3n | http://www.freecodecamp.com/7urkm3n
AgoraCoder
@AgoraCoder
Jan 10 2016 04:36
also, I am pretty sure there is a more efficient way to do it, but I just stole my code from the "reverse string" challenge... Any hints on optimization would be welcome.
TobyChow
@TobyChow
Jan 10 2016 04:36
@vishukamble ahh I got it, you have to apply .filter to oldArray, NOT newArray
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:37

@AgoraCoder let me know when u get it )))

just last test left

hemu1819
@hemu1819
Jan 10 2016 04:37
@vishukamble i think it should be oldArray.filter
TobyChow
@TobyChow
Jan 10 2016 04:37
@vishukamble oldArray.filter(....) , and change <= to >=
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:37
@AgoraCoder with (^-^) symbols were there...
tommy
@tommygebru
Jan 10 2016 04:37
@AgoraCoder hey have you tried the Bonfire Challenge room? :smile:
https://gitter.im/FreeCodeCamp/HelpBonfires?source=orgpage
CamperBot
@camperbot
Jan 10 2016 04:37
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Deepanshu Kaushik
@daksh844
Jan 10 2016 04:38

Hi All, any mistake I am making in this code
`// Setup
function phoneticLookup(val) {
var result = "";

// Only change code below this line
var result = {
"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");
`

TobyChow
@TobyChow
Jan 10 2016 04:38
explain format
CamperBot
@camperbot
Jan 10 2016 04:38

: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

tommy
@tommygebru
Jan 10 2016 04:39
This message was deleted
hemu1819
@hemu1819
Jan 10 2016 04:40
@daksh844 you defined two variables with same name as result
Vishwanath Kamble
@vishukamble
Jan 10 2016 04:40
@Toe125 @hemu1819 Worked and got the answer in console, but didn't pass the test :worried:
Deepanshu Kaushik
@daksh844
Jan 10 2016 04:40

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

// Only change code below this line
var result = {
"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");

```

CamperBot
@camperbot
Jan 10 2016 04:40
:bulb: to format code use backticks! ``` more info
hemu1819
@hemu1819
Jan 10 2016 04:40
@vishukamble try refreshing the page
Vishwanath Kamble
@vishukamble
Jan 10 2016 04:40
This message was deleted
tommy
@tommygebru
Jan 10 2016 04:41
@daksh844 is there a link this ?
TobyChow
@TobyChow
Jan 10 2016 04:41
@vishukamble did you return newArray?
Deepanshu Kaushik
@daksh844
Jan 10 2016 04:41
it's this one: Waypoint: Using Objects for Lookups
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:41
Italicize the text in your target4 button by adding HTML tags.

<script>
  $(document).ready(function() {
    $("#target4").html('<i>#target4<i/>')
  });
</script>
GIVE ME someone who did this, I wanna see the code what did u use !!!
tommy
@tommygebru
Jan 10 2016 04:41
@daksh844 close 3 backticks + shift+enter
Caro Strickland
@Scorks
Jan 10 2016 04:42
Hi @daksh844, the issue is that you're forgetting the call to your 'result' code within the function
Deepanshu Kaushik
@daksh844
Jan 10 2016 04:42

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

CamperBot
@camperbot
Jan 10 2016 04:42
:bulb: to format code use backticks! ``` more info
Vishwanath Kamble
@vishukamble
Jan 10 2016 04:43
@Toe125
newArray = oldArray.filter(function(newArray)
      {
  return newArray>5;
});
@daksh844
// 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");
@7urkm3n which challenge is that. I guess I did that few days ago
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:44
This message was deleted
tommy
@tommygebru
Jan 10 2016 04:44
@7urkm3n missing semicolon.... :smile:
Caro Strickland
@Scorks
Jan 10 2016 04:44
@daksh844 you need to say: result = lookup[val]; after the code you wrote
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:45
@tommygebru fixed, that was browser bug
Deepanshu Kaushik
@daksh844
Jan 10 2016 04:45
don't understand how will this work @Scorks
Rovshen Gurdov
@7urkm3n
Jan 10 2016 04:45
thx
TobyChow
@TobyChow
Jan 10 2016 04:46
This message was deleted
@vishukamble change to return newArray>=5 and return newArray after your filter function
Caro Strickland
@Scorks
Jan 10 2016 04:47
@daksh844 Right now, how is val being executed within lookup? It's not. Adding in that statement underneath the semicolon ending your 'lookup' variable will make it run.
Franco Zapata
@Francozt01
Jan 10 2016 04:47
@daksh844 need to return result[val]; i declared the variable as lookup and returned lookup[val]; is what the exercise ask for
Caro Strickland
@Scorks
Jan 10 2016 04:47
// Setup
var myPlants = [
  { 
    type: "flowers",
    list: [
      "rose",
      "tulip",
      "dandelion"
    ]
  },
  {
    type: "trees",
    list: [
      "fir",
      "pine",
      "birch"
    ]
  }  
];

// Only change code below this line

var secondTree = myPlants.trees[1]; // Change this line
Sorry, wrong one, haha. Hang on a second.
// 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"
  };

  result = lookup[val];

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

// Change this value to test
phoneticLookup("charlie");
hemu1819
@hemu1819
Jan 10 2016 04:48
@vishukamble oldArray.filter(function(value){ return value < 5})
Franco Zapata
@Francozt01
Jan 10 2016 04:48
@Scorks alpha should be beween ""
Caro Strickland
@Scorks
Jan 10 2016 04:49
@Francozt01 Yes, it should. That wasn't what the issue was in OPs code though.
tommy
@tommygebru
Jan 10 2016 04:49
@Scorks link please
Samantha North
@sjnorth
Jan 10 2016 04:49
Hi folks, quick question on waypoint "return a value from a function with return" - can anyone help out?
Franco Zapata
@Francozt01
Jan 10 2016 04:50
@sjnorth link pls
Caro Strickland
@Scorks
Jan 10 2016 04:50
@sjnorth post the question
Samantha North
@sjnorth
Jan 10 2016 04:50
@Scorks @Francozt01 this is my function: function timesFive(num) {
return num * 5;
}
var answer = timesFive(0);
Vishwanath Kamble
@vishukamble
Jan 10 2016 04:50
@hemu1819 arghh still doesn't work. I am getting the output in console.
Samantha North
@sjnorth
Jan 10 2016 04:51
It returns 25 for whichever value I enter, and says the test is correct... but this is not so
Caro Strickland
@Scorks
Jan 10 2016 04:51
also @Francozt01, for reference, you don't actually need the quotes around the LHS of the statements in Javascript.
hemu1819
@hemu1819
Jan 10 2016 04:51
@vishukamble pm me
Vishwanath Kamble
@vishukamble
Jan 10 2016 04:52
@hemu1819 NO it worked. It should be <= instead of <
Franco Zapata
@Francozt01
Jan 10 2016 04:52
@Scorks thanks :+1: maybe is because is what we learn in the exercise
CamperBot
@camperbot
Jan 10 2016 04:52
francozt01 sends brownie points to @scorks :sparkles: :thumbsup: :sparkles:
Samantha North
@sjnorth
Jan 10 2016 04:52
just wondering if i'm missing something or if its a bug
CamperBot
@camperbot
Jan 10 2016 04:52
:star: 216 | @scorks | http://www.freecodecamp.com/scorks
Vishwanath Kamble
@vishukamble
Jan 10 2016 04:52
thanks @hemu1819 @Toe125
CamperBot
@camperbot
Jan 10 2016 04:52
vishukamble sends brownie points to @hemu1819 and @toe125 :sparkles: :thumbsup: :sparkles:
:star: 316 | @hemu1819 | http://www.freecodecamp.com/hemu1819
:star: 280 | @toe125 | http://www.freecodecamp.com/toe125
Caro Strickland
@Scorks
Jan 10 2016 04:52
@sjnorth the code looks fine, hang on a second. Let me run it.
hemu1819
@hemu1819
Jan 10 2016 04:52
@vishukamble np :smile:
Samantha North
@sjnorth
Jan 10 2016 04:53
@Scorks OK
tommy
@tommygebru
Jan 10 2016 04:53
@sjnorth posting your link shares your solution with us :smile:
Samantha North
@sjnorth
Jan 10 2016 04:54
@tommygebru which link? just the browser one?
tommy
@tommygebru
Jan 10 2016 04:55
@sjnorth yeah you can share your tab
hemu1819
@hemu1819
Jan 10 2016 04:55
@sjnorth just return num * 5iny your function
Samantha North
@sjnorth
Jan 10 2016 04:56
@tommygebru (this does not seem like the best way to share the tab....any hints? i am new here)
Caro Strickland
@Scorks
Jan 10 2016 04:56
@sjnorth
function timesFive(num) {
  return num * 5;
}
var answer = timesFive(0);
@sjnorth that runs perfectly fine, and I'm pretty sure it's identical to what you had.
Samantha North
@sjnorth
Jan 10 2016 04:56
@hemu1819 that's what i've done, and the exercise shows as correct, but the return is always 25 no matter what the argument is
@Scorks ok, yes it is the same. (how did you make the snippet?)
Caro Strickland
@Scorks
Jan 10 2016 04:58
@sjnorth but if you look in the terminal, then you see the parameter is always 5, so despite your changing of the input, the console is basically just printing out what the test ran.
@sjnorth also, it's ``` on the top and bottom of the code.
Vishwanath Kamble
@vishukamble
Jan 10 2016 04:59
@sjnorth ` is on the left of 1 on your keyboard (not numpad)
Samantha North
@sjnorth
Jan 10 2016 04:59
function timesFive(num) {
  return num * 5;
}
var answer = timesFive(2);
hemu1819
@hemu1819
Jan 10 2016 04:59
function timesFive (num) { return num*5; }
Samantha North
@sjnorth
Jan 10 2016 04:59
thanks - didn't know this trick before...
tommy
@tommygebru
Jan 10 2016 04:59
@Scorks @sjnorth also using shift +enter to create space separating the ticks form the code
Samantha North
@sjnorth
Jan 10 2016 04:59
Thanks guys :)
Caro Strickland
@Scorks
Jan 10 2016 04:59
@tommygebru yep
@sjnorth you can always run your code through other online resources if you want 100% confirmation that it's not your function that's messing up the input (which it isn't)
hemu1819
@hemu1819
Jan 10 2016 05:01
var
Samantha North
@sjnorth
Jan 10 2016 05:01
@Scorks ok, good idea, i'll try in the chrome dev console
tommy
@tommygebru
Jan 10 2016 05:01
@sjnorth finally i see your concern, mark it as a bug and move on, i suppose :smile:
the challenge passes, however the console does not show a change in parameters
Samantha North
@sjnorth
Jan 10 2016 05:02
@tommygebru that's exactly what i'm gonna do :)
sudarshan gupta
@sudarshan395
Jan 10 2016 05:02
need help with the record colelction please
Vishwanath Kamble
@vishukamble
Jan 10 2016 05:02
@sjnorth lol make sure you read the guideliens :P
tommy
@tommygebru
Jan 10 2016 05:02
@sjnorth :+1:
hemu1819
@hemu1819
Jan 10 2016 05:03
@sjnorth i think you should delete var answer = timesFive(2);
sudarshan gupta
@sudarshan395
Jan 10 2016 05:04
record collection checkpoint please help
Vishwanath Kamble
@vishukamble
Jan 10 2016 05:04
@sudarshan395 where did you get stuck
sudarshan gupta
@sudarshan395
Jan 10 2016 05:04
function update(id, prop, value) {
if(value!=="") {
  collection.prop = value;
} 
  else if(prop=="tracks" && value!=="") {
 tracks = tracks.push[value];
}
  else(value=""); {
    delete collection.id.prop;
  }

  return collection;
}
Deepanshu Kaushik
@daksh844
Jan 10 2016 05:05
@Scorks can you help me out in this: Waypoint: Testing Objects for Properties
sudarshan gupta
@sudarshan395
Jan 10 2016 05:06
@vishukamble please see
Vishwanath Kamble
@vishukamble
Jan 10 2016 05:06
@sudarshan395
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.
sudarshan gupta
@sudarshan395
Jan 10 2016 05:06
how to update
Thomas Littlechild
@tommendable
Jan 10 2016 05:06
@sudarshan395 you need to search the collection id as well
Vishwanath Kamble
@vishukamble
Jan 10 2016 05:06
Make a check if prop==tracks
sudarshan gupta
@sudarshan395
Jan 10 2016 05:07
already done thatt
Deepanshu Kaushik
@daksh844
Jan 10 2016 05:07
Guys I'm unable to get the Javascript - also there are less number of facts explained
Thomas Littlechild
@tommendable
Jan 10 2016 05:07
@sudarshan395 also you cant do .prop as 'prop' is not a property of the record collection. you will need to use bracket notation so that it uses the input prop
Vishwanath Kamble
@vishukamble
Jan 10 2016 05:07
then push it to that id of collection
it can be done using collection[id].tracks.push(value)
also delete values should be in [] and not in periods (.)
hemu1819
@hemu1819
Jan 10 2016 05:08
@daksh844 where did you get stuck
Deepanshu Kaushik
@daksh844
Jan 10 2016 05:08
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here

 if(myObj.hasOwnProperty("gift") || myObj.hasOwnProperty("pet") || myObj.hasOwnProperty("bed")){
   return myObj;
 }
  else{
    return "Not Found";
  }


}

// Test your code by modifying these values
checkObj("gift");
```
sudarshan gupta
@sudarshan395
Jan 10 2016 05:09
now
function update(id, prop, value) {
if(value!=="") {
  collection[id].prop = value;
} 
  else if(prop=="tracks" && value!=="") {
 collection[id].tracks.push(value);
}
  else(value=""); {
    delete collection[id].prop;
  }

  return collection;
}
hemu1819
@hemu1819
Jan 10 2016 05:09
@daksh844 if (myObj.hasOwnProperty(checkProp))
Vishwanath Kamble
@vishukamble
Jan 10 2016 05:10
@sudarshan395 you don't need to specify a condition for else
If the 'if' condition and 'else if' condition are not satisfied it directly goes to else
else
     delete collection[id][prop];

@sudarshan395 You're checking the same condition twice if(value!=="")

in main if and else if

sudarshan gupta
@sudarshan395
Jan 10 2016 05:12
one error left
After update(1245, "tracks", "Addicted to Love"), tracks should have a length of 1
Vishwanath Kamble
@vishukamble
Jan 10 2016 05:13
structure it as
if(value!=="") 
{
condition 1
condition 2
}
else
delete ...
hemu1819
@hemu1819
Jan 10 2016 05:13
collection[id][prop].push(value);
Deepanshu Kaushik
@daksh844
Jan 10 2016 05:13
@hemu1819 can we also write a switch for this one?
Vishwanath Kamble
@vishukamble
Jan 10 2016 05:14
@sudarshan395 collection[id][prop] = value;
hemu1819
@hemu1819
Jan 10 2016 05:14
@daksh844 you just need to check for one condition
sudarshan gupta
@sudarshan395
Jan 10 2016 05:14
function update(id, prop, value) {
if(value!=="") {
  collection[id][prop] = value;
} 
  else if(prop=="tracks") {
 collection[id][prop].push(value);
}
 else

    delete collection[id][prop];


  return collection;
}
Krishnakanth Reddy Kolan
@Krishnakanth-Kolan
Jan 10 2016 05:15
Hi, can someone tell me what exactly does this mean? Encode the following sequence, separated by spaces:
backslash tab tab carriage-return new-line and assign it to myStr
hemu1819
@hemu1819
Jan 10 2016 05:15
@daksh844 if (myObj.hasOwnProperty(checkProp)){ return myObj[checkProp]; } else { return "Not Found"; }
tommy
@tommygebru
Jan 10 2016 05:16
@Krishnakanth-Kolan to the left information pane will show you the keyboard symbols.... that will be your string value :smile: dont forget spaces
Vishwanath Kamble
@vishukamble
Jan 10 2016 05:16
@sudarshan395
if(value!=="") 
{
if(prop=="tracks")
{
collection[id][prop].push(value);
}
else 
{
collection[id][prop] = value;
}
}
else
{
delete collection[id][prop];
}
Krishnakanth Reddy Kolan
@Krishnakanth-Kolan
Jan 10 2016 05:16
@tommygebru yeah but when I typed the same order, it says undefined
hemu1819
@hemu1819
Jan 10 2016 05:16

Vishwanath Kamble
@vishukamble
Jan 10 2016 05:17
@sudarshan395 basically
If
{
(if|else)
}
else
tommy
@tommygebru
Jan 10 2016 05:17
@Krishnakanth-Kolan also if you share your link or code i can debug faster :smile:
sudarshan gupta
@sudarshan395
Jan 10 2016 05:17
and why is that ?
judgekim
@judgekim
Jan 10 2016 05:17
hi my name is judgekim nice to meet you!!
tommy
@tommygebru
Jan 10 2016 05:18
@judgekim welcome to FCC !
hemu1819
@hemu1819
Jan 10 2016 05:18
@judgekim welcome
johnnyauto
@johnnyauto
Jan 10 2016 05:18
@judgekim welcome
Deepanshu Kaushik
@daksh844
Jan 10 2016 05:18
@hemu1819 in the Instruction checkProp is not defined that how can we use it and gaining such knowledge without understanding is really of no use to me
johnnyauto
@johnnyauto
Jan 10 2016 05:18
sorry
Krishnakanth Reddy Kolan
@Krishnakanth-Kolan
Jan 10 2016 05:19
@tommygebru var myStr = "\backslash \ttab \ttab \rcarriage-return \nnew-line";
johnnyauto
@johnnyauto
Jan 10 2016 05:19
i want to know 'what is waypoint' ?
tommy
@tommygebru
Jan 10 2016 05:19
@Krishnakanth-Kolan no no use the symbols aka \\ or \t or \r or \n, you have to read the instructions at least twice take your time :smile:
hemu1819
@hemu1819
Jan 10 2016 05:19
@daksh844 refer w3schools website , it can help you
read through topics and you will get it
tommy
@tommygebru
Jan 10 2016 05:21
@daksh844 checkProp is a space holder for our input... :smile:
hemu1819
@hemu1819
Jan 10 2016 05:21
@daksh844 or you can pm me i can explain it to you
Deepanshu Kaushik
@daksh844
Jan 10 2016 05:21
@hemu1819 sure will do that
tommy
@tommygebru
Jan 10 2016 05:21
@hemu1819 how do you private message on gitter?
hemu1819
@hemu1819
Jan 10 2016 05:22
there is option called chat privately
tommy
@tommygebru
Jan 10 2016 05:22
@hemu1819 thanks
hemu1819
@hemu1819
Jan 10 2016 05:25
@tommygebru :smile:
Krishnakanth Reddy Kolan
@Krishnakanth-Kolan
Jan 10 2016 05:25
@tommygebru still I couldn't get the answer
hemu1819
@hemu1819
Jan 10 2016 05:27
@Krishnakanth-Kolan paste your code
Krishnakanth Reddy Kolan
@Krishnakanth-Kolan
Jan 10 2016 05:28
@hemu1819 var myStr = "\ \b \t \b \t \b \r \b \n";
hemu1819
@hemu1819
Jan 10 2016 05:29
@Krishnakanth-Kolan which waypoint
Krishnakanth Reddy Kolan
@Krishnakanth-Kolan
Jan 10 2016 05:31
@hemu1819 Encode the following sequence, separated by spaces:
backslash tab tab carriage-return new-line and assign it to myStr
Rick Markins
@rkmarks
Jan 10 2016 05:33
Hello everyone I was wondering if you can see why my random number isn't generating a number at all?
// Example
function ourFunction(ourMin, ourMax) {

  return Math.floor(Math.random() * (ourMax - ourMin + 1)) + ourMin;
}

ourFunction(1, 9);

// Only change code below this line.

function randomRange(myMin, myMax) {

  return Math.floor(Math.random() >= myMin && myMin <= myMax);
}

// Change these values to test your function
var myRandom = randomRange(6, 15);
Jon Spencer
@batboy138
Jan 10 2016 05:36
I'm struggling with Checkpoint Stand in Line.
hemu1819
@hemu1819
Jan 10 2016 05:37
@batboy138 paste your code
Jon Spencer
@batboy138
Jan 10 2016 05:38
Do I have to use a loop?
hemu1819
@hemu1819
Jan 10 2016 05:38
do u know push and shift methods
Jon Spencer
@batboy138
Jan 10 2016 05:39
Not really.
Rick Markins
@rkmarks
Jan 10 2016 05:39
Should not have to do a loop. as @hemu1819 its all based on push and shift methods.
hemu1819
@hemu1819
Jan 10 2016 05:39
@batboy138 read about push and shift methods and you will get it
Ahmed Othman
@ahmedgothman
Jan 10 2016 05:39
Do you guys know how can i alter update a value in a property?
function update(id, prop, value) {
  if ( value !== "")
    {
    collection[id][prop]=value;
  if (prop === "tracks")
    {
    collection[id][prop].push(value);
    }
    }

  if (value ==="")
    {
      delete collection[id][prop];
    }
  return collection;
}
hemu1819
@hemu1819
Jan 10 2016 05:40
@rkmarks r u stuck at random no waypoint
Vishwanath Kamble
@vishukamble
Jan 10 2016 05:43
@ahmedgothman
if(value!=="") 
{
if(prop=="tracks")
{
collection[id][prop].push(value);
}
else 
{
collection[id][prop] = value;
}
}
else
{
delete collection[id][prop];
}
using three ifs will make the compiler go through each if even if it does not require to.
Using if, else if and else makes sure compiler only goes to 1 out of 3 instead of 3 our of 3 (like when you use 3 ifs)
Anton Bredl
@antonbr13
Jan 10 2016 05:47
Switch Statements are baffling me a bit!
Anyone care to help me - please?
Tim Myers
@denvercoder
Jan 10 2016 05:48
@antonbr13 Sure
@antonbr13 How can I help
Anton Bredl
@antonbr13
Jan 10 2016 05:48
function myTest(val) {
  var answer = "";
  // Only change code below this line
  switch (answer) {
    case "a": answer = "apple";
      break;
    case "b": answer = "bird";
      break;
    case "c": answer = "cat";
      break;

    default: answer = "stuff";


  }


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

// Change this value to test
myTest("b");
Instructions
Write a switch statement to set answer for the following conditions:
"a" - "apple"
"b" - "bird"
"c" - "cat"
default - "stuff"
Vishwanath Kamble
@vishukamble
Jan 10 2016 05:48
answer == "apple
Tim Myers
@denvercoder
Jan 10 2016 05:49
```switch (val)
switch (val) {

}

//not
switch(answer) {
Anton Bredl
@antonbr13
Jan 10 2016 05:50
@timmyers1978 solid catch - missed that! thanks
CamperBot
@camperbot
Jan 10 2016 05:50
antonbr13 sends brownie points to @timmyers1978 :sparkles: :thumbsup: :sparkles:
:star: 260 | @timmyers1978 | http://www.freecodecamp.com/timmyers1978
Tim Myers
@denvercoder
Jan 10 2016 05:50
when myTest("b"); is getting called it is passing the value "b" to the variable(argument) "val"
greg
@wearenotgroot
Jan 10 2016 05:51
This message was deleted
Tim Myers
@denvercoder
Jan 10 2016 05:51
the "answer" variable is the locally scoped variable that gets created in the switch.
Anton Bredl
@antonbr13
Jan 10 2016 05:52
@vishukamble from my understanding the case statements within the switch statements are already set and tested as strict equality so you don't have to have the actual statement part aka (answer === "apple") doesn't need strict equality operator
Ahmed Othman
@ahmedgothman
Jan 10 2016 05:52
thanks @vishukamble
CamperBot
@camperbot
Jan 10 2016 05:52
ahmedgothman sends brownie points to @vishukamble :sparkles: :thumbsup: :sparkles:
:star: 295 | @vishukamble | http://www.freecodecamp.com/vishukamble
Wendy Huang
@gutentag1026
Jan 10 2016 05:52

anyone entered the same problem? // Setup
var myStr = "Jello World";

// Only change code below this line
myStr = "Hello World";
myStr[0] = "H"; // Fix Me

// Setup
var myStr = "Jello World";

// Only change code below this line
myStr = "Hello World";
myStr[0] = "H"; // Fix Me

Boris Parov
@hackai
Jan 10 2016 05:53
can anyone help please: it says: Encode the following sequence, separated by spaces: backslash tab tab carriage-return new-line and assign it to myStr
Ahmed Othman
@ahmedgothman
Jan 10 2016 05:53
@gutentag1026 which waypoint is this?
Wendy Huang
@gutentag1026
Jan 10 2016 05:53
Understand String Immutability

In Javascript, String values are immutable, which means that they cannot be altered once created.
For example, the following code:

var myStr = "Bob";
myStr[0] = "J";
cannot change the value of myStr to "Job", because the contents of myStr cannot be altered. Note that this does not mean that myStr cannot be changed, just that the individual characters of a string literal cannot be changed. The only way to change myStr would be to assign it with a new string, like this:

var myStr = "Bob";
myStr = "Job";
Instructions
Correct the assignment to myStr to achieve the desired effect.

Vishwanath Kamble
@vishukamble
Jan 10 2016 05:54
@gutentag1026
@gutentag1026
anyone entered the same problem? // Setup
var myStr = "Jello World";

// Only change code below this line
myStr = "Hello World";
myStr[0] = "H"; // Fix Me

// Setup
var myStr = "Jello World";

// Only change code below this line
myStr = "Hello World";
myStr[0] = "H"; // Fix Me
Boris Parov
@hackai
Jan 10 2016 05:54
this's what i've thus far, but not working var myStr =\ \t \t \r \n;
Jon Spencer
@batboy138
Jan 10 2016 05:54
// Setup
var myArr = [1,2,3,4,5];

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

  var removedFromMyArr = myArr.push();
  return item;  // 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));
greg
@wearenotgroot
Jan 10 2016 05:54
@batboy138 you are returning the wrong thing! also using the given function parameter and do not access global variable. In this instace global variable is myArr
Vishwanath Kamble
@vishukamble
Jan 10 2016 05:56
@vishukamble
Ans is
// Setup
var myStr = "Jello World";

// Only change code below this line

myStr = "Hello World"; // Fix Me
TobyChow
@TobyChow
Jan 10 2016 05:57
@gutentag1026 just change myStr = 'Hello World';
Jon Spencer
@batboy138
Jan 10 2016 05:57
@wearenotgroot I'm not supposed to use the global variable?
Wendy Huang
@gutentag1026
Jan 10 2016 05:57
O yes thanks
greg
@wearenotgroot
Jan 10 2016 05:57
@hackai you have to make a string! and inside the string you need to escape those characte i.e tab spcae newline
@batboy138 you are suppose to use arr look at you function. function queue(arr, item). you already have a reference to myArr through arr.
Jon Spencer
@batboy138
Jan 10 2016 06:00
How do I use arr ?
Anthony
@Caligiuri
Jan 10 2016 06:01
@gutentag1026 you could split() the string into an array of characters, then change the letter you want to and then join() them back together again
greg
@wearenotgroot
Jan 10 2016 06:01
@batboy138 same way you use the myArr, and you have to put ìtem, on arr. so arr.push(item)
@batboy138 also read about push() and shift() method on the wiki
when in doubt consult the documents on the wiki
Jon Spencer
@batboy138
Jan 10 2016 06:05
@wearenotgroot I can't understand the documents.
greg
@wearenotgroot
Jan 10 2016 06:06
@batboy138 try this, list of method for arrays with examples. http://www.w3schools.com/js/js_array_methods.asp
Jon Spencer
@batboy138
Jan 10 2016 06:07
I figured it out!
// Setup
var myArr = [1,2,3,4,5];

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


  return arr.push(item), arr.shift(item);  // Change this line
}

// Display Code
console.log("Before: " + JSON.stringify(myArr));
console.log(queue(myArr, 10)); // Modify this line to test
console.log("After: " + JSON.stringify(myArr));
greg
@wearenotgroot
Jan 10 2016 06:07
@batboy138 there you go! :+1:
Jon Spencer
@batboy138
Jan 10 2016 06:07
Thanks @wearenotgroot !
CamperBot
@camperbot
Jan 10 2016 06:07
batboy138 sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 339 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
greg
@wearenotgroot
Jan 10 2016 06:08
@batboy138 btw you dont have to do arr.shift(item)->just to arr.shift()// Removes the first element
AliciadW
@AliciadW
Jan 10 2016 06:21
hi all
I am stuck at Checkpoint: Counting Cards. All of my checks except for the last one works perfectly. Could someone here please have a look and see if I am missing something?
Thomas Littlechild
@tommendable
Jan 10 2016 06:23
@AliciadW lets see what you have so far
tommy
@tommygebru
Jan 10 2016 06:23
@Krishnakanth-Kolan the backslash needs to be double! :smile: hope that helps
@hackai the backslash needs to be double! :smile: hope that helps
vikas kumar
@vikrw
Jan 10 2016 06:25
This message was deleted
AliciadW
@AliciadW
Jan 10 2016 06:27
var count = 0;

function cc(card) {

  switch (card) {
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      return "5 Bet";

    case 7:
    case 8:
    case 9:
      return "0 Hold";

    case 10:
    case "J":
    case "Q":
    case "K":
    case "A":
      return "-5 Hold";

    case 3:
    case 2:
    case "A":
    case 10:
    case "K":
      return "-1 Hold";
  }


}

cc(2); cc(3); cc(4); cc(5); cc(6);
cc(7); cc(8); cc(9); 
cc(10); cc("J"); cc("Q"); cc("K"); cc("A");
cc(3); cc(2); cc("A"); cc(10); cc("K");
TobyChow
@TobyChow
Jan 10 2016 06:28
@AliciadW whats the name of your waypoint
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 10 2016 06:29
@AliciadW where are you counting in that code?
AliciadW
@AliciadW
Jan 10 2016 06:29
@Toe125 Checkpoint: Counting Cards
Thomas Littlechild
@tommendable
Jan 10 2016 06:30
@AliciadW you dont just want to return "5 bet", "0 hold","-5 Hold" or "-1 Hold". You want to get your function to total your "count" value for you
@AliciadW so for each set of cases you either want to increase, decrease or no change to count (i.e. count++, count-- or count)
@AliciadW then after your switch statement you can return your current count value and if it is positive then Bet otherwise Hold
TobyChow
@TobyChow
Jan 10 2016 06:32
@AliciadW Yeah @tomlittlechild is correct. (Ex: 10, J, Q, K, A = (-1) + (-1) + (-1) + (-1) + (-1) = -5 total
leorczhu
@leorczhu
Jan 10 2016 06:33
hey..
AliciadW
@AliciadW
Jan 10 2016 06:33
@tomlittlechild, @ganeshkmurthy and @Toe125 Thanks. Let me get back to it and see if I can make it work. :-)
CamperBot
@camperbot
Jan 10 2016 06:33
aliciadw sends brownie points to @tomlittlechild and @ganeshkmurthy and @toe125 :sparkles: :thumbsup: :sparkles:
:star: 282 | @toe125 | http://www.freecodecamp.com/toe125
:star: 270 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
:star: 376 | @tomlittlechild | http://www.freecodecamp.com/tomlittlechild
leorczhu
@leorczhu
Jan 10 2016 06:33
anyone had problem with Checkpoint: Record Collection , After update(1245, "tracks", "Addicted to Love"), tracks should have a length of 1 . ?
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 10 2016 06:33
every time the function gets a card between 2-6, you need to increase the count, if the function gets cards 10 - A, decrease the count, do nothing for 7-9.
leorczhu
@leorczhu
Jan 10 2016 06:34
not sure why my collection[id][prop].push(value); make the array disappear in object
rks2828
@rks2828
Jan 10 2016 06:36
@leorczhu code please
leorczhu
@leorczhu
Jan 10 2016 06:37
    // 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