These are chat archives for FreeCodeCamp/Help

6th
Jan 2016
Alexis Reina
@alexisreina
Jan 06 2016 00:00
@ganeshkmurthy @itstrinbin you cad add js css or html...
cbot knows
CamperBot
@camperbot
Jan 06 2016 00:00
you called?
terrafirmatrekker
@terrafirmatrekker
Jan 06 2016 00:00
what the heck is going on with my css image atttributes
frisco miranda
@friscomm
Jan 06 2016 00:00
@Colortear don't know if anybody answered you yet, but here's the code I used for that waypoint:
In the nested loops waypoint, I am having issue figuring how to mulitply the arrays to the given variable, product.

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 = product * arr[i][j];
}
}

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

Alexis Reina
@alexisreina
Jan 06 2016 00:01
@friscomiranda format your code please.
explain format
CamperBot
@camperbot
Jan 06 2016 00:01

: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

Wiley Debs
@Colortear
Jan 06 2016 00:03
@friscomiranda Sorry that came back NaN
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 00:04
function x() {
}
Thanks @alexisreina
CamperBot
@camperbot
Jan 06 2016 00:04
ganeshkmurthy sends brownie points to @alexisreina :sparkles: :thumbsup: :sparkles:
:warning: ganeshkmurthy already gave alexisreina points
Trinity
@itstrinbin
Jan 06 2016 00:04

`
function myTest(val) {
var answer = "";
// Only change code below this line
switch(val) {
case 1:
case 2:
case 3:
answer = "Low";
break;
case 4:
case 5:
case 6:
answer = "Mid";
break;
case 7:
case 8:
case 9:
answer ="High";
break;
}
// Only change code above this line

return answer;
}
// Change this value to test
myTest(1);
`

Wiley Debs
@Colortear
Jan 06 2016 00:05
Does anyone have an explanation why multiplying product to the full length of the multi-array doesn't work?
Matt Fay
@username1001
Jan 06 2016 00:05
Can someone please tell me what I need for counting cards checkpoint?
Not the actual answer, but at least just a hint...
Alexis Reina
@alexisreina
Jan 06 2016 00:06
@Colortear what's the name of the waypoint?
Trinity
@itstrinbin
Jan 06 2016 00:06

```js
function myTest(val) {
var answer = "";
// Only change code below this line
switch(val) {
case 1:
case 2:
case 3:
answer = "Low";
break;
case 4:
case 5:
case 6:
answer = "Mid";
break;
case 7:
case 8:
case 9:
answer ="High";
break;
}
// Only change code above this line

return answer;
}
// Change this value to test
myTest(1);


function myTest(val) {
var answer = "";
// Only change code below this line
switch(val) {
case 1:
case 2:
case 3:
  answer = "Low";
  break;
case 4:
case 5:
case 6:
  answer = "Mid";
  break;
case 7:
case 8:
case 9:
  answer ="High";
  break;
}
// Only change code above this line

return answer;
}
// Change this value to test
myTest(1);
AHHHHH
Wiley Debs
@Colortear
Jan 06 2016 00:06
nesting for loops @alexisreina
Trinity
@itstrinbin
Jan 06 2016 00:07
@camperbot I love you<3
Amar Patel
@amaryana
Jan 06 2016 00:07

Hey, im struggling to understand how to solve this object-property problem. I've attached my code, not sure what the next step is.

"In the "topSecret" function “spy” will be a passed in as an object that represents a spy. Loop through all the properties on the spy object and change all values to the string “redacted”, then return the updated spy object." https://repl.it/BbfB/25

Matt Fay
@username1001
Jan 06 2016 00:07
/ switch (card) {
case 2:
case 3:
case 4:
case 5:
case 6:
return "5 Bet";
break;
case 7:
case 8:
case 9:
return "0 Hold";
break;
case 10:
case "J":
case "Q":
case "K":
case "A":
return "-5 Hold";
}
if (cc > 2 && cc <= 6) {
count++;
}
else if (cc > 7 && cc < 9) {
count++;
}
/
I know for sure the if/else is wrong, but am I heading in the correct direction?
Wiley Debs
@Colortear
Jan 06 2016 00:08
@username1001 Use card instead of cc. cc is the function.
Matt Fay
@username1001
Jan 06 2016 00:08
@Colortear For the if/else?
Alexis Reina
@alexisreina
Jan 06 2016 00:08
@username1001 nope. Yo have to add or subtract from count
@Colortear can you paste your answer again?
Matt Fay
@username1001
Jan 06 2016 00:09
@alexisreina what in the world am I adding/subtracting? lol
Wiley Debs
@Colortear
Jan 06 2016 00:09
@alexisreina
```
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 00:09
@username1001 you will need to increment and decrement the global value within the case statement.
Wiley Debs
@Colortear
Jan 06 2016 00:10

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

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
Alexis Reina
@alexisreina
Jan 06 2016 00:10
+1 or -1 form count @username1001 depending on the input
Herman Fassett
@HermanFassett
Jan 06 2016 00:10
@amaryana do you know how to loop through all the properties?
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 00:10
@username1001 and then check for the value outside the case.
Matt Fay
@username1001
Jan 06 2016 00:11
Should I remove the if/else?
Alexis Reina
@alexisreina
Jan 06 2016 00:11
@Colortear you're are missing the second arr arr[x][y]
Matt Fay
@username1001
Jan 06 2016 00:11
Ah, man... this is the most challenging on yet :worried:
Wiley Debs
@Colortear
Jan 06 2016 00:11
@alexisreina console.log then multiply?
Or is there any need to send it there
Alexis Reina
@alexisreina
Jan 06 2016 00:12
@Colortear Nope. Just product *= arr[x][y]
Wiley Debs
@Colortear
Jan 06 2016 00:12
@alexisreina ok lemme try it
@alexisreina Oh man... I could have sworn I tried that earlier.
Yosafat Ariel
@yoskakomba
Jan 06 2016 00:13
hello guys, I'm stuck with waypoint - return - early - pattern for - functions , need help with example
function abTest(a, b) {
  // Only change code below this line
  if (a < 0 || b < 0) {




  // Only change code above this line

  return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
  }
}

// Change values below to test your code
abTest(2,2);
Amar Patel
@amaryana
Jan 06 2016 00:13
@alexisreina I thought I did but I dont think I do now
Wiley Debs
@Colortear
Jan 06 2016 00:13
@alexisreina Thanks a lot!
CamperBot
@camperbot
Jan 06 2016 00:13
colortear sends brownie points to @alexisreina :sparkles: :thumbsup: :sparkles:
:star: 316 | @alexisreina | http://www.freecodecamp.com/alexisreina
Herman Fassett
@HermanFassett
Jan 06 2016 00:13
@amaryana you can loop through an objects properties like
for (var prop in obj) {}
Alexis Reina
@alexisreina
Jan 06 2016 00:14
@username1001 count is global variable. It keeps the count and depending on the input you need to increment or decrement it. The evaluate it and return the proper answer Bet or Hold plus the count value.
Andrew Bales
@agbales
Jan 06 2016 00:14
@peternguyen604 I'm working on the same problem. One thing I'm noticing is that we're both updating the collection with the values IN the collection. -- Should we be doing something like : update.value = value
Alexis Reina
@alexisreina
Jan 06 2016 00:14
@Colortear no problem
Carl Mungazi
@CarlMungazi
Jan 06 2016 00:15
Thank you @SaintPeter
CamperBot
@camperbot
Jan 06 2016 00:15
carlmungazi sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: carlmungazi already gave saintpeter points
Rex Schrader
@SaintPeter
Jan 06 2016 00:15
@CarlMungazi :D
Andrew Bales
@agbales
Jan 06 2016 00:15
or ```
Rex Schrader
@SaintPeter
Jan 06 2016 00:15
@tommygebru Your code?
Alexis Reina
@alexisreina
Jan 06 2016 00:15
@yoskakomba close your if stamentent and return;
Andrew Bales
@agbales
Jan 06 2016 00:16
```
update.value = collection.prop.id.value;
```
tommy
@tommygebru
Jan 06 2016 00:16
@SaintPeter myVar=myVar ++1;
Manish Giri
@Manish-Giri
Jan 06 2016 00:16
@tommygebru you just need myVar++;
Yosafat Ariel
@yoskakomba
Jan 06 2016 00:16
@alexisreina - this is the update of my code;
// Setup
function abTest(a, b) {
  // Only change code below this line
  if (a < 0 || b < 0) {

  return "undefined";
  }

  // Only change code above this line

  return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));

}

// Change values below to test your code
abTest(2,3);
Amar Patel
@amaryana
Jan 06 2016 00:17
i think this is closer
Rex Schrader
@SaintPeter
Jan 06 2016 00:17
@yoskakomba return undefined, not return "undefined"
901218
@901218
Jan 06 2016 00:17

'''function convert(celsius) {
// Only change code below this line
var fahrenheit = 0;

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

// Change the inputs below to test your code
convert (9 / 5 + 32);

CamperBot
@camperbot
Jan 06 2016 00:17
:bulb: to format code use backticks! ``` more info
tommy
@tommygebru
Jan 06 2016 00:17
@Manish-Giri I am going to try again close browser and open because it didnt work
Andrew Bales
@agbales
Jan 06 2016 00:17
collection.id.prop = update.value;
Perhaps this makes more sense.
Alexis Reina
@alexisreina
Jan 06 2016 00:18
@yoskakomba it's almost there. undefined IT'S NOT a string... you know what I mean?
Rex Schrader
@SaintPeter
Jan 06 2016 00:18
@901218 You need to put your math inside the function - where you are currently putting = 0. You need it to be relative to celsius
Yosafat Ariel
@yoskakomba
Jan 06 2016 00:18
@alexisreina - thank you so much, I thought it's a string so I have to put double quote
CamperBot
@camperbot
Jan 06 2016 00:18
yoskakomba sends brownie points to @alexisreina :sparkles: :thumbsup: :sparkles:
Alexis Reina
@alexisreina
Jan 06 2016 00:18
@amaryana what's this?
CamperBot
@camperbot
Jan 06 2016 00:18
:star: 317 | @alexisreina | http://www.freecodecamp.com/alexisreina
Carl Mungazi
@CarlMungazi
Jan 06 2016 00:19
@SaintPeter seeing @ganeshkmurthy's solution made it more concrete for me. This one has been my toughest one yet! Definitely need to revise a few things.
Rex Schrader
@SaintPeter
Jan 06 2016 00:19
@agbales You cannot use dot notation when you are using variables to access properties. There is no property of collection called id
Herman Fassett
@HermanFassett
Jan 06 2016 00:19
@amaryana yes closer :P
Amar Patel
@amaryana
Jan 06 2016 00:19
I'm working on challenges while doing FCC to understand the concepts deeper. "In the "topSecret" function “spy” will be a passed in as an object that represents a spy. Loop through all the properties on the spy object and change all values to the string “redacted”, then return the updated spy object."
Rex Schrader
@SaintPeter
Jan 06 2016 00:19
@CarlMungazi It's deceptively challenging, hopfully in a good way :D
901218
@901218
Jan 06 2016 00:19
@SaintPeter Thank you, that will give me a start. I will probably be back
Andrew Bales
@agbales
Jan 06 2016 00:19
@SaintPeter Ah! Same error as a while back. Thank you (again)!
CamperBot
@camperbot
Jan 06 2016 00:19
agbales sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 2178 | @saintpeter | http://www.freecodecamp.com/saintpeter
SaintPeter @SaintPeter bows
Herman Fassett
@HermanFassett
Jan 06 2016 00:20
@amaryana you shouldn't need an if statement if it's all properties then, simply change spy[topSecret] to "redacted"
Alexis Reina
@alexisreina
Jan 06 2016 00:20
@amaryana right, didn't see that yet. :shipit:
Gabriel Tholander
@BombaShack
Jan 06 2016 00:21
Can someone just give me a quick word what CSS was again? Was it like "classes"?
Amar Patel
@amaryana
Jan 06 2016 00:21
what about the for-in loop?
Benjamin W Wulf
@benjaminwulf
Jan 06 2016 00:21
@agbales are you working on the Record Collection Waypoint. I'm stuck and working through it now.
Alexis Reina
@alexisreina
Jan 06 2016 00:21
@amaryana I guess you could use a for..in loop
Andrew Bales
@agbales
Jan 06 2016 00:22
@benjaminwulf Yes, I am. Here's where I'm at ...
// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

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

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

  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");
Alexis Reina
@alexisreina
Jan 06 2016 00:22
@amaryana Object.keyswill work too
Carl Mungazi
@CarlMungazi
Jan 06 2016 00:22
@SaintPeter Definitely. FCC is the only resource I have come across so far which has challenged me to solve problems in this manner. I am spending more time thinking about code than writing it.
901218
@901218
Jan 06 2016 00:23

It seems there is quite a jump on this checkpoint… Need another hint or more instruction… Thanks in advance.
'''function convert(celsius) {
// Only change code below this line
var fahrenheit = 9 / 5 + 32;

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

// Change the inputs below to test your code
convert(30);'''

CamperBot
@camperbot
Jan 06 2016 00:23
:bulb: to format code use backticks! ``` more info
Rex Schrader
@SaintPeter
Jan 06 2016 00:23
@CarlMungazi I can't even tell you how happy that makes me! :heart: Thanks!
Kyle
@zykyzio
Jan 06 2016 00:23
@BombaShack CSS stands for cascading style sheet. It's about applying formatting to html, a part of which is based on classes, yes.
Gabriel Tholander
@BombaShack
Jan 06 2016 00:24
@blimblammin Do apreciate the answer! :D
Rex Schrader
@SaintPeter
Jan 06 2016 00:24
@901218 you are converting FROM celsius, but you are not referencing it at all. Where should it appear in the formula?
Alexis Reina
@alexisreina
Jan 06 2016 00:24
@amaryana topSecret.name(spy) what for?
Amar Patel
@amaryana
Jan 06 2016 00:24
@alexisreina yeah, i removed that. revising the code. its making more sense as i discuss it here. im just a little intimidated by it i guess
Hancheng Wu
@spockmaster
Jan 06 2016 00:25
For the quote machine zipline, I can't seem to get the tweet with the quote to work. I tried to use .attr() jQuery method but it doesn't work inside a button event. Can anyone point me in the right direction?
Rex Schrader
@SaintPeter
Jan 06 2016 00:25
@agbales What is the thing that you need to test to see if it is blank or not? Is it the contents of a property in collections, or something else?
@CarlMungazi Thanks (because it didn't register the first time)
CamperBot
@camperbot
Jan 06 2016 00:25
saintpeter sends brownie points to @carlmungazi :sparkles: :thumbsup: :sparkles:
:star: 247 | @carlmungazi | http://www.freecodecamp.com/carlmungazi
tommy
@tommygebru
Jan 06 2016 00:26
@SaintPeter thanks
CamperBot
@camperbot
Jan 06 2016 00:26
tommygebru sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 2179 | @saintpeter | http://www.freecodecamp.com/saintpeter
tommy
@tommygebru
Jan 06 2016 00:26
@Manish-Giri I have seen the error in my ways! thanks
CamperBot
@camperbot
Jan 06 2016 00:26
tommygebru sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star: 570 | @manish-giri | http://www.freecodecamp.com/manish-giri
Alexis Reina
@alexisreina
Jan 06 2016 00:26
var topSecret = function(spy) {
  for (var prop in spy) {
    if (spy.hasOwnProperty(prop)) {
      spy[prop] = "redacted";
    }
  }
}
@amaryana
Andrew Bales
@agbales
Jan 06 2016 00:26

@SaintPeter I think it would be the prop's value.. so:

else if (collection[id][prop] === ""

perhaps?

Amar Patel
@amaryana
Jan 06 2016 00:26

https://repl.it/BbfB/28

"Oops! Errors. Try again.
Function returned
undefined
instead of
{"age":"redacted","name":"redacted","id":"redacted"}
when passed
{"age":50,"name":"James Bond","id":"007"}"

Andrew Bales
@agbales
Jan 06 2016 00:27
with the closing )
Rex Schrader
@SaintPeter
Jan 06 2016 00:27
@agbales Nope. Re-read the instructions carefully. ;)
Herman Fassett
@HermanFassett
Jan 06 2016 00:27
@amaryana spy[topSecret] = ...
901218
@901218
Jan 06 2016 00:27
@SaintPeter is there another assignment that I should reference to better understand what I do for the Celsius conversion
Carl Mungazi
@CarlMungazi
Jan 06 2016 00:27
@SaintPeter Great work!
Alexis Reina
@alexisreina
Jan 06 2016 00:28
var topSecret = function(spy) {
  for (var prop in spy) {
    if (spy.hasOwnProperty(prop)) {
      spy[prop] = "redacted";
    }
  }
}
@amaryana what about this?
Andrew Bales
@agbales
Jan 06 2016 00:29
@SaintPeter So, it says "If value is blank, delete that prop." // does this refer to the update value? If so,
if (update[value] === "")
Yosafat Ariel
@yoskakomba
Jan 06 2016 00:30
Hi all, I am stucked at: http://www.freecodecamp.com/challenges/checkpoint-counting-cards
I guess it's using if/else if/else, correct me if I am wrong;
var count = 0;

function cc(card) {
  // Only change code below this line
  if(count === 1) {
    return "Bet";
  } else if(count === 0 || count === -1) {
    return "Hold";
  } else {

   return "Change Me";

  }
  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
Nur Azhar
@nurazhar
Jan 06 2016 00:30
anyone done with Checkpoint: Convert Celsius to Fahrenheit?
Yosafat Ariel
@yoskakomba
Jan 06 2016 00:30
@nurazhar I think I did
901218
@901218
Jan 06 2016 00:30
@nurazhar that's the one I'm on
Alexis Reina
@alexisreina
Jan 06 2016 00:31
@yoskakomba you need to increment or decrement the count depending on each card
Kyle
@zykyzio
Jan 06 2016 00:31
@901218 Your issue is that your function is not returning a value, and that you are not starting with the celsius variable passed in to the function.
Nur Azhar
@nurazhar
Jan 06 2016 00:31
@901218 i think the instruction is inadequate @yoskakomba - Lost and we haven't learn if-else yet
Amar Patel
@amaryana
Jan 06 2016 00:31
@alexisreina Oops! Errors. Try again.
Function returned
undefined
instead of
{"age":"redacted","name":"redacted","id":"redacted"}
when passed
{"age":"redacted","name":"redacted","id":"redacted"}
this feels very close
Yosafat Ariel
@yoskakomba
Jan 06 2016 00:32
@alexisreina how to do that, please give me an example. thank you
CamperBot
@camperbot
Jan 06 2016 00:32
yoskakomba sends brownie points to @alexisreina :sparkles: :thumbsup: :sparkles:
:warning: yoskakomba already gave alexisreina points
Nur Azhar
@nurazhar
Jan 06 2016 00:33

blockquote The algorithm to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32.

You are given a variable celsius representing a temperature in Celsius. Create a variable fahrenheit and apply the algorithm to assign it the corresponding temperature in Fahrenheit.

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

i see
Sean McGuinness
@smmcguinness
Jan 06 2016 00:34
anyone want to look at my switch statement code?
Alexis Reina
@alexisreina
Jan 06 2016 00:35
@amaryana return spy at the end
Nikolajs Korolkovs
@NickEU
Jan 06 2016 00:35
@smmcguinness nothing would make us happier ;P
help formatting
CamperBot
@camperbot
Jan 06 2016 00:36

: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

Alexis Reina
@alexisreina
Jan 06 2016 00:36
@amaryana
var topSecret = function(spy) {
  for (var prop in spy) {
    if (spy.hasOwnProperty(prop)) {
      spy[prop] = "redacted";
    }
  }
  return spy;
}
Sean McGuinness
@smmcguinness
Jan 06 2016 00:36

function myTest(val) {
// Only change code below this line
case answer===1:;
console.log("Alpha");
break;
case answer===2:;
console.log("Beta");
break;
case answer===3:;
console.log("Alpha");
break;
case val===4:;
console.log("Alpha");
break;

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

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

Nikolajs Korolkovs
@NickEU
Jan 06 2016 00:37
well there are a few problems here, have you tried googling the examples of the use of switch statements? ;)
Josh
@jarshvader
Jan 06 2016 00:37

'''
// Setup
var testObj = {
12: "Namath",
16: "Montana",
19: "Unitas"
};

// Only change code below this line;

var playerNumber = 16; // Change this Line
var player = testObj[16]; // Change this Line

CamperBot
@camperbot
Jan 06 2016 00:37
:bulb: to format code use backticks! ``` more info
Emile Choghi
@echoghi
Jan 06 2016 00:37

Can someone help me change this function to return the correct result? // 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",
"": undefined
} ;

}

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

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

Amar Patel
@amaryana
Jan 06 2016 00:37
it worked!! @alexisreina @HermanFassett thanks thanks
CamperBot
@camperbot
Jan 06 2016 00:37
amaryana sends brownie points to @alexisreina and @hermanfassett :sparkles: :thumbsup: :sparkles:
Alexis Reina
@alexisreina
Jan 06 2016 00:37
@yoskakomba sorry man, need to leave now I'm sure someone will help you :worried:
CamperBot
@camperbot
Jan 06 2016 00:38
:star: 1304 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
:star: 318 | @alexisreina | http://www.freecodecamp.com/alexisreina
Alexis Reina
@alexisreina
Jan 06 2016 00:38
@amaryana congrats :+1:
Amar Patel
@amaryana
Jan 06 2016 00:38
its starting to click. im just intimidated by the wording of some of these challenges
Sarah Schlueter
@SarahMarie73
Jan 06 2016 00:38
@amaryana I feel exactly the same way
lol
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 00:39
@smmcguinness check the example on the left and write the code. Your code is missing the switch statement.
Kyle
@zykyzio
Jan 06 2016 00:39
@smmcguinness also consider less semi-colons...
Alexis Reina
@alexisreina
Jan 06 2016 00:40
Evening pals :sleeping:
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 00:40
@echoghi use the variable, lookup to return the result of the function.
Josh
@jarshvader
Jan 06 2016 00:40

'''
// Setup
var testObj = {
12: "Namath",
16: "Montana",
19: "Unitas"
};

// Only change code below this line;

var playerNumber = 16; // Change this Line
var player = testObj[16]; // Change this Line
'''
does anyone know off hand what I am doing wrong here? It seems to pass the first requirements. It fails the last one. You should use bracket notation to access testObj

CamperBot
@camperbot
Jan 06 2016 00:40
:bulb: to format code use backticks! ``` more info
Nikolajs Korolkovs
@NickEU
Jan 06 2016 00:40
@ganeshkmurthy the example sucks
@smmcguinness http://www.javatpoint.com/javascript-switch try looking at this
folkan
@folkan
Jan 06 2016 00:41
function update(id, prop, value) {
  if(value !== ""){
    if (prop == "tracks"){
      collection.id.prop.push(value); 
    }
    else{
      collection.id.prop = value; 
    }
  }
  else {
    delete collection.id.prop; 
  }
 return collecion; 
}

// Alter values below to test your code
update(5439, "artist", "ABBA");
Anyone know why I am getting a TypeError for my function?
Josh
@jarshvader
Jan 06 2016 00:42

'''js
// Setup
var testObj = {
12: "Namath",
16: "Montana",
19: "Unitas"
};

// Only change code below this line;

var playerNumber = 16; // Change this Line
var player = testObj[16]; // Change this Line
'''
does anyone know off hand what I am doing wrong here? It seems to pass the first requirements. It fails the last one. You should use bracket notation to access testObj
sorry first time here. Im Jarsh Vader!

CamperBot
@camperbot
Jan 06 2016 00:42
:bulb: to format code use backticks! ``` more info
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 00:42
@folkan you will need to use bracket notation to access the id within the collection.
@folkan id is not a property...it is a variable.
folkan
@folkan
Jan 06 2016 00:42
oooh, sweet! Thanks @ganeshkmurthy
CamperBot
@camperbot
Jan 06 2016 00:42
folkan sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:star: 220 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 00:43
@folkan same goes with prop...it is a variable too.
Josh
@jarshvader
Jan 06 2016 00:44
// Setup
var testObj = {
12: "Namath",
16: "Montana",
19: "Unitas"
};
// Only change code below this line;
var playerNumber = 16; // Change this Line
var player = testObj[16]; // Change this Line
does anyone know off hand what I am doing wrong here? It seems to pass the first requirements. It fails the last one. You should use bracket notation to access testObj
sorry first time here. Im Jarsh Vader!
folkan
@folkan
Jan 06 2016 00:44
great! thanks again ! @ganeshkmurthy
CamperBot
@camperbot
Jan 06 2016 00:44
folkan sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:warning: folkan already gave ganeshkmurthy points
Amar Patel
@amaryana
Jan 06 2016 00:45
@SarahMarie73 it'll be okay, this is part of the learning curve. we'll be helping others soon. everyone starts where we are
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 00:45
@folkan welcome!
Jack Lyons
@JackEdwardLyons
Jan 06 2016 00:45
hi guys, can someone please help me with my code here on the waypoint: testing objects for properties
var myObj = {
  gift: "pony",
  pet : "kitten",
  bed : "sleigh"
};

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

// Test your code by modifying these values
checkObj("kitten");
Kyle
@zykyzio
Jan 06 2016 00:45
@SarahMarie73 @amaryana The feeling never goes away, but then you come in here and see a question and go "I know the answer!" and realize how far you've come.
@jarshvader What is the name of the exercise for your question?
Josh
@jarshvader
Jan 06 2016 00:46
@blimblammin sorry Waypoint: Accessing Objects Properties with Variables
Amar Patel
@amaryana
Jan 06 2016 00:47
@blimblammin you're right. i can help people with html/css stuff. declaring variables.
Jibin M
@jmathew1991
Jan 06 2016 00:49
@JackEdwardLyons I think you have to use brackets instead of dot notation where you have "myObj.checkProp"
Kyle
@zykyzio
Jan 06 2016 00:49
@jarshvader Ok, so you have the right idea. Try using another variable in your last line...
@jarshvader so instead of 16, you could have...?
Jack Lyons
@JackEdwardLyons
Jan 06 2016 00:50
var myObj = {
  gift: "pony",
  pet : "kitten",
  bed : "sleigh"
};

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

// Test your code by modifying these values
checkObj("kitten");
still not correct
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 00:51
@JackEdwardLyons you will need to use checkProp somehow in the function.
Bon
@OriBon
Jan 06 2016 00:51
@JackEdwardLyons Because youre not testing checkProp
Abdul Awali
@awalthefirst
Jan 06 2016 00:51
@JackEdwardLyons if (myObj.hasOwnProperty(checkProp) === true)
@JackEdwardLyons then return return myObj[checkProp]
Bon
@OriBon
Jan 06 2016 00:52
You can also remove the === true part so that it's just if (myObj.hasOwnProperty(checkProp))
Jibin M
@jmathew1991
Jan 06 2016 00:53
@JackEdwardLyons ur also supposed to call the function with property not the value Ex. checkObj(pet)
Jack Lyons
@JackEdwardLyons
Jan 06 2016 00:53
ahh yes thank you @OriBon @awalthefirst @jmathew1991
CamperBot
@camperbot
Jan 06 2016 00:53
jackedwardlyons sends brownie points to @oribon and @awalthefirst and @jmathew1991 :sparkles: :thumbsup: :sparkles:
:star: 498 | @awalthefirst | http://www.freecodecamp.com/awalthefirst
:star: 428 | @oribon | http://www.freecodecamp.com/oribon
:star: 273 | @jmathew1991 | http://www.freecodecamp.com/jmathew1991
Emile Choghi
@echoghi
Jan 06 2016 00:53
@ganeshkmurthy I'm unsure what you mean, I think i've been staring at this code for a little too long... I have the variable lookup defined as a table. How do I utilize the result variable to access it?
Jack Lyons
@JackEdwardLyons
Jan 06 2016 00:53
var myObj = {
  gift: "pony",
  pet : "kitten",
  bed : "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here

  if (myObj.hasOwnProperty(checkProp)) {
    return myObj[checkProp];
  } else {
    return "Not Found";
  }
}

// Test your code by modifying these values
checkObj("kitten");
thats the final answer
Josh
@jarshvader
Jan 06 2016 00:54
@blimblammin ok. i appreciate your response! I am having trouble seeing which variable to use. I feel like it is super simple and I have way over complicated the issue. Seems typical. The variable you are refering to is 16 inside the bracket notation? or the 16 i have declared for playerNumber?
Kyle
@zykyzio
Jan 06 2016 00:55
@jarshvader The second "16". So if you just hard code the player number in the second line, you would have to change it in two places to check a different player. However, if you changed your second line so that the player number was a variable, then you would only have to change it in once place to check a different player.
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 00:56
@echoghi something in the lines of, return lookup[val];
angelbenoit
@angelbenoit
Jan 06 2016 00:57
has anyone done Checkpoint: Golf Code?
I'm a bit confused on how to start it
Sean McGuinness
@smmcguinness
Jan 06 2016 00:57
i used page as reference,
im still missing a detail

unction myTest(val) {
var answer = "";
// Only change code below this line
switch(answer) {
case 1:
answer="Alpha";
break;
case 2:
answer="Beta";
break;
case 3:
answer="Gamma";
break;
case 4:
answer="Delta";
break;}
// Only change code above this line
return answer;
}

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

Rex Schrader
@SaintPeter
Jan 06 2016 00:58
@angelbenoit I suggest an if/else chain
Josh
@jarshvader
Jan 06 2016 00:59
@blimblammin haha well done sir. I understand 100%. I really appreciate your time!
Rex Schrader
@SaintPeter
Jan 06 2016 00:59
@angelbenoit You have all the conditions .. . just have to describe them in code.
Kyle
@zykyzio
Jan 06 2016 00:59
@jarshvader No problem. Keep at it!
Abdul Awali
@awalthefirst
Jan 06 2016 00:59
@smmcguinness switch(val)
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 01:00
@echoghi it should be, result=lookup[val];
angelbenoit
@angelbenoit
Jan 06 2016 01:00
thanks @SaintPeter
CamperBot
@camperbot
Jan 06 2016 01:00
angelbenoit sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 2180 | @saintpeter | http://www.freecodecamp.com/saintpeter
Sean McGuinness
@smmcguinness
Jan 06 2016 01:01
i attempted that with no success@a
@awalthefirst i attempted that with no success
Abdul Awali
@awalthefirst
Jan 06 2016 01:02
@smmcguinness whichway point
Amar Patel
@amaryana
Jan 06 2016 01:02

anyone know how to "Make a function called onlyTheTruthy that takes in an object, loops through all its properties, and removes any that are falsy. Then return the object that was passed in. (hint: delete)"?

here is what I have so far: https://repl.it/BbfB/29

Sean McGuinness
@smmcguinness
Jan 06 2016 01:03
js71
Emile Choghi
@echoghi
Jan 06 2016 01:03
thanks @ganeshkmurthy it worked!
CamperBot
@camperbot
Jan 06 2016 01:03
echoghi sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:star: 221 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
Heather Akers-Healy
@abbynormative
Jan 06 2016 01:04
hey there, I'm having trouble with Waypoint: Introducing JavaScript Object Notation JSON. the run tests button is not working for me. can someone else confirm this and I'll open a new issue in github? Thanks.
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 01:04
@echoghi you are welcome!
Abdul Awali
@awalthefirst
Jan 06 2016 01:04
@smmcguinness use case 'a' case 'b' ....
@awalthefirst not numbers
@smmcguinness
case 'a': 
    answer = "apple";
    break;
  case 'b':
    answer = "bird";
    break;

  case 'c':
    answer = "cat";
    break;

   default:
    answer = "stuff";
    break;
Sarah Schlueter
@SarahMarie73
Jan 06 2016 01:06
@amaryana What is that website repl.it for?
is it similar to codeshare?
Amar Patel
@amaryana
Jan 06 2016 01:06
yeah. i just like using it because i can edit it and so can the person helping me. it also runs the code to see if it works.
someone here introduced me to it
Sean McGuinness
@smmcguinness
Jan 06 2016 01:07
error its not defined
Abdul Awali
@awalthefirst
Jan 06 2016 01:09
@smmcguinness can you paste your code
Sean McGuinness
@smmcguinness
Jan 06 2016 01:10

function myTest(val) {
var answer = "";
// Only change code below this line
switch(val) {
case 'a':
val="Alpha";
break;
case 'b':
val="Beta";
break;
case 'c':
val="Gamma";
break;
case 'd':
val="Delta";
break;}
// Only change code above this line
return answer;
}

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

Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 01:11
@amaryana Plunkr is similar. http://plnkr.co
Sarah Schlueter
@SarahMarie73
Jan 06 2016 01:11
@amaryana that's cool...not sure if codeshare runs it or not...
Abdul Awali
@awalthefirst
Jan 06 2016 01:11
@smmcguinness you have to do answer = '..' not val =
Amar Patel
@amaryana
Jan 06 2016 01:13
@ganeshkmurthy pretty cool. bookmarked it for later.
Sean McGuinness
@smmcguinness
Jan 06 2016 01:13
already tried. does nothing
Zeljko Sevic
@schewmeister
Jan 06 2016 01:14
hello everyone
Amar Patel
@amaryana
Jan 06 2016 01:14

anyone want to help me? I've updated the code a lot https://repl.it/BbfB/30

the challenge: "Make a function called onlyTheTruthy that takes in an object, loops through all its properties, and removes any that are falsy. Then return the object that was passed in. (hint: delete)"

Zeljko Sevic
@schewmeister
Jan 06 2016 01:14
i have a problem with checkpoint: record collection
it doesn't pass third test
but it works well in console
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 01:14
@schewmeister post your code
Sean McGuinness
@smmcguinness
Jan 06 2016 01:15
@awalthefirst already tried does nothing
Abdul Awali
@awalthefirst
Jan 06 2016 01:15
@smmcguinness
 switch (val) {
  case 1: 
    answer = "alpha";  // not Alpha
    break;
  case 2:
    answer = "beta";  // not Beta
    break;

  case 3:
    answer = "gamma"; // not Gamma
    break;

   case 4:
    answer = "delta";
    break;
}
Shahid Foy
@shahidfoy
Jan 06 2016 01:15
@smmcguinness hes right though, think about what you want to return when the user selects a case. replace ur vals with answer
Abdul Awali
@awalthefirst
Jan 06 2016 01:16
@smmcguinness it should be lowercase
Zeljko Sevic
@schewmeister
Jan 06 2016 01:17
@ganeshkmurthy
function update(id, prop, value) {
  if(value!==''){
    collection[id][prop]=value;
    if(prop==='tracks'){
     collection[id][prop].push(value); 
  }
 }else{
   delete collection[id][prop];
 }
  return collection;
}
Sean McGuinness
@smmcguinness
Jan 06 2016 01:18
@awalthefirst @schewmeister already tried both does nothing.
Abdul Awali
@awalthefirst
Jan 06 2016 01:18
This message was deleted
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 01:18
@schewmeister you cannot assign a value to an array property. you should check if property is tracks, then push, else set the value.
Shahid Foy
@shahidfoy
Jan 06 2016 01:18
@smmcguinness replace val="Alpha"; with answer = "Alpha";
Abdul Awali
@awalthefirst
Jan 06 2016 01:19
@smmcguinness
function myTest(val) {
  var answer = "";
  // Only change code below this line
  switch (val) {
  case 1: 
    answer = "alpha";
    break;
  case 2:
    answer = "beta";
    break;

  case 3:
    answer = "gamma";
    break;

   case 4:
    answer = "delta";
    break;
}


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

// Change this value to test
myTest(1);
Yosafat Ariel
@yoskakomba
Jan 06 2016 01:23
Hi guys, need help with http://www.freecodecamp.com/challenges/waypoint-using-objects-for-lookups
here is my code, I don't know what's wrong
function phoneticLookup(val) {
  var result = "";
val = {
      "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("Adams");
David Rivera
@dvriv
Jan 06 2016 01:23
@wordyallen check the wiki
Seryaph
@Seryaph
Jan 06 2016 01:24
@yoskakomba you have to update the result variable before you return it
David Rivera
@dvriv
Jan 06 2016 01:24
@wordyallen in the wiki are the solutions for most of the bonfires
Seryaph
@Seryaph
Jan 06 2016 01:24
something along the lines of result = lookup[val] ought to do it
Jay
@Jitsu24
Jan 06 2016 01:24
@yoskakomba and also check your indentation
Zeljko Sevic
@schewmeister
Jan 06 2016 01:24
@ganeshkmurthy thanks for help :smile:
CamperBot
@camperbot
Jan 06 2016 01:24
schewmeister sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:star: 222 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 01:25
@yoskakomba you will need a declare a new variable for the array.
David Rivera
@dvriv
Jan 06 2016 01:25
@yoskakomba you need to assign what you try to lookup to the variable result, before returning it
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 01:25
@schewmeister welcome!
Sean McGuinness
@smmcguinness
Jan 06 2016 01:26
@awalthefirst thanks.. i used that format before, but used capital letters for the statements.. thanks.
CamperBot
@camperbot
Jan 06 2016 01:26
smmcguinness sends brownie points to @awalthefirst :sparkles: :thumbsup: :sparkles:
:star: 500 | @awalthefirst | http://www.freecodecamp.com/awalthefirst
Seryaph
@Seryaph
Jan 06 2016 01:26
I'm having an issue with the Checkpoint: Record Collection, I think it may be a bug. My code seems to be functioning fine, but one of the tests says that "After update(1245, "tracks", "Addicted to Love"), tracks should have a length of 1
Yosafat Ariel
@yoskakomba
Jan 06 2016 01:26
@Seryaph @ganeshkmurthy @Jitsu24
If you don't mind give me example with other words, but not the answer
Abdul Awali
@awalthefirst
Jan 06 2016 01:27
@smmcguinness any time
Seryaph
@Seryaph
Jan 06 2016 01:27
after running the code, the length of tracks under ID 1245 is indeed 1, however the test is not coming across as having passed
is it a bug?
David Rivera
@dvriv
Jan 06 2016 01:27
@Seryaph i'm pretty sure you first if is not letting the second activate when they give "tracks"
@Seryaph but without the code is hard to tell
angelbenoit
@angelbenoit
Jan 06 2016 01:27
function myTest(val) {
  var answer = "";
  // Only change code below this line
  var value1, value2, value3, value4;
  switch(val){
    case value1:
      answer = "alpha";
      break;
    case value2:
      answer = "beta";
      break;
    case value3:
      answer = "gamma";
      break;
    case value4:
      answer = "delta";

  }
for Waypoint: Selecting from many options with Switch Statements what do i need to do
i need to set answers to those conditions
Seryaph
@Seryaph
Jan 06 2016 01:28
function update(id, prop, value) {
  if (value !== ""){
    collection[id][prop] = value;
  } else {
    delete collection[id][prop];
  }

  return collection;
}
that's my code
David Rivera
@dvriv
Jan 06 2016 01:29
@Seryaph well they ask 3 things that you code need to do and you just did two.
@Seryaph read the instructions again
Seryaph
@Seryaph
Jan 06 2016 01:29
ooooooh snap
you're totally right
thanks @Dav1605
CamperBot
@camperbot
Jan 06 2016 01:29
seryaph sends brownie points to @dav1605 :sparkles: :thumbsup: :sparkles:
:star: 236 | @dav1605 | http://www.freecodecamp.com/dav1605
Gabriel Dennis Parangan
@gparangan
Jan 06 2016 01:31
Good Day, I need help in Waypoint: Assignment with a returned Value. I don't get it. Can someone explain it to me? Thanks
Juanse Caro
@juansecaro
Jan 06 2016 01:33
Hi, could anyone help with the regular expression of palindrome bonfire? I cannot remove punctuation, case, and spacing
Briana Swift
@brianamarie
Jan 06 2016 01:34
@gparangan Could you be more specific about the questions you have? I could try to help but it'll be more useful for both of us if I know what parts you at least DO understand :)
Briana Swift
@brianamarie
Jan 06 2016 01:34
@juansecaro what regexp resources have you already looked at?
Seryaph
@Seryaph
Jan 06 2016 01:35
Ok, I updated the code to reflect the 3 conditions of the instructions, but I'm still running into the same problem. Even though there is only one element in the "tracks" array, the code is still failing that test
Yosafat Ariel
@yoskakomba
Jan 06 2016 01:35
@Seryaph
if you don't mind give me an example with other word please
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 01:35
@gparangan call the function process(<value>) and assigned it to the processed variable similar to the example, ourSum=sum(5,12);
Juanse Caro
@juansecaro
Jan 06 2016 01:35
@brianamarie @Dav1605 This two: tr.replace(/[^A-Za-z0-9]/g, ''); str2 = str2.replace(
Abdul Awali
@awalthefirst
Jan 06 2016 01:36
@gparangan create a variable called processed and set it equal process(7)
David Rivera
@dvriv
Jan 06 2016 01:36
@Seryaph paste the code again...i can se what is you problem but i dont know what you did wrong without seeing you code
Seryaph
@Seryaph
Jan 06 2016 01:36
@yoskakomba if you look at the instructions, it says that you have use your table to lookup val and then return the associated string from within the object
```
whoops
Juanse Caro
@juansecaro
Jan 06 2016 01:36
replace(/\s+/g, ''); @brianamarie @Dav1605
Seryaph
@Seryaph
Jan 06 2016 01:36
function update(id, prop, value) {
  if (value !== ""){
    collection[id][prop] = value;
  } else if (prop === "tracks"){
    collection[id][prop].push(value);
  } 
  if (value === ""){
    delete collection[id][prop];
  }

  return collection;
}
Gabriel Dennis Parangan
@gparangan
Jan 06 2016 01:37
@brianamarie @ganeshkmurthy @awalthefirst Ok. Now I understand what it means. Thank you
CamperBot
@camperbot
Jan 06 2016 01:37
gparangan sends brownie points to @brianamarie and @ganeshkmurthy and @awalthefirst :sparkles: :thumbsup: :sparkles:
:star: 546 | @brianamarie | http://www.freecodecamp.com/brianamarie
:star: 501 | @awalthefirst | http://www.freecodecamp.com/awalthefirst
David Rivera
@dvriv
Jan 06 2016 01:37
@Seryaph the else if never activate, because when they give you "tracks" the first if does
CamperBot
@camperbot
Jan 06 2016 01:37
:star: 223 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
David Rivera
@dvriv
Jan 06 2016 01:38
@juansecaro can you paste all you code?
Seryaph
@Seryaph
Jan 06 2016 01:38
@yoskakomba in your code, when you return "result" it's still an empty variable because you never updated it to reflect what "val" is
Jia Shern Tan
@saffront
Jan 06 2016 01:38
hey guys, i'm supposed to write a queue function which adds the item argument at the end of the array and remove the first element, somehow i'm getting maximum call stack size exceeded error

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

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

any idea? :worried:
Juanse Caro
@juansecaro
Jan 06 2016 01:39
@Dav1605
str.replace(/[^A-Za-z0-9]/g, '');
var str2="";
str2 =str.split("").reverse().join("");
str = str.replace(/\s+/g, '');
str2 = str2.replace(/\s+/g, '');
var pal = true;
str=str.toLowerCase();
str2=str2.toLowerCase();
Seryaph
@Seryaph
Jan 06 2016 01:39
@Dav1605 the first it does what? I think I missed something in your last message
Amar Patel
@amaryana
Jan 06 2016 01:39

"Make a function called onlyTheTruthy that takes in an object, loops through all its properties, and removes any that are falsy. Then return the object that was passed in. (hint: delete)"

here is what I have so far : https://repl.it/BbfB/36

David Rivera
@dvriv
Jan 06 2016 01:41

@Seryaph when prop = "tracks" this should run:

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

But in you code, this code run:

 if (value !== ""){
    collection[id][prop] = value;
Chris
@Aoxom
Jan 06 2016 01:42
@Dav1605 when i try collection[id][prop].push(value);, i get TypeError: collection[id][prop].push is not a function
David Rivera
@dvriv
Jan 06 2016 01:43
@juansecaro the replace method always return something, it doesnt change anything
Seryaph
@Seryaph
Jan 06 2016 01:43
@Dav1605 wouldn't that code only run if value is empty though?
oh wait
nvm
I see what you're saying
David Rivera
@dvriv
Jan 06 2016 01:43
@Seryaph ok ok you have two options
@Seryaph to fix it
@juansecaro replace return a value, it doesnt change anything.
Juanse Caro
@juansecaro
Jan 06 2016 01:44
@Dav1605 it seems that applies over str, but anyway I just changed that line
Chris
@Aoxom
Jan 06 2016 01:44
i did collection[id].tracks = [value]; for mine. it passes, but im not sure thats what the exercise wanted me to do
Jia Shern Tan
@saffront
Jan 06 2016 01:45
all good (Y)
Juanse Caro
@juansecaro
Jan 06 2016 01:45
@juansecaro I need to add to the expresions . ,
David Rivera
@dvriv
Jan 06 2016 01:45
@Aoxom show all the value
angelbenoit
@angelbenoit
Jan 06 2016 01:45
function myTest(val) {
  var answer = "";
  // Only change code below this line
  switch(val){
    case val:
      answer = "alpha";
      break;
    case val:
      answer = "beta";
      break;
    case val:
      answer = "gamma";
      break;
    case val:
      answer = "delta";
      break;
  }
anyone know how to make it if you enter 2
itll be "beta"
Chris
@Aoxom
Jan 06 2016 01:45
function update(id, prop, value) {
  if(value !== ""){
    collection[id][prop] = value;
  }else{
    delete collection[id][prop];
  }
  if(prop === "tracks" && value !== ""){
    collection[id].tracks = [value];
  }
  return collection;
}
@Dav1605 this was my (passing) solution
David Rivera
@dvriv
Jan 06 2016 01:45
@juansecaro no you dont need to replace . and ,
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 01:47
@Aoxom you will need to push the value for the tracks property.
Juanse Caro
@juansecaro
Jan 06 2016 01:47
@Dav1605 From the tests:
palindrome("A man, a plan, a canal. Panama") should return true.
is one that fails. All other that fails contains odts and commas
David Rivera
@dvriv
Jan 06 2016 01:47
@juansecaro return both values using that example, so you see what is not working
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 01:47
@Aoxom also, your first "if" should be, if (value !== "") && (prop!=="tracks) {
Bon
@OriBon
Jan 06 2016 01:47
@angelbenoit change val to actual values. Like this case 1, case 4, case "hello world", etc
David Rivera
@dvriv
Jan 06 2016 01:48
@juansecaro with console.log
Yosafat Ariel
@yoskakomba
Jan 06 2016 01:48
Hi all, need help with http://www.freecodecamp.com/challenges/waypoint-using-objects-for-lookups
here is my code, please review, I don't know what's wrong. thank you
// Setup
function phoneticLookup(val) {
  var result = "";

  // Only change code below this line


  var val = {
      "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
var result = phoneticLookup("Adams");
angelbenoit
@angelbenoit
Jan 06 2016 01:48
thanks @OriBon
CamperBot
@camperbot
Jan 06 2016 01:48
angelbenoit sends brownie points to @oribon :sparkles: :thumbsup: :sparkles:
:star: 431 | @oribon | http://www.freecodecamp.com/oribon
David Rivera
@dvriv
Jan 06 2016 01:48
@yoskakomba you need to assign the value they are asking yo to lookup to the variable result
angelbenoit
@angelbenoit
Jan 06 2016 01:48
forgot about that
thanks
Juanse Caro
@juansecaro
Jan 06 2016 01:48
@Dav1605 ok, I'll check. Thanks
CamperBot
@camperbot
Jan 06 2016 01:48
:star: 237 | @dav1605 | http://www.freecodecamp.com/dav1605
juansecaro sends brownie points to @dav1605 :sparkles: :thumbsup: :sparkles:
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 01:48
@Aoxom I take that back. the first "if" should check if prop is not tracks inside it.
Yosafat Ariel
@yoskakomba
Jan 06 2016 01:49
@Dav1605 how to do it, I'm lost. thank you
CamperBot
@camperbot
Jan 06 2016 01:49
yoskakomba sends brownie points to @dav1605 :sparkles: :thumbsup: :sparkles:
:star: 238 | @dav1605 | http://www.freecodecamp.com/dav1605
Seryaph
@Seryaph
Jan 06 2016 01:50
@yoskakomba you're missing the following code
result = lookup[val];
Jennifer Linkenauger
@jlinkenauger
Jan 06 2016 01:51

Need help with Waypoint: Assignment with a Returned Value. Confused about the second part: "You should assign process to processed."

processed=2;

function process(){
return processed;
}

dkarlin87
@dkarlin87
Jan 06 2016 01:51
I'm on the 1st lesson, and I'm unsure of where to place the font-size tag for the <p> sections
Seryaph
@Seryaph
Jan 06 2016 01:51
@Dav1605 I totally got it! Thanks for all the help
CamperBot
@camperbot
Jan 06 2016 01:51
seryaph sends brownie points to @dav1605 :sparkles: :thumbsup: :sparkles:
:warning: seryaph already gave dav1605 points
Juanse Caro
@juansecaro
Jan 06 2016 01:51
@Dav1605 aman,aplan,acanal.panama || amanap.lanaca,nalpa,nama
String1 & String 2
David Rivera
@dvriv
Jan 06 2016 01:51
@yoskakomba you table of lookup shouldnt have the same name than Val
dkarlin87
@dkarlin87
Jan 06 2016 01:51
"Inside the same <style> tag that we created for your red-text class, set the font-size of all p elements to 16 pixels (16px)."
do i indicate font-size within the <p> or at the top?
because i have it within the <style> portion and it's still showing as incorrect
Anirudh Thatipelli
@Anirudh257
Jan 06 2016 01:52
I have a problem in waypoint:Stand in Line
tommy
@tommygebru
Jan 06 2016 01:52
This message was deleted
Anirudh Thatipelli
@Anirudh257
Jan 06 2016 01:53

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

return arr[item-1]; // Change this line
}

Jennifer Linkenauger
@jlinkenauger
Jan 06 2016 01:53
@dkarlin87 you also have to assign it as a class in your html
Dan Craycraft
@craycraftdan
Jan 06 2016 01:53
The way these new waypoints are setup are extremely confusing. "Selecting from many options with switch satements" I don't understand what the waypoint is asking me do, but I watched a video on youtube about switch statements and it appears to be extremely simple yet I don't know what this waypoint wants lol
Yosafat Ariel
@yoskakomba
Jan 06 2016 01:53
@Seryaph which line? at line 3? thank you
CamperBot
@camperbot
Jan 06 2016 01:53
yoskakomba sends brownie points to @seryaph :sparkles: :thumbsup: :sparkles:
:star: 261 | @seryaph | http://www.freecodecamp.com/seryaph
Jennifer Linkenauger
@jlinkenauger
Jan 06 2016 01:53
.font-size{} class=font-size
dkarlin87
@dkarlin87
Jan 06 2016 01:54
@jlinkenauger in the <styles> tag at the top?
Yashdeep Hinge
@yashdeeph709
Jan 06 2016 01:54
hi can i help guys
Dan Craycraft
@craycraftdan
Jan 06 2016 01:54
function myTest(val) {
  var answer = "";
  // Only change code below this line
  switch(val) {
    case "alpha":
      statement1;
      break;
    case "beta":
      statement2:
      break;
    case "gamma":
      statement3;
      break;
    case "delta":
      statement4;
      break;

  }

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

// Change this value to test
myTest(1);
should satements be some sort of code like a doc write or something
David Rivera
@dvriv
Jan 06 2016 01:54

@juansecaro you code is wrong, you are doing thing that you shouldnt do like

str.replace(/[^A-Za-z0-9]/g, '');

Is doing nothing
You

Dan Craycraft
@craycraftdan
Jan 06 2016 01:54
^that's clear as day
Jennifer Linkenauger
@jlinkenauger
Jan 06 2016 01:54
@dkarlin87 .font-size{} at the top, and <p class= "font-size">
Dan Craycraft
@craycraftdan
Jan 06 2016 01:55
but I don't get what the waypoint is trying to teach me
can anyone help?
dkarlin87
@dkarlin87
Jan 06 2016 01:55
@jlinkenauger thanks so much!
CamperBot
@camperbot
Jan 06 2016 01:55
dkarlin87 sends brownie points to @jlinkenauger :sparkles: :thumbsup: :sparkles:
:star: 230 | @jlinkenauger | http://www.freecodecamp.com/jlinkenauger
David Rivera
@dvriv
Jan 06 2016 01:55
@juansecaro ill open private with you ok?
Jennifer Linkenauger
@jlinkenauger
Jan 06 2016 01:55
You're welcome!
Mathew
@mathewjcohen
Jan 06 2016 01:55

Hey everyone.

Having an issue understanding what is required of me in "Waypoint: Target the same element with multiple jQuery Selectors" as the instructions seem too vague.

Requirements:

  • Use the $("button") selector.
  • Use the $(".btn") selector.
  • Use the $("#target1") selector.
  • Only add one class with each of your three selectors.
  • Your #target1 element should have the classes animated‚ shake and btn-primary.

This doesn't work for some reason:

$(button).addClass("animated"); $(".btn").addClass("shake"); $("#target1").addClass("btn-primary");

Halp?

Jennifer Linkenauger
@jlinkenauger
Jan 06 2016 01:56
I can help you @mathewjcohen give me one sec.
Yashdeep Hinge
@yashdeeph709
Jan 06 2016 01:56
you can see why on console
Dan Craycraft
@craycraftdan
Jan 06 2016 01:56
I think I just figured it out
Shahid Foy
@shahidfoy
Jan 06 2016 01:57
@craycraftdan it needs to be written as
case 'a':
answer = "Alpha";
break;
Dan Craycraft
@craycraftdan
Jan 06 2016 01:57
Yea, I just realized that @shahidfoy thanks
CamperBot
@camperbot
Jan 06 2016 01:57
craycraftdan sends brownie points to @shahidfoy :sparkles: :thumbsup: :sparkles:
:star: 295 | @shahidfoy | http://www.freecodecamp.com/shahidfoy
Dan Craycraft
@craycraftdan
Jan 06 2016 01:57
I should of waited a bit longer before I asked haha
still, that Waypoint is confusing, idk if it's me or the way it's worded
tommy
@tommygebru
Jan 06 2016 01:57
@mathewjcohen each class should begin with animated i.e. animated bounce
Jennifer Linkenauger
@jlinkenauger
Jan 06 2016 01:57
@mathewjcohen is your code inside the function?
Yosafat Ariel
@yoskakomba
Jan 06 2016 01:58
@Seryaph thank you I can figure it out now
CamperBot
@camperbot
Jan 06 2016 01:58
yoskakomba sends brownie points to @seryaph :sparkles: :thumbsup: :sparkles:
:warning: yoskakomba already gave seryaph points
adily
@adiyous
Jan 06 2016 01:58
@mathewjcohen "button"
Anirudh Thatipelli
@Anirudh257
Jan 06 2016 01:58
@mathewjcohen , i think that it should be "animated shake" and not both in different lines.
Mathew
@mathewjcohen
Jan 06 2016 01:58

This is what I now have and the page seem unresponsive to any changes.

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

adily
@adiyous
Jan 06 2016 01:59
@mathewjcohen $("button")
Shahid Foy
@shahidfoy
Jan 06 2016 01:59
@craycraftdan yea i definitely understand the feels lol but i think ur doing the right thing and doing research
Mathew
@mathewjcohen
Jan 06 2016 02:00
Thanks! ...not sure how I missed that.
adily
@adiyous
Jan 06 2016 02:00
@mathewjcohen ("shake")
dkarlin87
@dkarlin87
Jan 06 2016 02:00

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

p { font-size: 16px }


</style>

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

<p class="red-text; 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 class="red-text;"> Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink

I just want to properly set the font size
what am i doing wrong here?
adily
@adiyous
Jan 06 2016 02:00
@mathewjcohen ("btn-primary")
frsRaza
@frsRaza
Jan 06 2016 02:01
Need help on Using objects for lookups Waypoint.
// Setup
function phoneticLookup(val) {
  var result = "";

  // Only change code below this line
  /*
  switch(val) {
    case "alpha": 
      result = "Adams";
      break;
    case "bravo": 
      result = "Boston";
      break;
    case "charlie": 
      result = "Chicago";
      break;
    case "delta": 
      result = "Denver";
      break;
    case "echo": 
      result = "Easy";
      break;
    case "foxtrot": 
      result = "Frank";
  }
*/

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

  result = val.lookup;

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

// Change this value to test
phoneticLookup("charlie");
Mathew
@mathewjcohen
Jan 06 2016 02:01
Thanks @adiyous , I just saw that...
CamperBot
@camperbot
Jan 06 2016 02:01
mathewjcohen sends brownie points to @adiyous :sparkles: :thumbsup: :sparkles:
:star: 271 | @adiyous | http://www.freecodecamp.com/adiyous
adily
@adiyous
Jan 06 2016 02:01
@dkarlin87 close the brakets on .red-text
dkarlin87
@dkarlin87
Jan 06 2016 02:02
@adiyous Thank you!
CamperBot
@camperbot
Jan 06 2016 02:02
dkarlin87 sends brownie points to @adiyous :sparkles: :thumbsup: :sparkles:
:star: 272 | @adiyous | http://www.freecodecamp.com/adiyous
frsRaza
@frsRaza
Jan 06 2016 02:02
any help?
tommy
@tommygebru
Jan 06 2016 02:02
@mathewjcohen each targeted element should have parentheses
Yosafat Ariel
@yoskakomba
Jan 06 2016 02:02
@frsRaza I just did that a minute ago
var lookup should be change to var phoneticLookup
frsRaza
@frsRaza
Jan 06 2016 02:03
@yoskakomba what am I doing wrong?
adily
@adiyous
Jan 06 2016 02:04
@frsRaza result = lookup[val]
frsRaza
@frsRaza
Jan 06 2016 02:05
@adiyous that fixed it. but can you explain why? I seemed to have it backwards
Yosafat Ariel
@yoskakomba
Jan 06 2016 02:06
@frsRaza because you have to make variable of phoneticLookup with objects and values
frsRaza
@frsRaza
Jan 06 2016 02:06
@yoskakomba got it. Thanks!
CamperBot
@camperbot
Jan 06 2016 02:06
frsraza sends brownie points to @yoskakomba :sparkles: :thumbsup: :sparkles:
:star: 304 | @yoskakomba | http://www.freecodecamp.com/yoskakomba
Jennifer Tang
@jtangsf
Jan 06 2016 02:07
Hi, I'm a newbie. Could you help me? It says my h2 element should be blue. I put this put it still marks it as wrong. :( <style>
h2 {color: blue;} CatPhotoApp
</style>
adily
@adiyous
Jan 06 2016 02:07
@frsRaza because your looking for the argument inside the object
Emile Choghi
@echoghi
Jan 06 2016 02:07
I'm on the waypoint "nesting for loops" and I seem to have written a code that crashes my google chrome browser every time i go to that page. Is there anyway the site admins can reset that waypoint for me so I can continue?
Sean McGuinness
@smmcguinness
Jan 06 2016 02:08
having issues with converting boolrean values refrom funcions
frsRaza
@frsRaza
Jan 06 2016 02:08
@adiyous Thanks!
CamperBot
@camperbot
Jan 06 2016 02:08
frsraza sends brownie points to @adiyous :sparkles: :thumbsup: :sparkles:
:star: 273 | @adiyous | http://www.freecodecamp.com/adiyous
adily
@adiyous
Jan 06 2016 02:09
@jtangsf refresh your browser and reset
Sean McGuinness
@smmcguinness
Jan 06 2016 02:09

function isLess(a, b) {
// Fix this code

return a === b;}

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

Seryaph
@Seryaph
Jan 06 2016 02:09
@echoghi , there is a reset button that resets all of your code
Emile Choghi
@echoghi
Jan 06 2016 02:10
@Seryaph I know but every time I navigate to that waypoint, the page freezes before I have a chance to click it
adily
@adiyous
Jan 06 2016 02:11
@smmcguinness is less not iqual
sorry equal
Jennifer Tang
@jtangsf
Jan 06 2016 02:12
@adiyous Still didn't work =(
Amar Patel
@amaryana
Jan 06 2016 02:13

"Make a function called onlyTheTruthy that takes in an object, loops through all its properties, and removes any that are falsy. Then return the object that was passed in. (hint: delete)"

https://repl.it/BbfB/38

still stuck on this. been trying all kinds of things but i think im getting further away now. a little guidance would help me a lot.

adily
@adiyous
Jan 06 2016 02:14
@jtangsf put your code here between 3`
Bon
@OriBon
Jan 06 2016 02:15
@amaryana Which waypoint is this
David Rivera
@dvriv
Jan 06 2016 02:16
@amaryana paste you code
Sean McGuinness
@smmcguinness
Jan 06 2016 02:16
@adiyous thanks!
CamperBot
@camperbot
Jan 06 2016 02:16
smmcguinness sends brownie points to @adiyous :sparkles: :thumbsup: :sparkles:
:star: 274 | @adiyous | http://www.freecodecamp.com/adiyous
Jennifer Tang
@jtangsf
Jan 06 2016 02:16

<style>
h2 {color: blue;} CatPhotoApp
</style>

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

Seryaph
@Seryaph
Jan 06 2016 02:17
@echoghi so you can't navigate to that page at all without the browser crashing at all?
dvcjoncar
@dvcjoncar
Jan 06 2016 02:17
I need a little help on the Stand in Line Checkpoint.
I have no idea what to do.
David Rivera
@dvriv
Jan 06 2016 02:18
@amaryana and look everything in the developer MDN
https://developer.mozilla.org/en-US/docs/Glossary/Falsy
Bon
@OriBon
Jan 06 2016 02:18
@dvcjoncar You'll want to use push(); and shift(); in this checkpoint.
David Rivera
@dvriv
Jan 06 2016 02:18
@amaryana it is pretty simple when you get it, like 3 lines of code
Amar Patel
@amaryana
Jan 06 2016 02:19
it's for another tutorial im doing alongside FCC. i learn about it here first and then try harder stuff to see if i really get it
Khademul Islam Mahin
@Mahin2k
Jan 06 2016 02:19
can someone help me?
Bon
@OriBon
Jan 06 2016 02:19
@Dav1605 It It can be done with one line of code :smile:
Khademul Islam Mahin
@Mahin2k
Jan 06 2016 02:20
Im really stuck with checkpoint stand in line, I have no idea what to do.
can someone help?
Bon
@OriBon
Jan 06 2016 02:20
@Mahin2k You'll want to use push(); and shift(); in this checkpoint.
dvcjoncar
@dvcjoncar
Jan 06 2016 02:21
@Mahin2k I am also working on this one.
adily
@adiyous
Jan 06 2016 02:21
@jtangsf I don't see any <h2> in your code

@jtangsf ``` h2 {color: blue;} CatPhotoApp
</style>

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

Khademul Islam Mahin
@Mahin2k
Jan 06 2016 02:22
@dvcjoncar I hope we finish this fast :smile:
adily
@adiyous
Jan 06 2016 02:22

``` h2 {color: blue;} CatPhotoApp
</style>

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

Khademul Islam Mahin
@Mahin2k
Jan 06 2016 02:23
@OriBon Ik that, but what exactly do i push and shift?
Bon
@OriBon
Jan 06 2016 02:23
Push the item var, return shift.
frsRaza
@frsRaza
Jan 06 2016 02:24
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  checkProp.hasOwnProperty(myObj);

  return checkProp;
}

// Test your code by modifying these values
checkObj("gift");
TESTING OBJECTS FOR PROPERTIES NEED HELP
Khademul Islam Mahin
@Mahin2k
Jan 06 2016 02:25
@OriBon how would I return shift?
Jenni
@BookSprite
Jan 06 2016 02:25
Can't get the first paragraph to the take font-size 16

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

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

<p class="red-text""font-size">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="font-size"> Kitty ipsum text: Purr jump eat the grass rip the couch scratch sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. </p>

Amar Patel
@amaryana
Jan 06 2016 02:26
@oribon @Dav1605 is this any closer? https://repl.it/BbfB/39
Jenni
@BookSprite
Jan 06 2016 02:26
isn't return shift the same as shift enter? I might be wrong
Jennifer Tang
@jtangsf
Jan 06 2016 02:26

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

<style>

h2 {color: red;}

</style>

quassy
@quassy
Jan 06 2016 02:26
Why is the following code not accepted to generate random numbers between (inclusive) 0 and 9?
function myFunction() {

  // Only change code below this line.
  return (Math.random()*10-0.5).toFixed(0);
}
Seryaph
@Seryaph
Jan 06 2016 02:27
Has anyone else encountered a bug in the Checkpoint: Stand In Line?
Bon
@OriBon
Jan 06 2016 02:27
@Mahin2k Shift returns the element which it is removing. So you can do return arr.shift();
adily
@adiyous
Jan 06 2016 02:27
@BookSprite <p class="red-text font-size">
Amar Patel
@amaryana
Jan 06 2016 02:27
function onlyTheTruth(obj) { if (obj && typeof(obj) === 'number' && !NaN(obj)) { return true; } else { delete obj; } }
Jennifer Tang
@jtangsf
Jan 06 2016 02:27
@adiyous Thanks for helping me btw !
CamperBot
@camperbot
Jan 06 2016 02:27
jtangsf sends brownie points to @adiyous :sparkles: :thumbsup: :sparkles:
:star: 275 | @adiyous | http://www.freecodecamp.com/adiyous
David Rivera
@dvriv
Jan 06 2016 02:27
@amaryana what are they asking you to do?
quassy
@quassy
Jan 06 2016 02:27
@Seryaph Nope
Bon
@OriBon
Jan 06 2016 02:27
@Seryaph I haven't encountered a bug. What is the issue you are facing?
Amar Patel
@amaryana
Jan 06 2016 02:27
"Make a function called onlyTheTruthy that takes in an object, loops through all its properties, and removes any that are falsy. Then return the object that was passed in. (hint: delete)"
adily
@adiyous
Jan 06 2016 02:28
@jtangsf correct
Amar Patel
@amaryana
Jan 06 2016 02:28
i forgot the return
frsRaza
@frsRaza
Jan 06 2016 02:28
need help with Waypoint: Testing Objects for Properties
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  checkProp.hasOwnProperty(myObj);

  return checkProp;
}

// Test your code by modifying these values
checkObj("gift");
TESTING OBJECTS FOR PROPERTIES NEED HELP
Khademul Islam Mahin
@Mahin2k
Jan 06 2016 02:28
@OriBon returning shift isnt working
Jenni
@BookSprite
Jan 06 2016 02:28
Thank you adiyous and jtangsf :D
David Rivera
@dvriv
Jan 06 2016 02:28
@amaryana it is all wrong
Amar Patel
@amaryana
Jan 06 2016 02:29
i was pretty sure of that. that's why im asking for help
Steven Osterwald
@keks411
Jan 06 2016 02:29
Can somebody help me with my code for the bonfire Title case a sentence? My code is working and all the examples return valid results but console is saying that it returns something wrong
CamperBot
@camperbot
Jan 06 2016 02:29
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
adily
@adiyous
Jan 06 2016 02:29
@frsRaza return the hole thing not just checkProp
Jennifer Tang
@jtangsf
Jan 06 2016 02:29
@adiyous I did that but it doesn't work. I don't see what I'm missing at all
quassy
@quassy
Jan 06 2016 02:29
@frsRaza hasOwnProperty() is a method of the object you want to test. checkProp is the argument. (So for starters switch positions of both...)
Bon
@OriBon
Jan 06 2016 02:30
@Mahin2k First you'll have to push the item into the array. This can be done with arr.push(insertVarHere);. Then you will need to return the value that you get from using shift. return arr.shift();.
frsRaza
@frsRaza
Jan 06 2016 02:31
@adiyous how do you return the whole thing?
David Rivera
@dvriv
Jan 06 2016 02:31

@amaryana you can use filter but they dont ask to do that, so you can use a loop.
And remember that if you do

if (false)

It will always evaluate to false and bypass the if (same with null, 0, NaN, etc)

FrankGrimesSon
@FrankGrimesSon
Jan 06 2016 02:31

Hi guys, I'm having a hard time with this checkpoint. It seems to be returning correct results when i test but wont pass am I on the right track? 'code' // Setup
function abTest(a, b) {
// Only change code below this line
if (a < 0 || b < 0) {
return "undefined";
}
// Only change code above this line

return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}

// Change values below to test your code
abTest(2,2); 'code'

Emile Choghi
@echoghi
Jan 06 2016 02:31
@Seryaph nope. It just crashes instantly. I've just skipped ahead for now
Bill
@kirah1314
Jan 06 2016 02:32

@FrankGrimesSon remove the quotes return "undefined"; undefined shouldn't be a string

undefined is a property of the global object, i.e. it is a variable in global scope.

quassy
@quassy
Jan 06 2016 02:32
@FrankGrimesSon You can create a code block by typing ``` above and below your code
David Rivera
@dvriv
Jan 06 2016 02:32
@amaryana and they dont ask to remove all the object, only the property.
frsRaza
@frsRaza
Jan 06 2016 02:32
@quassy I'm lost. like this? myObj.hasOwnProperty(checkProp);
quassy
@quassy
Jan 06 2016 02:32
@frsRaza Yes
Khademul Islam Mahin
@Mahin2k
Jan 06 2016 02:33
@OriBon still not working
adily
@adiyous
Jan 06 2016 02:33
@frsRaza return argument with hasOwnProperty on the object
Amar Patel
@amaryana
Jan 06 2016 02:33

oh. that helps. the wording throws me off a lot of the time. here is another go:

function onlyTheTruthy(obj){ var result = {}; for(var p in obj){ if(obj.hasOwnProperty(p) && obj[p]){ result[p] = obj[p]; } } return result; }

quassy
@quassy
Jan 06 2016 02:33
@frsRaza For "gift" this would return true (equivalent to myObj.hasOwnProperty("gift")). So all you need to do now is wrap that in an if-statement to return the correct value
This message was deleted
adily
@adiyous
Jan 06 2016 02:34
@frsRaza and use if/else
FrankGrimesSon
@FrankGrimesSon
Jan 06 2016 02:34
Thank you so much, that was killing me lol I will remember the code block thing for future reference also.
Bon
@OriBon
Jan 06 2016 02:35
@Mahin2k Post your code so we can look at it and see where the issue is
explain format
CamperBot
@camperbot
Jan 06 2016 02:35

: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

frsRaza
@frsRaza
Jan 06 2016 02:35
@adiyous does the If statement go inside the checkObj function or outside?
David Rivera
@dvriv
Jan 06 2016 02:35
@amaryana paste the repl.it link please
Khademul Islam Mahin
@Mahin2k
Jan 06 2016 02:35
@OriBon
Khademul Islam Mahin
@Mahin2k
Jan 06 2016 02:36
var myArr = [1,2,3,4,5];

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

  return arr.shift();  // 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));
Jonatan Bernal
@Jonatan-B
Jan 06 2016 02:36
Good evening everyone! :)
ana tolia
@anaisawesome
Jan 06 2016 02:36

// Setup
var myStr = "Jello World";

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

Khademul Islam Mahin
@Mahin2k
Jan 06 2016 02:36
@Jonatan-B you too! :smile:
adily
@adiyous
Jan 06 2016 02:36
@frsRaza inside
ana tolia
@anaisawesome
Jan 06 2016 02:36
hi i dont get this assignment waypoint understanding string immuntabily
Jonatan Bernal
@Jonatan-B
Jan 06 2016 02:36
:)
quassy
@quassy
Jan 06 2016 02:36
This message was deleted
Bon
@OriBon
Jan 06 2016 02:37
@Mahin2k Change arr.push(myArr); into arr.push(item);. Remember the item var is what we are adding onto the end of the array.
matthew3454
@matthew3454
Jan 06 2016 02:37

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

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

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

ana tolia
@anaisawesome
Jan 06 2016 02:38
try "" when assigning a class
Khademul Islam Mahin
@Mahin2k
Jan 06 2016 02:38
@Mahin2k Change arr.push(myArr); into arr.push(item);. Remember the item var is what we are adding onto the end of the array. i've already tried that doesn't work.
Bill
@kirah1314
Jan 06 2016 02:38
@matthew3454 classes need quotes around them "red-text"
Khademul Islam Mahin
@Mahin2k
Jan 06 2016 02:38
@OriBon I have tried that but it doesn't work.
adily
@adiyous
Jan 06 2016 02:40
@matthew3454 did you try <h2 class="red-text">
Bon
@OriBon
Jan 06 2016 02:40
The exact code should look like
function queue(arr, item) {
  // Your code here
  arr.push(item);
  return arr.shift();  // Change this line
}
Khademul Islam Mahin
@Mahin2k
Jan 06 2016 02:41
@OriBon doesn't work.
Bill
@kirah1314
Jan 06 2016 02:41
@Mahin2k does it say maximum stack exceeded? If yes, then you have to refresh your browser
Bon
@OriBon
Jan 06 2016 02:42
Which browser are you using? I am testing the code right now and it is passing.
Khademul Islam Mahin
@Mahin2k
Jan 06 2016 02:42
@kirah1314 k i'll try that
@kirah1314 @OriBon Thanks that worked.
CamperBot
@camperbot
Jan 06 2016 02:43
mahin2k sends brownie points to @kirah1314 and @oribon :sparkles: :thumbsup: :sparkles:
:star: 433 | @oribon | http://www.freecodecamp.com/oribon
:star: 752 | @kirah1314 | http://www.freecodecamp.com/kirah1314
ana tolia
@anaisawesome
Jan 06 2016 02:45
can anyone help me with understanding the understand string immutability?

/ Setup
var myStr = "Jello World";

// Only change code below this line

myStr[0] = "H"; // Fix Me

how do i correct the assignment to myStr?
Bon
@OriBon
Jan 06 2016 02:46
@anaisawesome Change it to myStr = "Hello World";
adily
@adiyous
Jan 06 2016 02:47
@anaisawesome look for the first element
EmilyMadirazza
@EmilyMadirazza
Jan 06 2016 02:47

Hi, I am currently stuck on waypoint 51 of JavaScript. Here is what I think it should be:

function myFunction() {
'use strict';
var myVar = "ttt";

console.log(myVar);
}
myFunction();

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

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

ana tolia
@anaisawesome
Jan 06 2016 02:48
but isnt that what js is doing for me?
it says it cant assign to read only property of '0' of helo wolrd
Bill
@kirah1314
Jan 06 2016 02:49
@EmilyMadirazza you have to delete or comment out the 2nd console.log
ana tolia
@anaisawesome
Jan 06 2016 02:49

// Setup
var myStr = "Jello World";

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

adily
@adiyous
Jan 06 2016 02:49
@anaisawesome what waypoint is that ?
ana tolia
@anaisawesome
Jan 06 2016 02:50
33
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 02:50
@anaisawesome the purpose of that waypoint is to show you can't do myStr[number] because strings are immutable (unchangeable)
ana tolia
@anaisawesome
Jan 06 2016 02:50
for basic javascript
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 02:50
@anaisawesome and the only way to change a string is to fully overwrite it.
Jason
@gitPhunky
Jan 06 2016 02:51
id turn it into an array first.. than set the value to H from there.. strings are immutable
EmilyMadirazza
@EmilyMadirazza
Jan 06 2016 02:51
thanks but tried that. still says "no global myVar variable" so added var myVar = "ttt"; outside myFunction and same result
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 02:51
@anaisawesome so the only fix you need is what you typed just above it
@EmilyMadirazza try hitting refresh after using test
@anaisawesome in other words your myStr="Hello World"; should be replacing myStr[0] = "H"; // Fix Me
frsRaza
@frsRaza
Jan 06 2016 02:52
@adiyous I am still so lost at what I'm doing. Need more clarifying instructions please.
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  myObj.hasOwnProperty(checkProp);

  if (true) {
  return hasOwnProperty();
} else {
  return "Not Found";
}
  return checkProp;
}

// Test your code by modifying these values
checkObj("gift");
ana tolia
@anaisawesome
Jan 06 2016 02:52
oh ok
EmilyMadirazza
@EmilyMadirazza
Jan 06 2016 02:52
WOW, that worked. Will have to remember that if I get stuck again. Thanks again!!
Bon
@OriBon
Jan 06 2016 02:52
@anaisawesome myStr[0] would imply that the contents of myStr is an array.
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 02:53
@EmilyMadirazza I've noticed a few people have had that . Not everyone seems to have that issue. It's rather inconsistent.
EmilyMadirazza
@EmilyMadirazza
Jan 06 2016 02:53
Ok. Thanks.
adily
@adiyous
Jan 06 2016 02:53
@anaisawesome just myStr = "Hello world"; and delete myStr[0] = "H"
frsRaza
@frsRaza
Jan 06 2016 02:54
@quassy any input?
ana tolia
@anaisawesome
Jan 06 2016 02:54
thank you @adiyous
CamperBot
@camperbot
Jan 06 2016 02:54
anaisawesome sends brownie points to @adiyous :sparkles: :thumbsup: :sparkles:
:star: 276 | @adiyous | http://www.freecodecamp.com/adiyous
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 02:55
@frsRaza if(true) will always go into the if. What you want to know is if the object has the property then return that object's value for that property
@frsRaza so really that myObj.hasOwnProperty(checkProp) should be what you have in your if
@frsRaza because that'll return true if it does, and false if it doesn't
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 02:56
@anaisawesome string variables are immutable; you cannot change individual characters. you can only assign them to new string values.
adily
@adiyous
Jan 06 2016 02:56
@frsRaza if(myOdj.hasOwnProperty(checkProp)){
Ashley
@atan77
Jan 06 2016 02:56
@CaroleAnneHannon thought of you yesterday, had to make a regex to select text between parentheses
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 02:56
@atan77 did you manage? :D
Ashley
@atan77
Jan 06 2016 02:56
@CaroleAnneHannon barely!
quassy
@quassy
Jan 06 2016 02:57
@frsRaza if ( /*check if something is true is inside here*/ ) { /*what happens if true is here!*/ }
ana tolia
@anaisawesome
Jan 06 2016 02:57
thanks all for helping me btw how do i send these so called brownie points and do they cost real money?
Ashley
@atan77
Jan 06 2016 02:57
I was thinking "of all the times @CaroleAnneHannon isn't here!"
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 02:58
@anaisawesome you write thanks and the name. like: thanks @anaisawesome
CamperBot
@camperbot
Jan 06 2016 02:58
caroleannehannon sends brownie points to @anaisawesome and @anaisawesome :sparkles: :thumbsup: :sparkles:
:star: 160 | @anaisawesome | http://www.freecodecamp.com/anaisawesome
:star: 160 | @anaisawesome | http://www.freecodecamp.com/anaisawesome
adily
@adiyous
Jan 06 2016 02:58
@anaisawesome just add thanks after mentioning somebody
CamperBot
@camperbot
Jan 06 2016 02:58
adiyous sends brownie points to @anaisawesome :sparkles: :thumbsup: :sparkles:
:star: 161 | @anaisawesome | http://www.freecodecamp.com/anaisawesome
ana tolia
@anaisawesome
Jan 06 2016 02:58
oh cool well then
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 02:58
@anaisawesome and all they cost is a little tiny piece of your soul :smiley:
ana tolia
@anaisawesome
Jan 06 2016 02:58
calm down camper bot and thanks @CaroleAnneHannon
CamperBot
@camperbot
Jan 06 2016 02:58
anaisawesome sends brownie points to @caroleannehannon :sparkles: :thumbsup: :sparkles:
:star: 622 | @caroleannehannon | http://www.freecodecamp.com/caroleannehannon
adily
@adiyous
Jan 06 2016 02:59
@CaroleAnneHannon hahaha
frsRaza
@frsRaza
Jan 06 2016 02:59
function checkObj(checkProp) {

  if (myObj.hasOwnProperty(checkProp)) {
  return checkProp;
} else {
  return "Not Found";
}
}
I rewrote the function however it doesn't complete the Waypoint properly. Does not return gift or pet
jmesa92
@jmesa92
Jan 06 2016 02:59
okay, completely lost with "checkpoint: Word Blanks" I would get what to do if I was adding to var result, but it has the "//code below this line" part
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 02:59
@frsRaza so now that you have the right if, you need the right return
quassy
@quassy
Jan 06 2016 03:00
@frsRaza I believe you have to return the value of the prop, not the prop name itself. Remember the stuff with bracket notation.
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 03:00
@frsRaza to get the value for an object's property you write something like myObj[propertyName]
@frsRaza or myObj[variableName] if you have the property in a variable
frsRaza
@frsRaza
Jan 06 2016 03:00
@CaroleAnneHannon so will I write that for gift, pet, and bed?
@CaroleAnneHannon AHH! making sensee now
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 03:00
@frsRaza nope, you have the property stored in checkProp
quassy
@quassy
Jan 06 2016 03:00
no
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 03:01
I think it clicked now :D you can do it!
frsRaza
@frsRaza
Jan 06 2016 03:02
@CaroleAnneHannon @quassy @adiyous solved it. Thanks for your guys help!!
CamperBot
@camperbot
Jan 06 2016 03:02
frsraza sends brownie points to @caroleannehannon and @quassy and @adiyous :sparkles: :thumbsup: :sparkles:
:star: 240 | @quassy | http://www.freecodecamp.com/quassy
:warning: frsraza already gave adiyous points
:star: 623 | @caroleannehannon | http://www.freecodecamp.com/caroleannehannon
quassy
@quassy
Jan 06 2016 03:03
@frsRaza My 1st brownie point, thanks! :D
CamperBot
@camperbot
Jan 06 2016 03:03
quassy sends brownie points to @frsraza :sparkles: :thumbsup: :sparkles:
:star: 243 | @frsraza | http://www.freecodecamp.com/frsraza
Cliff Lezark
@Cllezark
Jan 06 2016 03:04
Hey everyone. So I’ve made a terrible, terrible mistake. I didn’t believe the little output window when it said I had an infinite loop, and I tested it by writing "// noprotect” at the very top. And now I need to reset the bonfire I was working on so that I can complete it. Any ideas?
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 03:04
@Cllezark comment out whatever parts of the code have the loop
@Cllezark and then fix it
Christian
@Neralizer
Jan 06 2016 03:04
What is this oopsGlobal myGlobal stuff?
Cliff Lezark
@Cllezark
Jan 06 2016 03:04
@CaroleAnneHannon I can’t because the browser keeps crashing.
I think I need an Admin. Or at least an adult
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 03:05
@Cllezark oh I know you need auto run disabled
wiki auto run
CamperBot
@camperbot
Jan 06 2016 03:05

:point_right: disable code auto run [wiki]

By default, the Free Code Camp site automatically loads and runs your last recorded solution. If you have accidentally created an infinite loop or other irrecoverable error or simply don't trust the code, you can disable code auto-run by putting the following in your URL:
run=disabled

Example:

URL: http://www.freecodecamp.com/challenges/bonfire-meet-bonfire#?solution=function%20meetBonfire(argument)

No-Run URL: http://www.freecodecamp.com/challenges/bonfire-meet-bonfire#?run=disabled&solution=function%20meetBonfire(argument)

:pencil: read more about disable code auto run on the FCC Wiki

Christian
@Neralizer
Jan 06 2016 03:05
I'm stuck on global scope and functions. I can declare myGlobal as a var as 10, but they want me to declare oopsGlobal within function fun1
and assign oopsGlobal 5
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 03:06
@Neralizer there's an example on the left
Christian
@Neralizer
Jan 06 2016 03:07
sorry, it's waypoint 50 in javascript
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 03:07
@Neralizer but basically it's to show you can accidentally make a global variable by writing one out and assigning to it without using the var keyword
Nur Azhar
@nurazhar
Jan 06 2016 03:07
anyone completed Waypoint: Escaping Literal Quotes in Strings ?
dont understand backlashes :(
Bon
@OriBon
Jan 06 2016 03:07
@Neralizer oopsGlobal = 5;
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 03:08
@Neralizer and if you think it did it right and it gives you a call stack error, just hit f5 and test again
Christian
@Neralizer
Jan 06 2016 03:08
i have var myGlobal = [10];
function fun1() { oopsGlobal = [5]; }
Bon
@OriBon
Jan 06 2016 03:08
@nurazhar You need to place a backslash \ before each double quote inside the string.
Carl J. Kashnier
@CarlJKashnier
Jan 06 2016 03:08

@Neralizer @CaroleAnneHannon

@Neralizer but basically it's to show you can accidentally make a global variable by writing one out and assigning to it without using the var keyword

Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 03:08
@Neralizer they want 5, not [5]
Bon
@OriBon
Jan 06 2016 03:09
@Neralizer No brackets around 5
Christian
@Neralizer
Jan 06 2016 03:09
got it!
Nur Azhar
@nurazhar
Jan 06 2016 03:09
@OriBon thanks
CamperBot
@camperbot
Jan 06 2016 03:09
nurazhar sends brownie points to @oribon :sparkles: :thumbsup: :sparkles:
:star: 434 | @oribon | http://www.freecodecamp.com/oribon
Christian
@Neralizer
Jan 06 2016 03:09
since when do you not use brackets when defining values in javascript variables?
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 03:09
@Neralizer 5 is the number 5. [5] is an array (like a list) for which the first element is the number 5
Christian
@Neralizer
Jan 06 2016 03:09
oh right
Carl J. Kashnier
@CarlJKashnier
Jan 06 2016 03:10
This message was deleted
Christian
@Neralizer
Jan 06 2016 03:10
great! thank you!
Jenni
@BookSprite
Jan 06 2016 03:10
I'm trying to test run some of these lessons on Apache OpenOffice Writer/Web HTML new document... but I can't see the result. How do I run script?
Carl J. Kashnier
@CarlJKashnier
Jan 06 2016 03:10
@Neralizer Sorry ES5. ES4 and 6 are different
Nur Azhar
@nurazhar
Jan 06 2016 03:10

@OriBon '''var myStr= "I am a \"double quoted"\ string inside \"double quotes"\"; // Change this line

'''

CamperBot
@camperbot
Jan 06 2016 03:10
:bulb: to format code use backticks! ``` more info
Bon
@OriBon
Jan 06 2016 03:11
@nurazhar The \ needs to go before each double quotation. Like this \"double quoted\"
Nur Azhar
@nurazhar
Jan 06 2016 03:11
```var myStr= "I am a \"double quoted"\ string inside \"double quotes"\"; // Change this line
Mrs. B.
@jazzydelta99
Jan 06 2016 03:12
Hello All. Need help understanding the queue fx in javascript. I get what its suppose to do but something isn't clicking for me with how to make it work...help pls and thx
Bon
@OriBon
Jan 06 2016 03:12
@nurazhar Basically what the backslash does is say "Alright javascript, the character right after me is an escape character. So treat it as such."
Nur Azhar
@nurazhar
Jan 06 2016 03:12
@OriBon 'var myStr= "I am a \"double quoted"\ string inside \"double quotes"\"; no?
Bon
@OriBon
Jan 06 2016 03:13
@nurazhar var myStr = "I am a \"double quoted\" string inside \"double quotes\"";
adily
@adiyous
Jan 06 2016 03:13
@nurazhar before double quotes
Nur Azhar
@nurazhar
Jan 06 2016 03:13
@OriBon oh i see
Randy Goldsmith
@Dueldrawer8
Jan 06 2016 03:14
@OriBon what is the next waypoint titled Waypoint:Escape Seqeuences in Strings trying to say?
Nur Azhar
@nurazhar
Jan 06 2016 03:14
@OriBon thanks @adiyous
CamperBot
@camperbot
Jan 06 2016 03:14
nurazhar sends brownie points to @oribon and @adiyous :sparkles: :thumbsup: :sparkles:
:warning: nurazhar already gave oribon points
:star: 278 | @adiyous | http://www.freecodecamp.com/adiyous
Randy Goldsmith
@Dueldrawer8
Jan 06 2016 03:14
I created a string and got this so it should do it
``
``
Cliff Lezark
@Cllezark
Jan 06 2016 03:14
@CaroleAnneHannon @OriBon Hey, thanks for the suggestion! It sounds like that should work, but I’m not getting anywhere with run=disabled. I just get a 404 message. Does the auto run fix work for bonfires you haven’t yet solved?
CamperBot
@camperbot
Jan 06 2016 03:14
cllezark sends brownie points to @caroleannehannon and @oribon :sparkles: :thumbsup: :sparkles:
:star: 435 | @oribon | http://www.freecodecamp.com/oribon
:star: 625 | @caroleannehannon | http://www.freecodecamp.com/caroleannehannon
Jenni
@BookSprite
Jan 06 2016 03:14
does anyone here use apache?
Bon
@OriBon
Jan 06 2016 03:14
@Dueldrawer8 That waypoint is showing what other characters can be escaped.
Randy Goldsmith
@Dueldrawer8
Jan 06 2016 03:15
adily
@adiyous
Jan 06 2016 03:15
@BookSprite mamp or wamp
Randy Goldsmith
@Dueldrawer8
Jan 06 2016 03:15
var myStr = "\\ backslash \t tab \t tab \r carriage-return \n new-line";
Jenni
@BookSprite
Jan 06 2016 03:15
actually, not sure...
I'm trying to test run some of these lessons on Apache OpenOffice Writer/Web HTML new document... but I can't see the result. How do I run script?
Randy Goldsmith
@Dueldrawer8
Jan 06 2016 03:16
@OriBon is it asking me to do those escape characters followed by the which one it is?
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 03:16
@Dueldrawer8 you don't want to actually write the words backslah tab carriage-return new-line
Derek Welton
@freefora11
Jan 06 2016 03:16
Could someone explain to me what this bonfire is asking? I'm not sure what it is asking: http://www.freecodecamp.com/challenges/bonfire-drop-it
Carole Anne Hannon
@CaroleAnneHannon
Jan 06 2016 03:16
@Dueldrawer8 just the character escape codes. So backslash tab tab = \\ \t \t
Randy Goldsmith
@Dueldrawer8
Jan 06 2016 03:16
@CaroleAnneHannon thank you, was confused on what it was trying to ask
CamperBot
@camperbot
Jan 06 2016 03:16
dueldrawer8 sends brownie points to @caroleannehannon :sparkles: :thumbsup: :sparkles:
:star: 626 | @caroleannehannon | http://www.freecodecamp.com/caroleannehannon
Jenni
@BookSprite
Jan 06 2016 03:16
It looks so much like a document, I'm not sure if my font commands need specific HTML or not, I'm putting the commands in, but I can't see the result, I don't know how
It's odd, it looks just like a regular document for the most part, not sure how it works
adily
@adiyous
Jan 06 2016 03:17
This message was deleted
@BookSprite just use codepen
Jenni
@BookSprite
Jan 06 2016 03:18
the view says it's on web playout, but that means it's not taking any of my commands, and I'm following page by page with the curriculum on code camp
Lawrence Jean-Louis
@girlfromhaiti
Jan 06 2016 03:19
;/Not sure where I'm going wrong with the Word Blanks checkpoint.
Jenni
@BookSprite
Jan 06 2016 03:19
Thanks, where is just use codepen
adily
@adiyous
Jan 06 2016 03:20
@BookSprite http://codepen.io/
Krishna Teja Vooka
@urkrishna1
Jan 06 2016 03:20
stuck in check point

var collection = {
2548: {
album: "Slippery When Wet",
artist: "Bon Jovi",
tracks: [
"Let It Rock",
"You Give Love a Bad Name"
]
},
2468: {
album: "1999",
artist: "Prince",
tracks: [
"1999",
"Little Red Corvette"
]
},
1245: {
artist: "Robert Palmer",
tracks: [ ]
},
5439: {
album: "ABBA Gold"
}
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line

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

return collection;
}

Andrew Bales
@agbales
Jan 06 2016 03:21
Codepen is pretty wonderful
Bon
@OriBon
Jan 06 2016 03:21
@girlfromhaiti You need to concatenate your own strings together with the arguments passed into the function.
Krishna Teja Vooka
@urkrishna1
Jan 06 2016 03:22
After update(1245, "tracks", "Addicted to Love"), tracks should have a length of 1
Lawrence Jean-Louis
@girlfromhaiti
Jan 06 2016 03:22
@OriBon I wrote var wordBlanks = "My " + myNoun + "is " + myAdjective + "and " + myVerb + myAdverb;
but no luck
Bon
@OriBon
Jan 06 2016 03:22
@girlfromhaiti You need another string of your own in between myVerb and myAdverb.
Andrew Bales
@agbales
Jan 06 2016 03:23
@urkrishna1 Take a look at the logic of your statements.
Jenni
@BookSprite
Jan 06 2016 03:23
eventually I want to develop search queries and integrate a database with hundreds of rather large PDF files... not sure I need a playground, though I'm sure I'd have fun : )
Lawrence Jean-Louis
@girlfromhaiti
Jan 06 2016 03:23
Thanks, @OriBon
CamperBot
@camperbot
Jan 06 2016 03:23
girlfromhaiti sends brownie points to @oribon :sparkles: :thumbsup: :sparkles:
:star: 436 | @oribon | http://www.freecodecamp.com/oribon
Andrew Bales
@agbales
Jan 06 2016 03:23
@urkrishna1 You might want to swap around the if / else's
Kiki
@kststudio
Jan 06 2016 03:23
@girlfromhaiti remember to add spaces into your code. check yoru results to see if it's a proper sentence
cannelflow
@cannelflow
Jan 06 2016 03:24
@girlfromhaiti pass apace on both side
Mrs. B.
@jazzydelta99
Jan 06 2016 03:25
Can anyone help with understanding queues in javascript?
Kiki
@kststudio
Jan 06 2016 03:25
which waypoint is that @jazzydelta99
Randy Goldsmith
@Dueldrawer8
Jan 06 2016 03:25
stuck on waypoint Concatenating Strings with Plus Operator
on the test i got the first one but its saying i'm not using the urinary operator which i am
Venkataraman Srinivasan
@vsrinivasan
Jan 06 2016 03:25
can anyone help me I don't understand
Jenni
@BookSprite
Jan 06 2016 03:26
I'll mess with it for a bit though, it's all good knowledge, thanks adiyous
Venkataraman Srinivasan
@vsrinivasan
Jan 06 2016 03:26
Encode the following sequence, separated by spaces:
backslash tab tab carriage-return new-line and assign it to myStr
Randy Goldsmith
@Dueldrawer8
Jan 06 2016 03:26
var myStr = 'This is the start.' + ' This is the end.';
how is that NOT using the urinary operator?
chipymunk
@chipymunk
Jan 06 2016 03:26
Hey Everyone..
Kiki
@kststudio
Jan 06 2016 03:28
make sure to add a space after start in the first phase @Dueldrawer8
look at the results to make sure it's a proper sentence
Mrs. B.
@jazzydelta99
Jan 06 2016 03:30
@kststudio checkpoint: stand in line
Randy Goldsmith
@Dueldrawer8
Jan 06 2016 03:30
@kststudio still nothing
asialea
@asialea
Jan 06 2016 03:31
help with Waypoint: Assignment with a Returned value
CamperBot
@camperbot
Jan 06 2016 03:31
no wiki entry for: with waypoint assignment with a returned value
asialea
@asialea
Jan 06 2016 03:31
#54 under javascript
var processed = 2;
function process(num) {
return(num);
}
Manish Giri
@Manish-Giri
Jan 06 2016 03:32
@asialea where are you stuck
asialea
@asialea
Jan 06 2016 03:32
heres my code
it says "you should assign process to processed"
i don't know what that means
Bon
@OriBon
Jan 06 2016 03:33
@asialea You're going to give the value of your process function to a variable called processed. You need to create that variable.
Jonatan Bernal
@Jonatan-B
Jan 06 2016 03:33
Has anyone completed 'Bonfire: Caesars Cipher' and would like to compare code? I finished mine but I feel like my code logic have been better.
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 03:34
@vsrinivasan use the table (code and output) as a guide and create a string, var myStr = "\ \t ..." and so on.
Manish Giri
@Manish-Giri
Jan 06 2016 03:34
@asialea var processed = process(x); where x is the number given in the question
asialea
@asialea
Jan 06 2016 03:35
oh okAY thank you
Venkataraman Srinivasan
@vsrinivasan
Jan 06 2016 03:36
@ganeshkmurthy thank you
CamperBot
@camperbot
Jan 06 2016 03:36
vsrinivasan sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:star: 236 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 03:36
@vsrinivasan welcome!
Rachel
@Glimmerville
Jan 06 2016 03:37
I am having problems with Waypoint:Quoting Strings with Single Quotes.
Zdenek Otcenasek
@shatanga
Jan 06 2016 03:37

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

function checkObj(property) {

// Your Code Here

if (myObj.hasOwnProperty("property")) {
return myObj.property;
}
else {return "Not found";
}

}

// Test your code by modifying these values
checkObj("pet"); CAN SOMEONE HELP WHATS WRONG WITH THE CODE?

DJ
@qualitymanifest
Jan 06 2016 03:37
@Glimmerville post your code, or link the waypoint
Rachel
@Glimmerville
Jan 06 2016 03:37
Ok @qualitymanifest
Zdenek Otcenasek
@shatanga
Jan 06 2016 03:38
Modify the function checkObj to test myObj for checkProp. If the property is found, return that property's value. If not, return "Not Found".
DJ
@qualitymanifest
Jan 06 2016 03:38
@shatanga if (myObj.hasOwnProperty("property")) { property shouldn't be in quotation marks here
Rachel
@Glimmerville
Jan 06 2016 03:38
I guess my question is more about the instructions. If you are to 'Instructions
Change the provided string from double to single quotes and remove the escaping.' then how can the output have four double quotes, since you just changed them to single quotes?
DJ
@qualitymanifest
Jan 06 2016 03:39
@shatanga it's a variable name, not a string itself
Sarah Schlueter
@SarahMarie73
Jan 06 2016 03:39
Can anyone give me a hint on Checkpoint Counting Cards?
DJ
@qualitymanifest
Jan 06 2016 03:40
This message was deleted
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 06 2016 03:40
@Glimmerville the \s were added to escape the double quotes within the string. if you use a single quote to declare it, then there is no need to escape the double quotes, for example, x='this is an "example" of a string with double quotes'.
Sarah Schlueter
@SarahMarie73
Jan 06 2016 03:40
I'm getting tripped up with the numbers
DJ
@qualitymanifest
Jan 06 2016 03:41
@Glimmerville yeah scratch what i said, i didn't remember that waypoint well. @ganeshkmurthy 's got it
@SarahMarie73 yep paste your code
Dan Craycraft
@craycraftdan
Jan 06 2016 03:41
Hey guys, Waypoint: Returning Boolean Values from Functions, am I supposed to use a switch statement to achieve this?
Rachel
@Glimmerville
Jan 06 2016 03:41
@ganeshkmurthy @qualitymanifest it's a new waypoint. Ok let me see if that helps. Thanks.
CamperBot
@camperbot
Jan 06 2016 03:41
glimmerville sends brownie points to @ganeshkmurthy and @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 728 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
:star: 237 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
Zdenek Otcenasek
@shatanga
Jan 06 2016 03:41
@qualitymanifest THIS IS EXAMPLE FROM FREECODECAMP: var myObj = {
top: "hat",
bottom: "pants"
};
myObj.hasOwnProperty("top"); // true
myObj.hasOwnProperty("middle"); // false
@qualitymanifest so really without "" ? :)
Rita Alfonso
@alfonsotech
Jan 06 2016 03:42
HI, I want to code live over twitch and set up an account, but how do you go live? Any Twitch peeps out there who can help me?
Bon
@OriBon
Jan 06 2016 03:42
@craycraftdan No, you can use a return statement with a less-than comparison operator.
Jenni
@BookSprite
Jan 06 2016 03:43
Adily, This is fun! lol
Rachel
@Glimmerville
Jan 06 2016 03:43
OK here is the exercise http://www.freecodecamp.com/challenges/waypoint-quoting-strings-with-single-quotes
It is still confusing me because ti says "remove the escaping" (ok so you change the double quotes to single quotes) but it ALSO says "the output should have four double quotes" so... how could it if you just removed all the escaped double quotes?
DJ
@qualitymanifest
Jan 06 2016 03:43
@shatanga yeah.... in the FCC example they are testing specific strings. in the one you're doing, you're using the argument passed into a function.
Kiki
@kststudio
Jan 06 2016 03:43
@jazzydelta99 use .push() and .shift() for that checkpoint
Dan Craycraft
@craycraftdan
Jan 06 2016 03:43
I see, I thought it was still wanting me to figure it out with switch statements haha thanks @OriBon
CamperBot
@camperbot
Jan 06 2016 03:43
craycraftdan sends brownie points to @oribon :sparkles: :thumbsup: :sparkles:
:star: 438 | @oribon | http://www.freecodecamp.com/oribon
Bon
@OriBon
Jan 06 2016 03:44
@Glimmerville You are changing the start and end double-quotes, then using escaping on the remaining double-quotes inside the string.
Rachel
@Glimmerville
Jan 06 2016 03:44
@OriBon let me try that, thanks
CamperBot
@camperbot
Jan 06 2016 03:44
glimmerville sends brownie points to @oribon :sparkles: :thumbsup: :sparkles:
:star: 439 | @oribon | http://www.freecodecamp.com/oribon
Rachel
@Glimmerville
Jan 06 2016 03:46
@OriBon I don't understand this one so I'm going to skip it. I was only doing it to avoid the bonfire I was supposed to be working on. ;)
Kiki
@kststudio
Jan 06 2016 03:46
@Dueldrawer8 have you tried refreshing your page and running it again?
Rachel
@Glimmerville
Jan 06 2016 03:48
@OriBon oh ok that worked, thanks
CamperBot
@camperbot
Jan 06 2016 03:48
glimmerville sends brownie points to @oribon :sparkles: :thumbsup: :sparkles:
:warning: glimmerville already gave oribon points
Brian Barrow
@briancbarrow
Jan 06 2016 03:48
How can I push a value into an array that is nested within an object? For example,
How can I push a value onto the end of tracks? I have tried collection[2548][tracks].push(value) but that didn't work.
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    }
Bon
@OriBon
Jan 06 2016 03:48
@Glimmerville It is demonstrating that strings can be inside either single quotes or double quotes. Like "this" or 'this'. The exercise wants you to change the actual string quotes into single quotations, and then place an escape \ at each remaining double quote inside of the string.
Rachel
@Glimmerville
Jan 06 2016 03:48
@OriBon Right, thanks.
CamperBot
@camperbot
Jan 06 2016 03:48
glimmerville sends brownie points to @oribon :sparkles: :thumbsup: :sparkles:
:warning: glimmerville already gave oribon points
Rita Alfonso
@alfonsotech
Jan 06 2016 03:49
Nevermind, I figured it out
Rachel
@Glimmerville
Jan 06 2016 03:49
@OriBon it's saying 'reverse the locations of the strings' from how they began basically
Kiki
@kststudio
Jan 06 2016 03:49
I need help on Checkpoint: Counting Cards. Regarding the instruction, "and increment or decrement the global count variable"
Zdenek Otcenasek
@shatanga
Jan 06 2016 03:51

@qualitymanifest It still doesnt work my friend, maybe there is bug on the website? // Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};

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

}

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

DJ
@qualitymanifest
Jan 06 2016 03:52
@shatanga i think you just want to return checkProp
Bon
@OriBon
Jan 06 2016 03:53
@kststudio The count variable is the one at the start of the page, just above the function. You will want to increase that, leave it alone, or decrease it based on the value of the cards given.
For example, if the card value is 2,3,4,5, or 6, you want to increase the count variable by +1.
Kiki
@kststudio
Jan 06 2016 03:53
i understand @OriBon but i don't understand the example where -3 is hold and 5 is bet when the values are either =1, 0 or -1
+1, 0, -1
Zdenek Otcenasek
@shatanga
Jan 06 2016 03:54
@qualitymanifest then I would get property name but not property value
DJ
@qualitymanifest
Jan 06 2016 03:54
@shatanga can you paste a link to this waypoint? i don't remember it that well
Yernar Akimzhanov
@ernarkazakh
Jan 06 2016 03:54
Hi guys
How to escape backslash
??
Dan Craycraft
@craycraftdan
Jan 06 2016 03:56
I'm getting undefined as my answer buy Waypoint: Return Early Pattern for Functions, isn't accepting my answer
// Setup
function abTest(a, b) {
  // Only change code below this line
  if (a < 0) {
    return "undefined";
  } else if (b < 0) {
    return "undefined";
  }

  // Only change code above this line

  return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}

// Change values below to test your code
abTest(-2,2);
Manish Giri
@Manish-Giri
Jan 06 2016 03:56
@ernarkazakh \\
Brian Barrow
@briancbarrow
Jan 06 2016 03:56
anybody able to help on my question above?
DJ
@qualitymanifest
Jan 06 2016 03:56
@shatanga return myObj[checkProp]; and capitalize Found in "Not found"
Yernar Akimzhanov
@ernarkazakh
Jan 06 2016 03:57
@Manish-Giri So firstly I have to escape by \. Then I have to type backslash by \. So in total there will be 4 \s?
Dan Craycraft
@craycraftdan
Jan 06 2016 03:57
Can someone help me out, not sure what I'm doing wrong here.
Yernar Akimzhanov
@ernarkazakh
Jan 06 2016 03:58
@craycraftdan sorry bud. I`m not that advanced yet...
Zdenek Otcenasek
@shatanga
Jan 06 2016 03:58
@qualitymanifest huraa, it works... f and F is clear, but could you explain me how do I know where to use object.property or object[property] both do same :)
Kiki
@kststudio
Jan 06 2016 03:58
@craycraftdan the instruction says, " if a or b are less than 0 the function will immediately exit with a value of undefined."
Dan Craycraft
@craycraftdan
Jan 06 2016 03:58
It's ok @ernarkazakh thanks for the reply!
CamperBot
@camperbot
Jan 06 2016 03:58
craycraftdan sends brownie points to @ernarkazakh :sparkles: :thumbsup: :sparkles:
:star: 27 | @ernarkazakh | http://www.freecodecamp.com/ernarkazakh
Kiki
@kststudio
Jan 06 2016 03:58
use the OR operator for your function
Dan Craycraft
@craycraftdan
Jan 06 2016 03:59
@kststudio so I have to do them together on the same line with only one return statement then?
@kststudio I see
Kiki
@kststudio
Jan 06 2016 03:59
@craycraftdan exactly compare A with 0 OR B with 0
Dan Craycraft
@craycraftdan
Jan 06 2016 04:00
now I just have to remember how to do that haha, one sec
Yernar Akimzhanov
@ernarkazakh
Jan 06 2016 04:00
var myStr = \ \
Kiki
@kststudio
Jan 06 2016 04:00
haha no worries
Bon
@OriBon
Jan 06 2016 04:00
@kststudio As the code iterates through a given set of cards, it assigns a value for that card. So if it runs though 2,3,4,5, and 6, it is giving +1 for each card, which is where the +5 comes from. One point for each card.
DJ
@qualitymanifest
Jan 06 2016 04:00
@shatanga you can check this out https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors but to be honest i'm not entirely sure why you can't use dot notation here
Yernar Akimzhanov
@ernarkazakh
Jan 06 2016 04:00
Is it how I escape backlash?
Bon
@OriBon
Jan 06 2016 04:00
@ernarkazakh \\
Zdenek Otcenasek
@shatanga
Jan 06 2016 04:02
@qualitymanifest I think thats just a bug how this was programmed, now I remember it happened to me before - id didnt want to accept .property but accepted [property] thanks buddy, I fuckind spent one hour on it figuring out, I should have gone to gym instead :)
CamperBot
@camperbot
Jan 06 2016 04:02
shatanga sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 729 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Kevin Amado
@AMadToon
Jan 06 2016 04:02

Java waypoint 89 accessing nested arrays in JSON... the type and list categories are throwing me off from the example given to me
this is what I have which I know would work if the given code mimic'd the example
// 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

DJ
@qualitymanifest
Jan 06 2016 04:02
@shatanga yeah i'm not positive but i think it may be a bug
Dan Craycraft
@craycraftdan
Jan 06 2016 04:02
oh see, dang it
I original did it like this, then switched to a if else statement
Kiki
@kststudio
Jan 06 2016 04:02
did you get it @craycraftdan ?
Dan Craycraft
@craycraftdan
Jan 06 2016 04:03
// Setup
function abTest(a, b) {
  // Only change code below this line
  if (a < 0 && b < 0) {
    return "undefined";
  }

  // Only change code above this line

  return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}

// Change values below to test your code
abTest(2,2);
but it's ||
mixed them up lol
Kiki
@kststudio
Jan 06 2016 04:03
yup its ||
Dan Craycraft
@craycraftdan
Jan 06 2016 04:03
but that's not working either
// Setup
function abTest(a, b) {
  // Only change code below this line
  if (a < 0 || b < 0) {
    return "undefined";
  }

  // Only change code above this line

  return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}

// Change values below to test your code
abTest(2,2);
Alexander Køpke
@alexanderkopke
Jan 06 2016 04:04
@craycraftdan undefined without quotes
Dan Craycraft
@craycraftdan
Jan 06 2016 04:04
oh I see
that worked!
Alexander Køpke
@alexanderkopke
Jan 06 2016 04:04
because with quotes it would just be a string that is returned
Kiki
@kststudio
Jan 06 2016 04:05
yup
Dan Craycraft
@craycraftdan
Jan 06 2016 04:05
Thanks @kststudio @alexanderkopke
CamperBot
@camperbot
Jan 06 2016 04:05
craycraftdan sends brownie points to @kststudio and @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 247 | @kststudio | http://www.freecodecamp.com/kststudio
:star: 360 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Kiki
@kststudio
Jan 06 2016 04:05
anytime @craycraftdan
@OriBon would the best way to handle it to create a switch statement and assign count with the value for the appropriate card? then use a if statement to display either hold or bet?
Kevin Amado
@AMadToon
Jan 06 2016 04:08
Java waypoint 89 accessing nested arrays in JSON... the type and list categories are throwing me off from the example given to me
this is what I have which I know would work if the given code mimic'd the example
var secondTree = myPlants."trees"[1];
Bon
@OriBon
Jan 06 2016 04:11
@kststudio Yes you want to use a switch statement for this, then an if statement to return the value of count along with either "Bet" or "Hold".
Kiki
@kststudio
Jan 06 2016 04:11
let me add that if statement....
Jason
@gitPhunky
Jan 06 2016 04:12
@briancbarrow Not sure if this will work but try collection['2548']['tracks'].push(value) or maybe try dot notation.. I'm only guessing, as I've never had to do it myself yet, sorry!
Alexander Køpke
@alexanderkopke
Jan 06 2016 04:13
@briancbarrow collection[2548].tracks.push(value); is what you're looking for I think.. sorry it took so long but I had to figure it out first as I didn't know either
Kevin Amado
@AMadToon
Jan 06 2016 04:14
Hello ive hit a snag
Java waypoint 89
accessing nested arrays in JSON
the type and list categories are throwing me off from the example given to me
below is what I have which I know would work if the given code mimic'd the example
var secondTree = myPlants."trees"[1];
TayZar
@T-27
Jan 06 2016 04:15
I'm lost here

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

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

// Change the inputs below to test your code
convert(30);

How do I create a variable fahrenheit
Bon
@OriBon
Jan 06 2016 04:15
@TayZarSoe which waypoint is this
Eina
@thelittleblacksmith
Jan 06 2016 04:16
@AMadToon you have to take a careful look at myPlants. Is it an array or an object?
Alexander Køpke
@alexanderkopke
Jan 06 2016 04:16
@TayZarSoe with var fahrenheit
Kiki
@kststudio
Jan 06 2016 04:16
that is Checkpoint: Convert Celsius to Fahrenheit
to create a variable you use the var keyword
TayZar
@T-27
Jan 06 2016 04:17
@oribon convert celsius to fahrenheit
Kiki
@kststudio
Jan 06 2016 04:17
so var fahrenheit
Alexander Køpke
@alexanderkopke
Jan 06 2016 04:17
@TayZarSoe however you have to assign it to the calculation of celsius to fahrenheit
Bon
@OriBon
Jan 06 2016 04:17
@TayZarSoe Create a variable named fahrenheit and assign it the celsius to fahrenheit conversion, which is given in the instruction box to the left.
Mrs. B.
@jazzydelta99
Jan 06 2016 04:19

@kststudio I am trying that but I must have it in the wrong// Setup
var myArr = [1,2,3,4,5];

function queue(arr, item) {
myArr.push([6]);
myArr.shift();
// Your code here

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

Kiki
@kststudio
Jan 06 2016 04:19
ooooh wait! @OriBon. do i have to make a count for EACH card or can i just group them for the same value?
Kevin Amado
@AMadToon
Jan 06 2016 04:19
@thelittleblacksmith as incredibly cryptic as you were I got it thank you
CamperBot
@camperbot
Jan 06 2016 04:19
amadtoon sends brownie points to @thelittleblacksmith :sparkles: :thumbsup: :sparkles:
:star: 190 | @thelittleblacksmith | http://www.freecodecamp.com/thelittleblacksmith
Joel Delphin
@jojo3000
Jan 06 2016 04:20
Checkpoint: Convert Celsius to Fahrenheit cant seem to find what !== means is that the hick ?
Eina
@thelittleblacksmith
Jan 06 2016 04:20
@AMadToon haha sorry, that was the fourth time i've seen that question today lol
glad you got it though!
Joel Delphin
@jojo3000
Jan 06 2016 04:20
went to google but nada in javascrpt search or jquery
Nguyen Dang Quang
@quangnd
Jan 06 2016 04:21
Hi everybody, I have a question about Javascript, I think this is basic concept, But I was confused
Brian
@sludge256
Jan 06 2016 04:21
@jojo3000 does not equal
Joel Delphin
@jojo3000
Jan 06 2016 04:22
ahh thanks sludge256
Bon
@OriBon
Jan 06 2016 04:22
@kststudio You can group them up.
Jeff Czerniak
@mrmrbungle
Jan 06 2016 04:22
@jojo3000 it means does not equal but strict. This means not the same typ or value
Nguyen Dang Quang
@quangnd
Jan 06 2016 04:23

Here my code:

$("#start").click(function(){
var selectedDifficulty = "master";

$('#chooseModal').modal('show');

console.log($('#selectedSymbol').val());

ui.showMessage('OK! Let\'s begin');

});

$('#chooseModal').on('hidden.bs.modal', function (e) {
$('#selectedSymbol').val('xxx');
})

Rex Schrader
@SaintPeter
Jan 06 2016 04:23
@jazzydelta99 use arr, not myArr, also push item, not some other number or value. Finally, you can't return queue - that's the name of the function you're writing.
Joel Delphin
@jojo3000
Jan 06 2016 04:23
thanks mrm
Nguyen Dang Quang
@quangnd
Jan 06 2016 04:23
why after close dialog, selectedSymbol lable value still empty ?
TayZar
@T-27
Jan 06 2016 04:24
@ksstudio @alexanderkopke @OriBon Thanks, everyone. Looks like I forgot the equal sign. lol
CamperBot
@camperbot
Jan 06 2016 04:24
tayzarsoe sends brownie points to @ksstudio and @alexanderkopke and @oribon :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for ksstudio
:star: 440 | @oribon | http://www.freecodecamp.com/oribon
Kiki
@kststudio
Jan 06 2016 04:24
yeah @SaintPeter is right
CamperBot
@camperbot
Jan 06 2016 04:24
:star: 362 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Joel Delphin
@jojo3000
Jan 06 2016 04:24
cool sludge ill check it out right now thanks !
Kiki
@kststudio
Jan 06 2016 04:27
I only got 2 out of 4 correct @OriBon

'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;
break;
case 7:
case 8:
case 9:
count = 0;
break;
case 10:
case "J":
case "Q":
case "K":
case "A":
count = -1;
}

if (count == 1) {
return count + " Bet";
} else {
return count + " Hold";
}'

Jeff Czerniak
@mrmrbungle
Jan 06 2016 04:27
@jazzydelta99 dont
Kiki
@kststudio
Jan 06 2016 04:27
'code'
Jeff Czerniak
@mrmrbungle
Jan 06 2016 04:28
@jazzydelta99 dont for get to use the value that you shifted
Fabian Contrarias
@FabianContrarias
Jan 06 2016 04:28
hi everyone
can you guys help me out ,
var processed = 2;

function process(num){
  return(7 + 3) /5;
}
nstructions
Call the process function with an argument of 7 and assign its return value to the variable processed.
Bon
@OriBon
Jan 06 2016 04:29
@kststudio Change count so that it increments. Like this count++. And do the same for the decrement.
mb0207
@angelwyan
Jan 06 2016 04:30
@kststudio
you need to write it as count+=1 or count -=1
Fabian Contrarias
@FabianContrarias
Jan 06 2016 04:30
what am i doing wrong ?
Jeff Czerniak
@mrmrbungle
Jan 06 2016 04:30
@jazzydelta99 you're also trying to return the function instead of the first element
Brian Barrow
@briancbarrow
Jan 06 2016 04:31
Thanks @gitPhunky and @alexanderkopke ! I got it figured out.
CamperBot
@camperbot
Jan 06 2016 04:31
briancbarrow sends brownie points to @gitphunky and @alexanderkopke :sparkles: :thumbsup: :sparkles:
Bon
@OriBon
Jan 06 2016 04:31
@kststudio There difference is that with count = 1, count will always equal just 1 no matter how many cards are added. But with count++ or count+= (both do the same thing here), count will increase by one for each card that is included.
CamperBot
@camperbot
Jan 06 2016 04:31
:star: 363 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
:star: 204 | @gitphunky | http://www.freecodecamp.com/gitphunky
Kiki
@kststudio
Jan 06 2016 04:32
AHHHHHH
cause it will cycle through until it hits the return which will exist the code
but... i am still failing at cards Sequence 2, 3, 4, 5, 6 should return "5 Bet"
i have it as count+= 1;
Bon
@OriBon
Jan 06 2016 04:33
@kststudio Have to edit the evaluation in your if statement
Kiki
@kststudio
Jan 06 2016 04:33
exit*
Bon
@OriBon
Jan 06 2016 04:34
return the current count and the string "Bet" if the count is positive, or "Hold" if the count is zero or negative.
mb0207
@angelwyan
Jan 06 2016 04:34
@kststudio
return count + "Bet"'
Bon
@OriBon
Jan 06 2016 04:34
So we want to return the count + "Bet" if count is positive (in other words, if count is greater than 0)
Leonardo Ceschin
@leoceschin
Jan 06 2016 04:35
hey guys, on the Nesting For Loops, i can't understand how to multiply the product variable with the sub-array of arr
Kiki
@kststudio
Jan 06 2016 04:35
SHUT
THE
FRONT
DOOR
i did it
Jeff Czerniak
@mrmrbungle
Jan 06 2016 04:35
@FabianContrarias first thing processed should = process (num)
Kiki
@kststudio
Jan 06 2016 04:35
lmao thank @OriBon
CamperBot
@camperbot
Jan 06 2016 04:35
kststudio sends brownie points to @oribon :sparkles: :thumbsup: :sparkles:
:star: 441 | @oribon | http://www.freecodecamp.com/oribon
Bon
@OriBon
Jan 06 2016 04:35
Good job :smile:
Holly Williford
@hollyhascode
Jan 06 2016 04:35
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here
 checkProp = "pony"
  return "Not Found";
}
  return "Found"
}

// Test your code by modifying these values
checkObj("gift");
Kiki
@kststudio
Jan 06 2016 04:35
i really appreciate your help!! it totally makes sense now.
Holly Williford
@hollyhascode
Jan 06 2016 04:35
from waypoint:testing objects for properties
mb0207
@angelwyan
Jan 06 2016 04:36
Hey guys, I am having trouble writing the code for Checkpoint: Record Collection
Holly Williford
@hollyhascode
Jan 06 2016 04:36
I'm trying to understnad how .hasOwnProperty([propertyname]) relates to this lesson or the last
Manish Giri
@Manish-Giri
Jan 06 2016 04:37
@angelwyan what’s your question
Jeff Czerniak
@mrmrbungle
Jan 06 2016 04:38
@hollyhascode myObj needs to be referenced not just the thing inside it. myObj ["pony"]
Bon
@OriBon
Jan 06 2016 04:38
@hollyhascode Some of the previous lessons taught you how to access properties/values. This Waypoint is trying to get you to figure out how we can check if a property exists in an object, and then return a value based on that.
Holly Williford
@hollyhascode
Jan 06 2016 04:39
Oh okay. I
Rayni Jules
@RaynJ
Jan 06 2016 04:39
Can somebody offer me some real quick help?
Holly Williford
@hollyhascode
Jan 06 2016 04:39
I'm still confused about the example in these problems.
Eina
@thelittleblacksmith
Jan 06 2016 04:40
@RaynJ what are you needing help with?
Bon
@OriBon
Jan 06 2016 04:40
.hasOwnProperty(); is a method to check is a property exists inside the object you are testing.
mb0207
@angelwyan
Jan 06 2016 04:40

@Manish-Giri I don't think I quite understand the instruction.
function update(id, prop, value) {
if (value!== "") {
value = prop;}
if (prop == "tracks" && value!== "") {
collection.push([value]);
}

}
return collection;
}

Rayni Jules
@RaynJ
Jan 06 2016 04:40
Im at a Javascript lesson:

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

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.