These are chat archives for FreeCodeCamp/Help

15th
Jan 2016
tommy
@tommygebru
Jan 15 2016 00:00 UTC
@aitruong the top part is separating the case statements, this is the very opposite of the point of exercise ...look at instructions again
Charles Stoy
@charst46
Jan 15 2016 00:00 UTC
@tommygebru Waypoint: Introducing JavaScript Object Notation JSON
tommy
@tommygebru
Jan 15 2016 00:00 UTC
@becorry they want you to assign a new string to the old variable :smile:
@charst46 also link please
aitruong
@aitruong
Jan 15 2016 00:01 UTC
@tommygebru : should i use if or switch for this case?
tommy
@tommygebru
Jan 15 2016 00:01 UTC
@becorry
var myString="";
myString="something";
sunandakothapalli
@sunandakothapalli
Jan 15 2016 00:01 UTC
First, add a new image below the existing one. Set its src attribute to http://bit.ly/fcc-running-cats. need help
Cristian V. Nica
@cristianvnica
Jan 15 2016 00:01 UTC

Hi, who can help me little with Checkpoint: Profile Lookup?

function lookUp(firstName, prop){
// Only change code below this line
  for (var obj in contacts) {
    var fn = contacts[obj].firstName,
        objProp = contacts[obj][prop];

    if (fn === firstName && objProp !== undefined) {
      return objProp;
    } else if (fn === firstName && objProp === undefined) {
      return "No such property";
    } else if (fn !== firstName && objProp === undefined) {
      return "No such contact";
    }
  }
// Only change code above this line
}

This is what i've managed so far..

Glen Roberts
@ZeroAccess
Jan 15 2016 00:02 UTC
@cristianvnica check this psuedo code and see if you can work it out further.
Loop through each contact (for loop)
if firstName == object.firstName
check properties (Hint: .hasOwnProperty() is helpful here)
Yes - return object[prop]
No - “No such property"
Else all contacts searched and no contact match found (outside for loop)
return “No such contact"
Benjamin Corry
@becorry
Jan 15 2016 00:02 UTC
okay thanks @tommygebru I figured it out
CamperBot
@camperbot
Jan 15 2016 00:02 UTC
becorry sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 330 | @tommygebru | http://www.freecodecamp.com/tommygebru
sunandakothapalli
@sunandakothapalli
Jan 15 2016 00:02 UTC
Waypoint: Make Images Mobile Responsive
tommy
@tommygebru
Jan 15 2016 00:02 UTC
@becorry nice :+1:
@sunandakothapalli also link please :+1:
CompGeekGirl
@LisaRamos
Jan 15 2016 00:03 UTC

Hello, I need help with WP #96. http://www.freecodecamp.com/challenges/waypoint-nesting-for-loops

I get 1 on the console and nothing is going through. How do I fix this ?

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

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
tommy
@tommygebru
Jan 15 2016 00:03 UTC
@charst46 Do you have a question or would you like to share your code?
Brian
@sludge256
Jan 15 2016 00:04 UTC
@LisaRamos product is not an array
arr is however
sunandakothapalli
@sunandakothapalli
Jan 15 2016 00:04 UTC
need help with the above
Charles Stoy
@charst46
Jan 15 2016 00:04 UTC

@tommygebru 87.Waypoint: Testing Objects for Properties Here is my code: var myMusic = [
{
"artist": "Billy Joel",
"title": "Piano Man",
"release_year": 1993,
"formats": [
"CS",
"8T",
"LP" ],
"gold": true
}
// Add record here

{
'artist':'John Lennon',
'title': 'Imagine',
'release_year': 1973,
'formats': [
'Cassette',
'LP'
]
}

];

tommy
@tommygebru
Jan 15 2016 00:04 UTC
@aitruong the instructions ask for switch
Cristian V. Nica
@cristianvnica
Jan 15 2016 00:05 UTC
@ZeroAccess Thank you. All i had to do it was to put return "No such contact" outside the loop ..:)
CamperBot
@camperbot
Jan 15 2016 00:05 UTC
cristianvnica sends brownie points to @zeroaccess :sparkles: :thumbsup: :sparkles:
:star: 280 | @zeroaccess | http://www.freecodecamp.com/zeroaccess
MajorTom-1225
@MajorTom-1225
Jan 15 2016 00:05 UTC
@sunandakothapalli I can help you.
Glen Roberts
@ZeroAccess
Jan 15 2016 00:05 UTC
@cristianvnica no worries glad ya got it :D
tommy
@tommygebru
Jan 15 2016 00:05 UTC
@charst46 :+1: What was the question?
aitruong
@aitruong
Jan 15 2016 00:05 UTC

var ourDog = {
"name": "Camper",
"legs": 4,
"tails": 1,
"friends": ["everything!"]
};

// Only change code below this line.

var myDog = {
"name": "Tira",
"legs": 4,
"tails": 1,
"friends": ["Miba","Cat"]
};

I don’t know why i have syntax error?
Charles Stoy
@charst46
Jan 15 2016 00:06 UTC
@tommygebru I have tried several alternatives; googled the issue and still do not have the code/logic down Where am I missing the answer/logic
tommy
@tommygebru
Jan 15 2016 00:06 UTC
@charst46 needs more formats
also your array myMusic needs to know that the objects are separated with a comma
DJ
@qualitymanifest
Jan 15 2016 00:07 UTC
@MajorTom-1225 if you .join('') norArr when you make it, and then split join reverse revArr it works (for all except last case)
CompGeekGirl
@LisaRamos
Jan 15 2016 00:07 UTC

@sludge256 I tried doing what you said and I still get 1 on the console.

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++) {
      console.log(arr[i][j]);
    }
  }
  // Only change code above this line
  return product;
}

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

How do I solve this thing?

tommy
@tommygebru
Jan 15 2016 00:07 UTC
@aitruong try resetting
also maybe myDog needs only one friend
DJ
@qualitymanifest
Jan 15 2016 00:07 UTC
@MajorTom-1225 .match() result indexes are read-only. go to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array and search for "input"
Brian
@sludge256
Jan 15 2016 00:08 UTC
@LisaRamos now just assign it to product wtih *=
I'm heading out but someone else should be able to get you the rest of the way
CompGeekGirl
@LisaRamos
Jan 15 2016 00:09 UTC
@sludge256 Okay.
tommy
@tommygebru
Jan 15 2016 00:09 UTC
@LisaRamos I think its returning product and not console.log .....
aitruong
@aitruong
Jan 15 2016 00:09 UTC
@tommygebru thank you. Fixed!
CamperBot
@camperbot
Jan 15 2016 00:09 UTC
aitruong sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:warning: aitruong already gave tommygebru points
tommy
@tommygebru
Jan 15 2016 00:09 UTC
@aitruong nice :+1:
DJ
@qualitymanifest
Jan 15 2016 00:09 UTC
Selection_093.png
tommy
@tommygebru
Jan 15 2016 00:09 UTC
@sludge256 :+1:
CompGeekGirl
@LisaRamos
Jan 15 2016 00:10 UTC
@tommygebru How do I not make it return product and how do I make it return console log instead?
tommy
@tommygebru
Jan 15 2016 00:10 UTC
@LisaRamos sludge256 had the right idea we are returning product so multiply the index with product
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:10 UTC
Hi @LisaRamos , if you just want to log the product, simply remove the return statement
Charles Stoy
@charst46
Jan 15 2016 00:12 UTC
@tommygebru Sorry, not getting what you mean...I placed the commas after each entry so not seeing what is missing
MajorTom-1225
@MajorTom-1225
Jan 15 2016 00:12 UTC

@qualitymanifest Thanks. But I still need to know why this

if (revArr[i] === norArr[i])

uses not reversed revArr?

CamperBot
@camperbot
Jan 15 2016 00:12 UTC
majortom-1225 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 792 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
CompGeekGirl
@LisaRamos
Jan 15 2016 00:12 UTC
@lmalvaran But it says change the code above the line where return product is.
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++) {
      console.log(arr[i][j]);
    }
  }
  // Only change code above this line
  return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
DJ
@qualitymanifest
Jan 15 2016 00:13 UTC
@MajorTom-1225 because the indexes of norArr are read-only. so you can make it appear backwards but the indexes are the same
tommy
@tommygebru
Jan 15 2016 00:13 UTC
@charst46 well there are two records and your myArray needs to count them therefore place a comma between them :smile:
MajorTom-1225
@MajorTom-1225
Jan 15 2016 00:14 UTC
@qualitymanifest Understand. Sorry for re-asking and thank you again.
CamperBot
@camperbot
Jan 15 2016 00:14 UTC
majortom-1225 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: majortom-1225 already gave qualitymanifest points
DJ
@qualitymanifest
Jan 15 2016 00:14 UTC
@MajorTom-1225 no worries. it's just one of those quirks
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:14 UTC
@LisaRamos , i'm sorry I didn't see the complete task. What is it supposed to do?
Charles Stoy
@charst46
Jan 15 2016 00:14 UTC
thanks @tommygebru Saw the note about needing the comma between objects but that note did not register...
CamperBot
@camperbot
Jan 15 2016 00:14 UTC
charst46 sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 331 | @tommygebru | http://www.freecodecamp.com/tommygebru
tommy
@tommygebru
Jan 15 2016 00:17 UTC
@LisaRamos therefore we reassign product to have a different value
if j = to every single number
and product =1
we want j to multiply to product
greg
@wearenotgroot
Jan 15 2016 00:17 UTC
@LisaRamos hint! accumulate the multiplied values into a variable
tommy
@tommygebru
Jan 15 2016 00:18 UTC
@wearenotgroot :+1:
CompGeekGirl
@LisaRamos
Jan 15 2016 00:19 UTC
@tommygebru @wearenotgroot How do I do that?
greg
@wearenotgroot
Jan 15 2016 00:22 UTC
@LisaRamos hint! use *
CompGeekGirl
@LisaRamos
Jan 15 2016 00:22 UTC
@wearenotgroot Where do I put that?
greg
@wearenotgroot
Jan 15 2016 00:23 UTC
@LisaRamos console.log(arr[i][j]); remove console.log use it right here
Therese
@halyang87
Jan 15 2016 00:23 UTC
Help with Introducing else statements please :)
my code:
if(val > 5) {
result = "Bigger than 5";
} else {
return "5 or smaller";
}
CamperBot
@camperbot
Jan 15 2016 00:23 UTC
no wiki entry for: with introducing else statements please my code ifval 5 result bigger than 5 else return 5 or smaller
DJ
@qualitymanifest
Jan 15 2016 00:23 UTC
@halyang87 which waypoint is this? that code looks fine...
oh
i see in one instance you're assigning something to result, in the other you're returning
you're probably supposed to do the same thing for both
alasdairr
@alasdairr
Jan 15 2016 00:24 UTC

"If the num is less than or equal to 3, then the length of the three dots is not added to the string length"

"truncate("A-", 1) should return "A..."."

1 < 3 so it shouldn't be expecting the ... according to the descripton

*descrpition
or am i missing something?
DJ
@qualitymanifest
Jan 15 2016 00:26 UTC
@alasdairr they're just saying don't subtract the length of the dots from the strings length. if you did you would get a negative number and there would be no string left
tommy
@tommygebru
Jan 15 2016 00:26 UTC
@LisaRamos
console.log(arr[i][j]);//Replace this with your algorithm
alasdairr
@alasdairr
Jan 15 2016 00:26 UTC
thanks, i misread that lol
Therese
@halyang87
Jan 15 2016 00:26 UTC
@qualitymanifest should i change my code or?
greg
@wearenotgroot
Jan 15 2016 00:26 UTC
@LisaRamos
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++) {
      console.log(arr[i][j]);  /////////accumulate the multiplied values and store it to a variable     use  *  arr[i][j]
    }
  }
  // Only change code above this line
  return product;
}
tommy
@tommygebru
Jan 15 2016 00:26 UTC
@halyang87 remove assignment operator =
DJ
@qualitymanifest
Jan 15 2016 00:27 UTC
@halyang87 well do they want you to return something or assign something to result? i don't remember that waypoint. you can paste the link too
tommy
@tommygebru
Jan 15 2016 00:27 UTC
@alasdairr have you tried the bonfire room ?
https://gitter.im/orgs/FreeCodeCamp/rooms/
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:27 UTC
@LisaRamos this will do the trick

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

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

Therese
@halyang87
Jan 15 2016 00:27 UTC
Instructions
Combine the if statements into a single if/else statement.
DJ
@qualitymanifest
Jan 15 2016 00:27 UTC
@halyang87 if you're supposed to assign something to result do that for both cases. if you're just supposed to return do that for both cases.
greg
@wearenotgroot
Jan 15 2016 00:28 UTC
@lmalvaran psst. do not show entire solution!
tommy
@tommygebru
Jan 15 2016 00:28 UTC
@qualitymanifest :+1: i didnt see that they were different
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:28 UTC
im sorry
CompGeekGirl
@LisaRamos
Jan 15 2016 00:28 UTC
@lmalvaran Thanks. It worked.
CamperBot
@camperbot
Jan 15 2016 00:28 UTC
lisaramos sends brownie points to @lmalvaran :sparkles: :thumbsup: :sparkles:
:star: 33 | @lmalvaran | http://www.freecodecamp.com/lmalvaran
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:29 UTC
thanks for the brownie @LisaRamos
CamperBot
@camperbot
Jan 15 2016 00:29 UTC
lmalvaran sends brownie points to @lisaramos :sparkles: :thumbsup: :sparkles:
:star: 264 | @lisaramos | http://www.freecodecamp.com/lisaramos
tommy
@tommygebru
Jan 15 2016 00:29 UTC
@lmalvaran keep trying to drop hints :+1: and make them beg for the answer
MUHAHAHA
greg
@wearenotgroot
Jan 15 2016 00:29 UTC
@LisaRamos did you understand why it worked?
DJ
@qualitymanifest
Jan 15 2016 00:29 UTC
it's beets
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:29 UTC
ok @tommygebru
DJ
@qualitymanifest
Jan 15 2016 00:29 UTC
why isn't there a beet emoji
Therese
@halyang87
Jan 15 2016 00:29 UTC

@qualitymanifest their code looks like this
if(val > 5) {
result = "Bigger than 5";
}

if(val <= 5) {
result = "5 or Smaller";
}
the instruction says combine the statements into a single else/if. the code i showed you was right or wrong? :)

Chris
@Aoxom
Jan 15 2016 00:30 UTC
@ZeroAccess thanks, the psuedocode you posted for someone like 25 mins ago just helped me too :)
CamperBot
@camperbot
Jan 15 2016 00:30 UTC
aoxom sends brownie points to @zeroaccess :sparkles: :thumbsup: :sparkles:
:star: 281 | @zeroaccess | http://www.freecodecamp.com/zeroaccess
Therese
@halyang87
Jan 15 2016 00:30 UTC
*my code i showed you
DJ
@qualitymanifest
Jan 15 2016 00:30 UTC
@halyang87 okay so assign something to result for both cases instead of returning in your else
MajorTom-1225
@MajorTom-1225
Jan 15 2016 00:30 UTC
@qualitymanifest WORKING!
  lcStr = str.toLowerCase();
  var norArr = lcStr.match(/\w/gi);
  var trevArr = [];
  for (i = 0; i < norArr.length; i++) {
      trevArr.push(norArr[i]);
  }
  var revArr = trevArr.reverse();
tommy
@tommygebru
Jan 15 2016 00:30 UTC
@halyang87 Share link please or title of the waypoint
DJ
@qualitymanifest
Jan 15 2016 00:30 UTC
@MajorTom-1225 :+1:
tommy
@tommygebru
Jan 15 2016 00:31 UTC
@MajorTom-1225 :+1:
Therese
@halyang87
Jan 15 2016 00:31 UTC
Waypoint: Introducing Else Statements
@tommygebru
DJ
@qualitymanifest
Jan 15 2016 00:31 UTC
@halyang87
if(val > 5) {
result = "Bigger than 5"; \\ it sounds like they want you to assign the string to result like this
} else {
return "5 or smaller"; \\ not return like this
}
Cory O'Dell
@coryodell28
Jan 15 2016 00:31 UTC
Sorry for this silly question, but I'm stuck with what should be an easy one. I followed the example and I'm guessing the example is missing something. Waypoint: Accessing Properties with the Dot Operator
MajorTom-1225
@MajorTom-1225
Jan 15 2016 00:32 UTC
@qualitymanifest But except this palindrome("0_0 (: /-\ :) 0-0") as you said before.
Cory O'Dell
@coryodell28
Jan 15 2016 00:32 UTC

// Setup
var testObj = {
"hat": "ballcap",
"shirt": "jersey",
"shoes": "cleats"
};

// Only change code below this line

testObj.hat; // Change this line
testObj.shirt; // Change this line

A word character is a character from a-z, A-Z, 0-9, including the _ (underscore) character.
bash
@barbaralukasz
Jan 15 2016 00:34 UTC
can someone tell me what i'm doing wrong? It's asking me to add Bootstrap's btn-block class to my Bootstrap button.

can someone tell me what i'm doing wrong? It's asking me to add Bootstrap's btn-block class to my Bootstrap button.

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

h2 {
font-family: Lobster, Monospace;
}

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

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

.smaller-image {
width: 100px;
}

.btn-block

</style>

<div class="container-fluid">
<h2 class="red-text text-center">CatPhotoApp</h2>

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

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

<img src="http://bit.ly/fcc-running-cats" class="img-responsive">
<button class="btn-block">Like</button>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>

DJ
@qualitymanifest
Jan 15 2016 00:35 UTC
@barbaralukasz i think it needs to be btn btn-block
you replaced btn right?
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:35 UTC
@barbaralukasz check your style .btn-block, you're missing the attributes
tommy
@tommygebru
Jan 15 2016 00:36 UTC
@halyang87 look carefully result is not return :smile:
bash
@barbaralukasz
Jan 15 2016 00:38 UTC
@lmalvaran @qualitymanifest i changed class from .btn-block to .btn.btn-block and still not working
DJ
@qualitymanifest
Jan 15 2016 00:38 UTC
@barbaralukasz you don't need to add .btn-block in your style. if you have bootstrap linked into your code ( i don't see it in there) they create .btn-block class for you
MajorTom-1225
@MajorTom-1225
Jan 15 2016 00:38 UTC
@qualitymanifest Done! var norArr = lcStr.match(/[A-Za-z0-9]/gi);
Abhisek Pattnaik
@abhisekp
Jan 15 2016 00:38 UTC
@tommygebru      :+1:
@qualitymanifest :+1:
DJ
@qualitymanifest
Jan 15 2016 00:38 UTC
@barbaralukasz delete that part from your style element and when you add the class in your html just add btn btn-block
bash
@barbaralukasz
Jan 15 2016 00:38 UTC
@qualitymanifest its tell me "Your button should have the class btn-block"
Therese
@halyang87
Jan 15 2016 00:38 UTC
@tommygebru my code is this
if(val > 5) {
result = "Bigger than 5";
} else {
return "5 or smaller";
}
can you hint me what code to change?
DJ
@qualitymanifest
Jan 15 2016 00:39 UTC
@halyang87 allow me to quote myself here
@halyang87
if(val > 5) {
result = "Bigger than 5"; \\ it sounds like they want you to assign the string to result like this
} else {
return "5 or smaller"; \\ not return like this
}
bash
@barbaralukasz
Jan 15 2016 00:39 UTC
@qualitymanifest THANKS! go it :)
CamperBot
@camperbot
Jan 15 2016 00:39 UTC
barbaralukasz sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 793 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
tommy
@tommygebru
Jan 15 2016 00:39 UTC
@halyang87 it also wants you to include your comparing a value to both 10 and 5
similar to the example in the instruction :smile:
DJ
@qualitymanifest
Jan 15 2016 00:39 UTC
@barbaralukasz :+1:
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:40 UTC
@barbaralukasz take the suggestion of @qualitymanifest , if you're using bootstra, you don't need to include in your style the btn-block class. remove it there and just add it in your button
greg
@wearenotgroot
Jan 15 2016 00:40 UTC
ok, going to bed. GL all and keep on coding :smile:
Edgyveggieyogi
@Edgyveggieyogi
Jan 15 2016 00:40 UTC
hello everyone, i'm got stuck in Waypoint: "size your images"
Patrick Magee
@patjmagee
Jan 15 2016 00:40 UTC
Hi everyone, I'm trying to the the target:nth-child(n) function and I just don't understand how it targets a specific element. In my code, there's no reference to which element's child needs to be modified. $(".target:nth-child(2)").addclass("animated bounce");
Edgyveggieyogi
@Edgyveggieyogi
Jan 15 2016 00:41 UTC

where i need to create a class and call it "smaller-images" img{
width:100px;

}

Chris
@Aoxom
Jan 15 2016 00:41 UTC
@patjmagee they dont meant to literally target nth
tommy
@tommygebru
Jan 15 2016 00:41 UTC
@wearenotgroot :+1:
Patrick Magee
@patjmagee
Jan 15 2016 00:42 UTC
@Aoxom So replace nth with the actual target?
Edgyveggieyogi
@Edgyveggieyogi
Jan 15 2016 00:42 UTC
all i need is to find out how to integrate the class name "smaller-image"
tommy
@tommygebru
Jan 15 2016 00:43 UTC
@Edgyveggieyogi both in css and in html
http://www.w3schools.com/html/
http://www.w3schools.com/css/
Edgyveggieyogi
@Edgyveggieyogi
Jan 15 2016 00:43 UTC
thanks tom i already did that and did not work
tommy
@tommygebru
Jan 15 2016 00:44 UTC
@halyang87 how are you ?
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:44 UTC
@Edgyveggieyogi i think you're not declaring the right class in your style
@Edgyveggieyogi naming classes on css is something like this .name-of-class{ attr:val}
Therese
@halyang87
Jan 15 2016 00:45 UTC
@tommygebru still not getting it right.
Edgyveggieyogi
@Edgyveggieyogi
Jan 15 2016 00:45 UTC
let me try that, thank you lmalvaran.
tommy
@tommygebru
Jan 15 2016 00:45 UTC
@lmalvaran :+1:
Therese
@halyang87
Jan 15 2016 00:46 UTC
myTest(4) should return "5 or Smaller"
myTest(5) should return "5 or Smaller"
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:46 UTC
@Edgyveggieyogi then applying the class to the element <h1 class="name-of-class">Hello World</h1>
tommy
@tommygebru
Jan 15 2016 00:46 UTC
@halyang87 show new code
Therese
@halyang87
Jan 15 2016 00:46 UTC
@tommygebru still the same code, i just cant really seem to figure it out. ugh
i did it
Chris
@Aoxom
Jan 15 2016 00:47 UTC
@patjmagee sorry my mistake, all you had to do was fix addclass to be addClass
tommy
@tommygebru
Jan 15 2016 00:48 UTC
@halyang87 nice :+1:
Patrick Magee
@patjmagee
Jan 15 2016 00:49 UTC
@Aoxom Oh my, I didn't realize it was case sensitive until now!
CompGeekGirl
@LisaRamos
Jan 15 2016 00:51 UTC

Okay, I'm having difficulty with CP #98. http://www.freecodecamp.com/challenges/checkpoint-profile-lookup#?solution=%2F%2FSetup%0Avar%20contacts%20%3D%20%5B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Akira%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Laine%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%220543236543%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Pizza%22%2C%20%22Coding%22%2C%20%22Brownie%20Points%22%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Harry%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Potter%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%220994372684%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Hogwarts%22%2C%20%22Magic%22%2C%20%22Hagrid%22%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Sherlock%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Holmes%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%220487345643%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Intruiging%20Cases%22%2C%20%22Violin%22%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Kristian%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Vos%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%22unknown%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Javascript%22%2C%20%22Gaming%22%2C%20%22Foxes%22%5D%0A%20%20%20%20%7D%2C%0A%5D%3B%0A%0A%0Afunction%20lookUp(firstName%2C%20prop)%7B%0A%2F%2F%20Only%20change%20code%20below%20this%20line%0A%20%20if%20(firstName%2C%20prop%20%3D%3D%3D%20true)%20%7B%0A%20%20%20%20return%20%22value%22%3B%0A%20%20%7D%0A%20%20if%20(firstName%20!%3D%3D%20prop%20in%20contacts)%20%7B%0A%20%20%20%20return%20%22No%20such%20contact%22%3B%0A%20%20%7D%0A%20%20if%20(prop%20!%3D%3D%20false)%20%7B%0A%20%20%20%20return%20%22No%20such%20property%22%3B%0A%20%20%7D%0A%2F%2F%20Only%20change%20code%20above%20this%20line%0A%7D%0A%0A%2F%2F%20Change%20these%20values%20to%20test%20your%20function%0AlookUp(%22Akira%22%2C%20%22likes%22)%3B%0A

I don't know what I'm doing with this code I have here and I'm getting "No such contact on the console.

//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intruiging Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    },
];


function lookUp(firstName, prop){
// Only change code below this line
  if (firstName, prop === true) {
    return "value";
  }
  if (firstName !== prop in contacts) {
    return "No such contact";
  }
  if (prop !== false) {
    return "No such property";
  }
// Only change code above this line
}

// Change these values to test your function
lookUp("Akira", "likes");

What am I doing wrong here?

Donald
@codescout811
Jan 15 2016 00:52 UTC
Hi everyone....
tommy
@tommygebru
Jan 15 2016 00:52 UTC
@codescout811 welcome
Patrick Magee
@patjmagee
Jan 15 2016 00:52 UTC
@Aoxom Tada! Thanks man, I racked my brain for a good 10m before even logging on here. I thought I wasn't understanding the actual code :)
CamperBot
@camperbot
Jan 15 2016 00:52 UTC
patjmagee sends brownie points to @aoxom :sparkles: :thumbsup: :sparkles:
:star: 387 | @aoxom | http://www.freecodecamp.com/aoxom
Chris
@Aoxom
Jan 15 2016 00:53 UTC
@patjmagee so does it feel better or worse when it was such a small thing to fix? lol
tommy
@tommygebru
Jan 15 2016 00:53 UTC
@LisaRamos
if (firstName, prop === true) {//explain this please
Donald
@codescout811
Jan 15 2016 00:55 UTC
just need some help I'mstuck in add borders around your elements. I can'tgive the image border width,style andcolor...any clue?
Kunal
@kunalg1
Jan 15 2016 00:55 UTC
hi has anybody completed "Checkpoint: Stand in Line"
Chris
@Aoxom
Jan 15 2016 00:56 UTC
@cristianvnica check this psuedo code and see if you can work it out further.
Loop through each contact (for loop)
if firstName == object.firstName
check properties (Hint: .hasOwnProperty() is helpful here)
Yes - return object[prop]
No - “No such property"
Else all contacts searched and no contact match found (outside for loop)
return “No such contact"
CompGeekGirl
@LisaRamos
Jan 15 2016 00:56 UTC
@tommygebru How do I do that? I'm not sure.
Chris
@Aoxom
Jan 15 2016 00:56 UTC
@LisaRamos this quote helped me with that checkpoint
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:57 UTC
@LisaRamos you need to access each array, loop contacts then filter each contacts to search for the properties and strings
tommy
@tommygebru
Jan 15 2016 00:57 UTC
@LisaRamos I am asking because i want to know what you are trying to do
Tim R
@amenshamen
Jan 15 2016 00:57 UTC
@kunalg1 sure - Whats your question? ;)
tommy
@tommygebru
Jan 15 2016 00:58 UTC
@LisaRamos
also I am sure this
return "value";//does nothing
Kunal
@kunalg1
Jan 15 2016 00:58 UTC
@amenshamen , well the code works for two tests, but other two tests fail
CompGeekGirl
@LisaRamos
Jan 15 2016 00:58 UTC

@lmalvaran I don't understand. :worried: @tommygebru This is what I was trying to do.

//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intruiging Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    },
];


function lookUp(firstName, prop){
// Only change code below this line
  if (firstName, prop === true) {
    return "value";
  }
  if (firstName !== prop in contacts) {
    return "No such contact";
  }
  if (prop !== false) {
    return "No such property";
  }
// Only change code above this line
}

// Change these values to test your function
lookUp("Akira", "likes");

http://www.freecodecamp.com/challenges/checkpoint-profile-lookup#?solution=%2F%2FSetup%0Avar%20contacts%20%3D%20%5B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Akira%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Laine%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%220543236543%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Pizza%22%2C%20%22Coding%22%2C%20%22Brownie%20Points%22%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Harry%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Potter%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%220994372684%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Hogwarts%22%2C%20%22Magic%22%2C%20%22Hagrid%22%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Sherlock%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Holmes%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%220487345643%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Intruiging%20Cases%22%2C%20%22Violin%22%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Kristian%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Vos%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%22unknown%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Javascript%22%2C%20%22Gaming%22%2C%20%22Foxes%22%5D%0A%20%20%20%20%7D%2C%0A%5D%3B%0A%0A%0Afunction%20lookUp(firstName%2C%20prop)%7B%0A%2F%2F%20Only%20change%20code%20below%20this%20line%0A%20%20if%20(firstName%2C%20prop%20%3D%3D%3D%20true)%20%7B%0A%20%20%20%20return%20%22value%22%3B%0A%20%20%7D%0A%20%20if%20(firstName%20!%3D%3D%20prop%20in%20contacts)%20%7B%0A%20%20%20%20return%20%22No%20such%20contact%22%3B%0A%20%20%7D%0A%20%20if%20(prop%20!%3D%3D%20false)%20%7B%0A%20%20%20%20return%20%22No%20such%20property%22%3B%0A%20%20%7D%0A%2F%2F%20Only%20change%20code%20above%20this%20line%0A%7D%0A%0A%2F%2F%20Change%20these%20values%20to%20test%20your%20function%0AlookUp(%22Akira%22%2C%20%22likes%22)%3B%0A

Tim R
@amenshamen
Jan 15 2016 00:59 UTC
Well you have to show us your code in order to get help
Kunal
@kunalg1
Jan 15 2016 00:59 UTC

@amenshamen here is my code:

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

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(queue([testArr], 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 01:00 UTC
@LisaRamos use a for loop
CompGeekGirl
@LisaRamos
Jan 15 2016 01:00 UTC
@amenshamen Here's my code.
//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intruiging Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    },
];


function lookUp(firstName, prop){
// Only change code below this line
  if (firstName, prop === true) {
    return "value";
  }
  if (firstName !== prop in contacts) {
    return "No such contact";
  }
  if (prop !== false) {
    return "No such property";
  }
// Only change code above this line
}

// Change these values to test your function
lookUp("Akira", "likes");
tommy
@tommygebru
Jan 15 2016 01:00 UTC
@LisaRamos
please only this is necessary :smile:
function lookUp(firstName, prop){
// Only change code below this line
  if (firstName, prop === true) {
    return "value";
  }
  if (firstName !== prop in contacts) {
    return "No such contact";
  }
  if (prop !== false) {
    return "No such property";
  }
// Only change code above this line
}
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 01:00 UTC
@LisaRamos and for each iteration check for the firstname and property value
Chris
@Aoxom
Jan 15 2016 01:00 UTC
@LisaRamos if (firstName, prop === true) { return "value"; } is saying if "Akira", "likes" === true, return the string "value" which is not what you want im sure :)
CompGeekGirl
@LisaRamos
Jan 15 2016 01:01 UTC
@Aoxom The instructions are a bit confusing but how do I change what you mentioned around?
Chris
@Aoxom
Jan 15 2016 01:02 UTC
@LisaRamos what really helped me earlier with that checkpoint was the pseudo code i quoted earlier
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 01:02 UTC
@LisaRamos the function is about checking if the contact exist and showing the value of the properties
Chris
@Aoxom
Jan 15 2016 01:02 UTC
@LisaRamos Loop through each contact (for loop)
if firstName == object.firstName
check properties (Hint: .hasOwnProperty() is helpful here)
Yes - return object[prop]
No - “No such property"
Else all contacts searched and no contact match found (outside for loop)
return “No such contact"
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 01:03 UTC
@LisaRamos if(firstname exist) then check properties else no such contact, then if (properties exist) show value else "no such property". this would be your pseudo code in your loop.
Tim R
@amenshamen
Jan 15 2016 01:04 UTC
@kunalg1 You are returning the item which you just added - They want you to return the item which you are removing from the queue.
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 01:04 UTC
@LisaRamos first thing to do is to make a loop to iterate in your contacts array.. this could be for in loop or for(var i....) loop
Kunal
@kunalg1
Jan 15 2016 01:05 UTC
oh
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 01:05 UTC
@LisaRamos i prefer to use the for in loop..
for(var person in contacts){....}
Kunal
@kunalg1
Jan 15 2016 01:07 UTC
@amenshamen I am not able to do this, could you please help me, if I return arr.shift(), it still gives me error
Chris
@Aoxom
Jan 15 2016 01:08 UTC
@LisaRamos oh sorry i just realized you were asking me to help you make sense of the pseudocode, and all i did was re-link it, lol
tommy
@tommygebru
Jan 15 2016 01:10 UTC
@kunalg1 is this the Waypoint: Stand in Line
Kunal
@kunalg1
Jan 15 2016 01:11 UTC
@tommygebru yes this is
Tim R
@amenshamen
Jan 15 2016 01:11 UTC
@kunalg1 You just have to combine your second and third line. I did what you said you just did with your code and its working ;)
David Biedenbender
@CodeDavidB
Jan 15 2016 01:11 UTC
so anyone know how to set the remainder equal to the remainder of 11 divided by 3 using the remainder operator (%)?
Tim R
@amenshamen
Jan 15 2016 01:11 UTC
show me your new code
@kunalg1
Kunal
@kunalg1
Jan 15 2016 01:12 UTC

@amenshamen @tommygebru
my updated code:

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

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(queue(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

tommy
@tommygebru
Jan 15 2016 01:12 UTC
@CodeDavidB whats the waypoint?
David Biedenbender
@CodeDavidB
Jan 15 2016 01:13 UTC
finding the remainder in javascript
tommy
@tommygebru
Jan 15 2016 01:13 UTC
@kunalg1
arr.shift(); is called twice therefore it gives a different answer
Tim R
@amenshamen
Jan 15 2016 01:13 UTC
@kunalg1 you just have one line too much. You are first removing one element now and then removing another element and returning this one.
tommy
@tommygebru
Jan 15 2016 01:14 UTC
@amenshamen :+1:
David Biedenbender
@CodeDavidB
Jan 15 2016 01:14 UTC
im not clear on the instructions or just dont get the question...
Kunal
@kunalg1
Jan 15 2016 01:14 UTC
ok let me try just returning arr.shift();
CompGeekGirl
@LisaRamos
Jan 15 2016 01:14 UTC
@Aoxom Can you requote that again using the backticks please? I'm quite confused.
Kunal
@kunalg1
Jan 15 2016 01:14 UTC
nope

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

return arr.shift();
}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(queue(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

tommy
@tommygebru
Jan 15 2016 01:15 UTC
@CodeDavidB show what you have tried :smile:
David Biedenbender
@CodeDavidB
Jan 15 2016 01:16 UTC
im not really sure how to proceed.. i tryed doing 11% 3 = but i dont know where to go with it
tommy
@tommygebru
Jan 15 2016 01:16 UTC
@kunalg1 you understand the concept now therefore reset the code and try again :smile:
Kunal
@kunalg1
Jan 15 2016 01:16 UTC
i did reset twice :worried:
tommy
@tommygebru
Jan 15 2016 01:16 UTC
@CodeDavidB The computer will do the math 11%3;
David Biedenbender
@CodeDavidB
Jan 15 2016 01:16 UTC
the answer to 11/3 is 3.667 but not sure how to show that
tommy
@tommygebru
Jan 15 2016 01:17 UTC
@kunalg1 now type in the code again
Tim R
@amenshamen
Jan 15 2016 01:17 UTC
@kunalg1 Your code is 100% correct :O
Kunal
@kunalg1
Jan 15 2016 01:18 UTC
dunno what happened, lol
i think there was a glitch on my side
tommy
@tommygebru
Jan 15 2016 01:18 UTC
@amenshamen the computer needs to be reset on that specific Waypoint!
Tim R
@amenshamen
Jan 15 2016 01:18 UTC
@kunalg1 so it works now?
lenaecb
@lenaecb
Jan 15 2016 01:18 UTC
anyone have trouble with the increment a number wit JS lesson?
Kunal
@kunalg1
Jan 15 2016 01:18 UTC
thanks guys @amenshamen @tommygebru
CamperBot
@camperbot
Jan 15 2016 01:18 UTC
kunalg1 sends brownie points to @amenshamen and @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 266 | @amenshamen | http://www.freecodecamp.com/amenshamen
:star: 333 | @tommygebru | http://www.freecodecamp.com/tommygebru
lenaecb
@lenaecb
Jan 15 2016 01:18 UTC
i can't get it to return what i need
tommy
@tommygebru
Jan 15 2016 01:18 UTC
@kunalg1 nice
@lenaecb share the Waypoint name and link please
it's probably user error (me)
but i can't get it to 88 with my var myVar i++;
David Biedenbender
@CodeDavidB
Jan 15 2016 01:21 UTC
@lenaecb think you leave out the i
tommy
@tommygebru
Jan 15 2016 01:21 UTC
@lenaecb
to call i you should have given it a value first :smile:
also we are reassigning the declared variable to take on a new value
and using increment operator
http://www.w3schools.com/js/js_operators.asp
CompGeekGirl
@LisaRamos
Jan 15 2016 01:23 UTC

I'm having trouble with CP 98 still. http://www.freecodecamp.com/challenges/checkpoint-profile-lookup#?solution=%2F%2FSetup%0Avar%20contacts%20%3D%20%5B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Akira%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Laine%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%220543236543%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Pizza%22%2C%20%22Coding%22%2C%20%22Brownie%20Points%22%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Harry%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Potter%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%220994372684%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Hogwarts%22%2C%20%22Magic%22%2C%20%22Hagrid%22%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Sherlock%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Holmes%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%220487345643%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Intruiging%20Cases%22%2C%20%22Violin%22%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Kristian%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Vos%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%22unknown%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Javascript%22%2C%20%22Gaming%22%2C%20%22Foxes%22%5D%0A%20%20%20%20%7D%2C%0A%5D%3B%0A%0A%0Afunction%20lookUp(firstName%2C%20prop)%7B%0A%2F%2F%20Only%20change%20code%20below%20this%20line%0A%20%20if%20(firstName%2C%20prop%20%3D%3D%3D%20true)%20%7B%0A%20%20%20%20return%20%22value%22%3B%0A%20%20%7D%0A%20%20if%20(firstName%20!%3D%3D%20prop%20in%20contacts)%20%7B%0A%20%20%20%20return%20%22No%20such%20contact%22%3B%0A%20%20%7D%0A%20%20if%20(prop%20!%3D%3D%20false)%20%7B%0A%20%20%20%20return%20%22No%20such%20property%22%3B%0A%20%20%7D%0A%2F%2F%20Only%20change%20code%20above%20this%20line%0A%7D%0A%0A%2F%2F%20Change%20these%20values%20to%20test%20your%20function%0AlookUp(%22Akira%22%2C%20%22likes%22)%3B%0A

I don't know what I'm doing here as far as the instructions and suggestions go.

//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intruiging Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    },
];


function lookUp(firstName, prop){
// Only change code below this line
  if (firstName, prop === true) {
    return "value";
  }
  if (firstName !== prop in contacts) {
    return "No such contact";
  }
  if (prop !== false) {
    return "No such property";
  }
// Only change code above this line
}

// Change these values to test your function
lookUp("Akira", "likes");

Can anyone suggest what I could do here?

lenaecb
@lenaecb
Jan 15 2016 01:24 UTC
Screen Shot 2016-01-14 at 8.23.51 PM.png
@tommygebru like above?
tommy
@tommygebru
Jan 15 2016 01:24 UTC
@LisaRamos this seems difficult
you are using things I havent encountered yet in FCC...
@lenaecb sorry remove i altogether
CompGeekGirl
@LisaRamos
Jan 15 2016 01:25 UTC
@tommygebru I know. I was trying to follow the instructions but nothing works. Is it the exercise or is it me?
lenaecb
@lenaecb
Jan 15 2016 01:26 UTC
@tommygebru - so when i just do - var myVar ++; it still isn't giving me 88
CompGeekGirl
@LisaRamos
Jan 15 2016 01:26 UTC
@tommygebru It's a new exercise. Anyway, how am I going to solve this thing?
//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intruiging Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    },
];


function lookUp(firstName, prop){
// Only change code below this line
  if (firstName, prop === true) {
    return "value";
  }
  if (firstName !== prop in contacts) {
    return "No such contact";
  }
  if (prop !== false) {
    return "No such property";
  }
// Only change code above this line
}

// Change these values to test your function
lookUp("Akira", "likes");
tommy
@tommygebru
Jan 15 2016 01:27 UTC
@LisaRamos well I assume
that the first if has two conditions correct? and return "value" should return what is true?
CompGeekGirl
@LisaRamos
Jan 15 2016 01:27 UTC
@tommygebru Could you give me an example if you don't mind?
tommy
@tommygebru
Jan 15 2016 01:30 UTC
This message was deleted
lenaecb
@lenaecb
Jan 15 2016 01:30 UTC
@tommygebru go it :)
tommy
@tommygebru
Jan 15 2016 01:30 UTC
@lenaecb nice :+1:
chantaldesiree
@chantaldesiree
Jan 15 2016 01:30 UTC
I'm having an issue with the output window on the lefthand side of FCC, it's showing every break character (\") and is just flowing the text. Is there a way to reset it back to how it was before?
CompGeekGirl
@LisaRamos
Jan 15 2016 01:31 UTC
@tommygebru How do I explain the first if statement?
tommy
@tommygebru
Jan 15 2016 01:31 UTC
@chantaldesiree I think that is how it is supposed to behave
chantaldesiree
@chantaldesiree
Jan 15 2016 01:31 UTC
Really? It's never looked like that before.
tommy
@tommygebru
Jan 15 2016 01:32 UTC
@LisaRamos i only mean what does the comma mean or true ? within the parantheses?
Brian
@BWColley
Jan 15 2016 01:32 UTC

first time in the chat- Hello World! I'm stuck on WP12, JS increment. My code is : var myVar = 87;

// Only change code below this line
myVar = myVar++;

tommy
@tommygebru
Jan 15 2016 01:32 UTC
@chantaldesiree it will continue to look like that
@BWColley welcome
Brian
@BWColley
Jan 15 2016 01:32 UTC
but my outut remains 87
thanks tommy
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:32 UTC

Hi Everyone,
I really don't understand the below question. Can anybody help me please to elaborate the question?

You will write a card counting function. It will receive a card parameter and increment or decrement the global count variable according to the card's value (see table). The function will then return a string with the current count and the string "Bet" if the count is positive, or "Hold" if the count is zero or negative. The current count and the player's decision ("Bet" or "Hold") should be separated by a single space.

Example Output
"-3 Hold"
"5 Bet"

tommy
@tommygebru
Jan 15 2016 01:33 UTC
@BWColley remove myVar=
Tim R
@amenshamen
Jan 15 2016 01:34 UTC
@BWColley myVar++; is the same as myVar = myVar +1;
Brian
@BWColley
Jan 15 2016 01:34 UTC
ahhh, ok, THANKS!
tommy
@tommygebru
Jan 15 2016 01:34 UTC
@HaroonGhawsi there should be an example of how your code needs to be structured in the introduction/ instructions
@BWColley nice :+1:
@LisaRamos lets talk in a private chat
Danielle Cordoba
@dcordoba1
Jan 15 2016 01:38 UTC
hey guys! im having some trouble with my javascript
aitruong
@aitruong
Jan 15 2016 01:38 UTC
how to return multiple values of an object?
Here is my code:

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"
};

for(var key in lookup){
result = lookup[key];
return result;
}

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

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

it only return 1 value
Tim R
@amenshamen
Jan 15 2016 01:39 UTC
@aitruong Link to the Waypoint please :)
@dcordoba1 which sort of trouble? ;)
Danielle Cordoba
@dcordoba1
Jan 15 2016 01:39 UTC
im having issues with converting celsius to fehrenheit
tommy
@tommygebru
Jan 15 2016 01:39 UTC
@aitruong Remember what your parameter is
Danielle Cordoba
@dcordoba1
Jan 15 2016 01:39 UTC
my code is right but i feel like its being put in the wrong place
aitruong
@aitruong
Jan 15 2016 01:40 UTC
@tommygebru : it it val
CompGeekGirl
@LisaRamos
Jan 15 2016 01:40 UTC
@tommygebru How do we do that?
tommy
@tommygebru
Jan 15 2016 01:40 UTC
@aitruong where is your other val
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:40 UTC

@tommygebru The value are as below

Value Cards
+1 2, 3, 4, 5, 6
0 7, 8, 9
-1 10, 'J', 'Q', 'K','A'

tommy
@tommygebru
Jan 15 2016 01:40 UTC
@tommygebru underneath your profile you have the option of joining a room like FreeCodeCamp/Help
CompGeekGirl
@LisaRamos
Jan 15 2016 01:41 UTC
@tommygebru I put the comma within the parenthesis.
tommy
@tommygebru
Jan 15 2016 01:41 UTC
aitruong
@aitruong
Jan 15 2016 01:42 UTC
how to return multiple values from one object?
within a function
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:43 UTC
blob
@tommygebru
tommy
@tommygebru
Jan 15 2016 01:44 UTC
@LisaRamos lets talk pm
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:44 UTC
@tommygebru Ok
cannelflow
@cannelflow
Jan 15 2016 01:44 UTC
@HaroonGhawsi ?
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:44 UTC
Thanks
Stephen Fox
@stevemasta34
Jan 15 2016 01:44 UTC
in the jQuery segment, the "Change Text Inside an Element" assignment isn't passing when it should
Is there a specific code implementation it's looking for?
tommy
@tommygebru
Jan 15 2016 01:45 UTC
@aitruong for var key in lookup should be removed there is already a function called
phoneticLookup();
cannelflow
@cannelflow
Jan 15 2016 01:45 UTC
@stevemasta34 code?
Tim R
@amenshamen
Jan 15 2016 01:45 UTC
@dcordoba1 Well show us your code so we can check if its really right ;)
tommy
@tommygebru
Jan 15 2016 01:45 UTC
@cannelflow reinforcements!
Stephen Fox
@stevemasta34
Jan 15 2016 01:46 UTC
nvm, found it
cannelflow
@cannelflow
Jan 15 2016 01:46 UTC
@tommygebru :+1:
Stephen Fox
@stevemasta34
Jan 15 2016 01:46 UTC
@cannelflow it wanted me to use <i> tags instead of <em> tags
cannelflow
@cannelflow
Jan 15 2016 01:49 UTC
@stevemasta34 yes you have to use i tag http://www.w3schools.com/tags/tag_i.asp
Jeannie Stevenson
@JSDesign
Jan 15 2016 01:50 UTC
hello i'm looking for some help with Checkpoint: Profile Lookup
this is my code - i would love it if someone can explain why this isn't working?
function lookUp(firstName, prop){
// Only change code below this line
  for (var i = 0; i < contacts.length(); i++) {
    if (firstName === contacts[i].firstName) {
      if (contacts[i].hasOwnProperty(prop)) {
        return contacts[i].prop;
      } else {
        return 'No such property';
      }
    } else {
      return 'No such contact';
    }
  }
// Only change code above this line
}
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:52 UTC
blob
@tommygebru How to include the count variable within the Switch statement values?
Zina Astafyeva
@tragetraje
Jan 15 2016 01:52 UTC
Hi all! Please help me with the WP#78, it's taking way too long to solve it!!

var count = 0;

function cc(card) {
// Only change code below this line
if (card >= 2 && card <= 6) {
return count += 1;
} else if (card >= 7 && card <=9) {
return count +=0;
} else {
return count -=1;
}

if (count > 0) {
return count + " Bet";
}
else {
return count + " Hold";}

cannelflow
@cannelflow
Jan 15 2016 01:52 UTC
@HaroonGhawsi do lihe case: case: case then at last count++
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:53 UTC
@cannelflow Ooh ok
thanks
tommy
@tommygebru
Jan 15 2016 01:53 UTC
@HaroonGhawsi nice :+1:
Zina Astafyeva
@tragetraje
Jan 15 2016 01:53 UTC
Is the switch statement the only way to solve it?
cannelflow
@cannelflow
Jan 15 2016 01:53 UTC
@tragetraje you havr to return count+++" Hold" see instruction
Jeannie Stevenson
@JSDesign
Jan 15 2016 01:53 UTC
or even just a hit of where i'm going wrong so i can do research
Zina Astafyeva
@tragetraje
Jan 15 2016 01:54 UTC
I was thinking I can approach it with if/else...
cannelflow
@cannelflow
Jan 15 2016 01:54 UTC
@tragetraje yes you can
tommy
@tommygebru
Jan 15 2016 01:54 UTC
@tragetraje please reread the instructions you are suppose to use a switch statement
like the previous lesson :smile:
http://www.freecodecamp.com/challenges/checkpoint-counting-cards
Zina Astafyeva
@tragetraje
Jan 15 2016 01:54 UTC
@cannelflow Thanks, but what instruction you mean?
CamperBot
@camperbot
Jan 15 2016 01:54 UTC
tragetraje sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 407 | @cannelflow | http://www.freecodecamp.com/cannelflow
cannelflow
@cannelflow
Jan 15 2016 01:55 UTC
@tragetraje Example Output
"-3 Hold"
"5 Bet"
@tragetraje you are only counting
Jeannie Stevenson
@JSDesign
Jan 15 2016 01:56 UTC
has anyone here completed Checkpoint: Profile Lookup ?
Zina Astafyeva
@tragetraje
Jan 15 2016 01:56 UTC
@cannelflow yes, that's where I stuck, I'm counting but can't figure out how to do the summing..
Rodny
@neoprez
Jan 15 2016 01:56 UTC
Can you type the goal of the problem? Im not there yet
the instructions
Zina Astafyeva
@tragetraje
Jan 15 2016 01:57 UTC
thanks @tommygebru, I see
CamperBot
@camperbot
Jan 15 2016 01:57 UTC
tragetraje sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 335 | @tommygebru | http://www.freecodecamp.com/tommygebru
cannelflow
@cannelflow
Jan 15 2016 01:57 UTC
@tragetraje do concat like count++ + " Hold"
Jeannie Stevenson
@JSDesign
Jan 15 2016 01:58 UTC
@neoprez are you asking me?
cannelflow
@cannelflow
Jan 15 2016 01:58 UTC
@neoprez its good to mention ppl in comment :smile:
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:59 UTC
@tommygebru This what I have done so far but not able to solve it.
blob
Rodny
@neoprez
Jan 15 2016 01:59 UTC
my bad @JSDesign. Thanks @cannelflow . The message was for @tragetraje
CamperBot
@camperbot
Jan 15 2016 01:59 UTC
neoprez sends brownie points to @jsdesign and @cannelflow and @tragetraje :sparkles: :thumbsup: :sparkles:
:star: 408 | @cannelflow | http://www.freecodecamp.com/cannelflow
:star: 226 | @jsdesign | http://www.freecodecamp.com/jsdesign
:star: 205 | @tragetraje | http://www.freecodecamp.com/tragetraje
Jeannie Stevenson
@JSDesign
Jan 15 2016 01:59 UTC
@neoprez cool np :)
cannelflow
@cannelflow
Jan 15 2016 01:59 UTC
@neoprez :+1:
tommy
@tommygebru
Jan 15 2016 02:00 UTC
@HaroonGhawsi try again
http://www.freecodecamp.com/challenges/waypoint-multiple-identical-options-in-switch-statements
also there are errors in your code editor they will help you solve simple issues with hints
Rodny
@neoprez
Jan 15 2016 02:00 UTC
thanks @tommygebru
CamperBot
@camperbot
Jan 15 2016 02:00 UTC
neoprez sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 336 | @tommygebru | http://www.freecodecamp.com/tommygebru
cannelflow
@cannelflow
Jan 15 2016 02:01 UTC
@HaroonGhawsi try pointing curser at yello triangle it will say what is error
tommy
@tommygebru
Jan 15 2016 02:01 UTC
@neoprez :+1:
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 02:03 UTC
@cannelflow it says unreable break after return
@cannelflow I don't whats that.
know*
cannelflow
@cannelflow
Jan 15 2016 02:05 UTC
@HaroonGhawsi ok your code is ended its execution when you wrote return there is no need for break
Clark Arnold
@clarkarnold
Jan 15 2016 02:05 UTC
@JSDesign I am on that checkpoint as well..
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 02:06 UTC
@cannelflow Ok, thanks
CamperBot
@camperbot
Jan 15 2016 02:06 UTC
haroonghawsi sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 409 | @cannelflow | http://www.freecodecamp.com/cannelflow
Jeannie Stevenson
@JSDesign
Jan 15 2016 02:06 UTC
@clarkarnold i found this and trying to make it help me ;) http://stackoverflow.com/questions/34798132/profile-lookup-on-freecode-camp-checkpoint
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 02:08 UTC
@cannelflow got it thanks
CamperBot
@camperbot
Jan 15 2016 02:08 UTC
haroonghawsi sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:warning: haroonghawsi already gave cannelflow points
Jon Spencer
@batboy138
Jan 15 2016 02:11 UTC
function checkObj(checkProp) {
  // Your Code Here
  if (myObj.hasOwnProperty(checkProp)){
    return checkProp; 
  }
  else {
    return false; 
  }
}
I know I need to return the property, but I'm having trouble doing it.
latexcode?latexcode?
Don't ask why I did that.
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:13 UTC
@batboy138 is myObj existing?
Jon Spencer
@batboy138
Jan 15 2016 02:14 UTC
Yes.
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:14 UTC
can you show me the task please?
Andrew Charlebois
@andrewchar
Jan 15 2016 02:14 UTC
<button type="submit"><i class="btn btn-primary fa fa-paper-plane"></i> Submit</button>
</form> is this written correctly?
Jon Spencer
@batboy138
Jan 15 2016 02:14 UTC
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

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

// Test your code by modifying these values
checkObj("gift");
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:16 UTC
@batboy138 what does it exactly asks to return?
John Cerpa
@johncerpa
Jan 15 2016 02:16 UTC
This message was deleted
it should return
return "Change Me!";
Steven
@a00000a41
Jan 15 2016 02:17 UTC
Do not change code above the line what is means?
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:17 UTC
@batboy138 looking at the code, that is fine if you're just checking for the property..however may be the task is asking for other output
edburdett
@edburdett
Jan 15 2016 02:17 UTC
What is wrong here???
function myFunction(c, d){
console.log(c + d);
}
myFunction(3, 4);
Andrew Charlebois
@andrewchar
Jan 15 2016 02:18 UTC
how do i post the code like batboy just did
John Cerpa
@johncerpa
Jan 15 2016 02:18 UTC
erase the else statement
hmm n
no
Wesley Robertson
@adoptedmanatee
Jan 15 2016 02:19 UTC
I am a little stuck on Checkpoint: Stand in Line
John Cerpa
@johncerpa
Jan 15 2016 02:19 UTC
the else statement should be there
but it should return "Not found";
and if the property is found
return the property
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:20 UTC
@edburdett what does the task asks you to do?
edburdett
@edburdett
Jan 15 2016 02:20 UTC
Create a function myFunction that takes two arguments and outputs their sum
aitruong
@aitruong
Jan 15 2016 02:21 UTC
@HaroonGhawsi did you get answer?
edburdett
@edburdett
Jan 15 2016 02:21 UTC
myFunction(1,2) should output 3
John Cerpa
@johncerpa
Jan 15 2016 02:21 UTC
function checkObj(checkProp) {
  // Your Code Here
  if (myObj.hasOwnProperty(checkProp)) {

    return myObj[checkProp];

  } else {

    return "Not Found";

  }

}
result = a + b;
Wesley Robertson
@adoptedmanatee
Jan 15 2016 02:22 UTC
@edburdett code looks good to me
Rae
@cs-knight
Jan 15 2016 02:22 UTC
trying to change div element color
Kevin Rodriguez
@kevin2r
Jan 15 2016 02:22 UTC
can you help me with "Bonfire: Truncate a string", i don't understand very well the question
CamperBot
@camperbot
Jan 15 2016 02:22 UTC
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Luciano
@StrikingLoo
Jan 15 2016 02:22 UTC
This message was deleted
Rae
@cs-knight
Jan 15 2016 02:22 UTC

  .gray-background {
    background-color: gray;
  }
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:23 UTC
@edburdett should output 3 as in log or return 3? it could be console.log(c+d) however it could be return c+d;
John Cerpa
@johncerpa
Jan 15 2016 02:23 UTC
grey
use the class
edburdett
@edburdett
Jan 15 2016 02:23 UTC
@adoptedmanatee it looks fine to me to, but it's not passing
Luciano
@StrikingLoo
Jan 15 2016 02:23 UTC
Hi guys! I am at the javascript tutorial, checkpoint 'record collection' and I can't get the track adding part done
would anyone send me that part of the function?
Wesley Robertson
@adoptedmanatee
Jan 15 2016 02:24 UTC
@edburdett i agree with @lmalvaran, it may depend on whats being asked..return the output instead maybe
Andrew Charlebois
@andrewchar
Jan 15 2016 02:24 UTC
var code = "formatted";
whoops
trying to figure out how to post the code
John Cerpa
@johncerpa
Jan 15 2016 02:24 UTC
@StrikingLoo ```
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 collection;
}
explain format
CamperBot
@camperbot
Jan 15 2016 02:24 UTC

: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

edburdett
@edburdett
Jan 15 2016 02:25 UTC
@lmalvaran example shows console.log and instructions say output to dev console. Tried return just in case but nothing is working
Rae
@cs-knight
Jan 15 2016 02:25 UTC
hmm still not gray
<div class="gray-background">
Alvis Ng
@vizFlux
Jan 15 2016 02:26 UTC
This message was deleted
Wesley Robertson
@adoptedmanatee
Jan 15 2016 02:26 UTC
@edburdett what WP is it
cannelflow
@cannelflow
Jan 15 2016 02:26 UTC
@kevin2r did you worked it out?
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:26 UTC
@edburdett can you post the complete challenge please
edburdett
@edburdett
Jan 15 2016 02:27 UTC
Passing values to functions with arguments
cannelflow
@cannelflow
Jan 15 2016 02:28 UTC
@csrae in style for class grey backgroud you have to give background-color:grey
Andrew Charlebois
@andrewchar
Jan 15 2016 02:28 UTC

```
function add(first, second) {
return first+second;
}

alert ( add ( 1.2) );
js

Kevin Rodriguez
@kevin2r
Jan 15 2016 02:29 UTC
@cannelflow I'm trying to understand the question before, but ....
@cannelflow If the num is less than or equal to 3, then the length of the three dots is not added to the string length.
@cannelflow truncate("A-", 1) should return "A...".
Wesley Robertson
@adoptedmanatee
Jan 15 2016 02:30 UTC
@edburdett umm..syntax should work. Maybe try passing them as a and b instead of c and d
Andrew Charlebois
@andrewchar
Jan 15 2016 02:31 UTC
function add(first, second) {
  return first+second;
}

alert ( add ( 1.2) );
function add(first, second) {
  return first+second;
}

alert ( add ( 1,2) );
Luciano
@StrikingLoo
Jan 15 2016 02:31 UTC
@johncerpa do you know what problem I'm talking about? How did you solve it? Also, how do you see someone else's code? first time using this
Andrew Charlebois
@andrewchar
Jan 15 2016 02:32 UTC
first one had an error
cannelflow
@cannelflow
Jan 15 2016 02:32 UTC
@kevin2r which ex?
edburdett
@edburdett
Jan 15 2016 02:33 UTC
@adoptedmanatee tried that too
Andrew Charlebois
@andrewchar
Jan 15 2016 02:33 UTC
im having a problem with Waypoint: Style Text Inputs as Form Controls
Kevin Rodriguez
@kevin2r
Jan 15 2016 02:33 UTC
@cannelflow Bonfire: Truncate a string
ALINATSUI
@ALINATSUI
Jan 15 2016 02:33 UTC
@kodinglife I got the answer already....
Andrew Charlebois
@andrewchar
Jan 15 2016 02:33 UTC
it wants me to do this: (Give the submit button in your form the classes btn btn-primary.)
<button class="btn-btn-primary" type="submit"><i class="btn-btn-primary fa fa-paper-plane">Submit</i></button>
Wesley Robertson
@adoptedmanatee
Jan 15 2016 02:34 UTC
@edburdett you may have to then just come back to that one. I was trying to submit for one of the checkpoints and it was not accepting it. Only to just retry it and it took it..might just be server issue
Kevin Rodriguez
@kevin2r
Jan 15 2016 02:34 UTC
@cannelflow I think that i'm getting close
cannelflow
@cannelflow
Jan 15 2016 02:34 UTC
@kevin2r can you show your code
edburdett
@edburdett
Jan 15 2016 02:34 UTC
@adoptedmanatee that's where my thoughts were going
allenlao26
@allenlao26
Jan 15 2016 02:34 UTC
@andrewchar you have an extra hypen
Rae
@cs-knight
Jan 15 2016 02:34 UTC
@cannelflow yes i added it to style
ALINATSUI
@ALINATSUI
Jan 15 2016 02:35 UTC
Stuck on waypoint: testing objects for properties....
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here
  if (myObj.hasOwnProperty() === true) {
    return // how to return property value?
  } 

  else {
    return "Not Found";
  }
}

// Test your code by modifying these values
checkObj("gift");
checkObj("pet");
checkObj("house");
Kevin Rodriguez
@kevin2r
Jan 15 2016 02:35 UTC
@cannelflow I'm starting to write it
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:35 UTC
@andrewchar do you really have to include the class btn-btn-primary in your <i element?
Jon Spencer
@batboy138
Jan 15 2016 02:35 UTC
@andrewchar First you type three of these then you use shift+enter then you put the code between thes
"```"
ian
@ianothere
Jan 15 2016 02:35 UTC
stuck on checkpoint: stand in line
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:36 UTC
@andrewchar also if you are assigning 2 classes or multiple class in an element it should be like this <element class="class1 class2> not <element class="class1-class2">
Andrew Charlebois
@andrewchar
Jan 15 2016 02:36 UTC
just noticed but even now dont work
<button class="btn-btn-primary" type="submit"><i class="fa fa-paper-plane">Submit</i></button>
ian
@ianothere
Jan 15 2016 02:36 UTC
trying to make sense of it at the moment
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:36 UTC
@andrewchar look at your button class
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:36 UTC
@ALINATSUI myObj.hasOwnProperty() <--- you need the property inside the () to check for
cannelflow
@cannelflow
Jan 15 2016 02:37 UTC
@andrewchar ?
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:37 UTC
@andrewchar i think it should be class="btn btn-primary" not class="btn-btn-primary".
ALINATSUI
@ALINATSUI
Jan 15 2016 02:37 UTC
@alexanderkopke Well, that's part of the problem, there's 3 properties to test for...How to set it up with a for loop, or should I use a switch statement?
Andrew Charlebois
@andrewchar
Jan 15 2016 02:37 UTC
omg
lol
cannelflow
@cannelflow
Jan 15 2016 02:37 UTC
@andrewchar class="btn btn-primary"
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:38 UTC
@ALINATSUI you have the checkProp variable
allenlao26
@allenlao26
Jan 15 2016 02:38 UTC
stuck on waypoint: using objects for lookups
Luciano
@StrikingLoo
Jan 15 2016 02:38 UTC
can anyone tell me how they solved checkpoint:record collection?
allenlao26
@allenlao26
Jan 15 2016 02:38 UTC

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

// Only change code below this line
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("charlie");

Andrew Charlebois
@andrewchar
Jan 15 2016 02:38 UTC
thanks haha. maybe its time for a break
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:38 UTC
@ALINATSUI to check for property it should be obj.hasOwnProperty(propertyName) it returns true if exists and false otherwise
ALINATSUI
@ALINATSUI
Jan 15 2016 02:39 UTC
@alexanderkopke So something like
if (myObj.hasOwnProperty('checkProp') === true) {
John Cerpa
@johncerpa
Jan 15 2016 02:39 UTC
no
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:39 UTC
@ALINATSUI yes but without quotes
John Cerpa
@johncerpa
Jan 15 2016 02:39 UTC
exactly
and
the true is useless
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:39 UTC
if you use string you're just passing a string
ALINATSUI
@ALINATSUI
Jan 15 2016 02:40 UTC
@alexanderkopke ok, but another question, how do I get it to return the property value?
John Cerpa
@johncerpa
Jan 15 2016 02:40 UTC
hasOwnProperty checks true or false
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:40 UTC
@ALINATSUI shorter would if(obj.hasOwnProperty(prop))
edburdett
@edburdett
Jan 15 2016 02:40 UTC
reload page, code works. MAGIC!
John Cerpa
@johncerpa
Jan 15 2016 02:40 UTC
if (myObj.hasOwnProperty(checkProp)) {

}
ALINATSUI
@ALINATSUI
Jan 15 2016 02:40 UTC
@lmalvaran I think I tried that, but it didn't work...
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:41 UTC
@ALINATSUI check the code posted by @johncerpa
ALINATSUI
@ALINATSUI
Jan 15 2016 02:42 UTC
@lmalvaran When was it posted?
John Cerpa
@johncerpa
Jan 15 2016 02:42 UTC
is above
your comment
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:42 UTC
@ALINATSUI syntax is: object[property].... this will get the value of the property.. if the property exists
John Cerpa
@johncerpa
Jan 15 2016 02:42 UTC
if (myObj.hasOwnProperty(checkProp)) {
}
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:42 UTC
@ALINATSUI so in this example myObj is the object.. while checkProp variable is used as the property
ALINATSUI
@ALINATSUI
Jan 15 2016 02:43 UTC
oh there it goes...I've got the if clause written, but what about the second part (return)?
John Cerpa
@johncerpa
Jan 15 2016 02:43 UTC
return the property
like this
This message was deleted
return myObj[checkProp];
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:43 UTC
:+1:
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:44 UTC
if(myObj.hasOwnProperty(checkProp)){
   //do your code here
}
John Cerpa
@johncerpa
Jan 15 2016 02:44 UTC
:)
return should be inside the if statement
ALINATSUI
@ALINATSUI
Jan 15 2016 02:44 UTC
@johncerpa Thanks...I'm still trying to wrap my head around this concept...
CamperBot
@camperbot
Jan 15 2016 02:44 UTC
alinatsui sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
Jon Spencer
@batboy138
Jan 15 2016 02:44 UTC
@johncerpa Thanks!
CamperBot
@camperbot
Jan 15 2016 02:44 UTC
:star: 248 | @johncerpa | http://www.freecodecamp.com/johncerpa
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:45 UTC
did the sum primes today.. after finishing it I got the idea to hack the solution.. it worked hah xD
John Cerpa
@johncerpa
Jan 15 2016 02:45 UTC
good :)
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:45 UTC
function sumPrimes(num) {

  if(num == 10)
    {
      return 17;
    }
  if(num == 977)
    {
      return 73156;
    }

}
//  /\__/\
//->O <> O<-
//   \--/
sumPrimes(10);
Luciano
@StrikingLoo
Jan 15 2016 02:45 UTC
well found the solution to my problem, still not sure why my phrasing didnt work, but I solved it :P
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:45 UTC
I also made a cute cat there xD
John Cerpa
@johncerpa
Jan 15 2016 02:46 UTC
hahaha
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:48 UTC
well time to dance.. stay fresh! :)
Ryan
@ryanforever
Jan 15 2016 02:50 UTC
I have an issue with a very easy waypoint :)
in "Get Set for Ziplines" lol
The animation, and the directions, say it is possible to use GitHub credentials to get an account
But I can't find the "Use GitHub credentials" button on the site lol
I want to make sure they are linked...I am guessing this will save hassle later on.
Anek jain
@Anekjain
Jan 15 2016 02:53 UTC
var myStr = "<a href=\"http://www.example.com\" target=\"_blank\">Link</a>"; how to add two single quotes and four double quotes by removing backslashes . :P
how can i return all the value instead of the lastest value?
John Cerpa
@johncerpa
Jan 15 2016 02:55 UTC
use
return result = lookup[val];
Hoang The Cong
@HoangTheCong
Jan 15 2016 02:57 UTC
stuck on Checkpoint: Profile Lookup
John Cerpa
@johncerpa
Jan 15 2016 02:57 UTC
paste your code
Hoang The Cong
@HoangTheCong
Jan 15 2016 02:57 UTC
Here is my code for the first case
function lookUp(firstName, prop){
// Only change code below this line
for(var i =0;i<contacts.length;i++)
  {
    if(contacts[i].firstName == firstName&&contacts.hasOwnProperty(prop)===true)
      {
        return contacts[i][prop];
      }
  }
but it did not work
aitruong
@aitruong
Jan 15 2016 02:58 UTC
@johncerpa but val is an array?
Andrew Charlebois
@andrewchar
Jan 15 2016 02:59 UTC
in which order should i learn these... javascript & JQuery
John Cerpa
@johncerpa
Jan 15 2016 02:59 UTC
no
val is a property
Jared Bardell
@darthredskin
Jan 15 2016 02:59 UTC
Is anyone else's waypoints acted weird? Weird as in completing a challenge and clicking the "submit and go to my next challenge" button, it stays on that and won't move forward or acknowledge you've completed the challenge on the map.
acting**
Ryan
@ryanforever
Jan 15 2016 03:00 UTC
@HoangTheCong what does it return?
thorgall
@thorgall
Jan 15 2016 03:00 UTC
contacts[0] for example provides the keys and values from the first index in the array. And return contacts0 does not work as well. @HoangTheCong
JSampaioL
@JSampaioL
Jan 15 2016 03:00 UTC
Hi, technical question here: Is there a way to reset a challenge (going back to the original code) without loading the challenge page? I kinda-sorta broke a challenge, and now the page just keeps freezing
Hoang The Cong
@HoangTheCong
Jan 15 2016 03:00 UTC
it return dobule quoute ""
thorgall
@thorgall
Jan 15 2016 03:00 UTC
I had a similar code anyway
aitruong
@aitruong
Jan 15 2016 03:01 UTC
@johncerpa thank you. Fixed!
CamperBot
@camperbot
Jan 15 2016 03:01 UTC
aitruong sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
:star: 249 | @johncerpa | http://www.freecodecamp.com/johncerpa
Ryan
@ryanforever
Jan 15 2016 03:01 UTC
well prop isn't always just a value...it can be an array too
thorgall
@thorgall
Jan 15 2016 03:01 UTC
@JSampaioL if you are using chrome, try switching to firefox.
John Cerpa
@johncerpa
Jan 15 2016 03:01 UTC
good :)
matthew3454
@matthew3454
Jan 15 2016 03:01 UTC
I'm having trouble on Waypoint: Finding a Remainder in Javascript. Can someone please help me find the answer?
John Cerpa
@johncerpa
Jan 15 2016 03:02 UTC
use modulus
operator
JSampaioL
@JSampaioL
Jan 15 2016 03:02 UTC
@thorgall I am, and I will
John Cerpa
@johncerpa
Jan 15 2016 03:02 UTC
@matthew3454 % modulus operator
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:02 UTC
@matthew3454 return number%divisor;
John Cerpa
@johncerpa
Jan 15 2016 03:02 UTC
11 % 2 = 1
munozu
@munozu
Jan 15 2016 03:02 UTC
@JSampaioL had a similar issue... this fixed it https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Disable-Code-Auto-Run
John Cerpa
@johncerpa
Jan 15 2016 03:02 UTC
example
matthew3454
@matthew3454
Jan 15 2016 03:03 UTC
I'll try it @johncerpa
John Cerpa
@johncerpa
Jan 15 2016 03:03 UTC
paste the code if it fails
thorgall
@thorgall
Jan 15 2016 03:04 UTC
@JSampaioL had the same thing. It took me a while before I went: "heeeey, wait a minute..."
matthew3454
@matthew3454
Jan 15 2016 03:04 UTC
var remainder 11 % 3 = 2 @johncerpa
JSampaioL
@JSampaioL
Jan 15 2016 03:05 UTC
@munozu uh, awesome, worked like a charm. Thanks!
CamperBot
@camperbot
Jan 15 2016 03:05 UTC
jsampaiol sends brownie points to @munozu :sparkles: :thumbsup: :sparkles:
:star: 309 | @munozu | http://www.freecodecamp.com/munozu
John Cerpa
@johncerpa
Jan 15 2016 03:05 UTC
hmmn
munozu
@munozu
Jan 15 2016 03:05 UTC
np :smile:
John Cerpa
@johncerpa
Jan 15 2016 03:05 UTC
let the computer do the operation
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:05 UTC
@matthew3454 it should be something like this ```
var remainder = 11%2;
matthew3454
@matthew3454
Jan 15 2016 03:06 UTC
var remainder=11%2;
@lmalvaran
JSampaioL
@JSampaioL
Jan 15 2016 03:07 UTC
@thorgall this is what I get for writing things like for (var j = 0; j <= 13; j = (j*2+4)%14 ) :D
matthew3454
@matthew3454
Jan 15 2016 03:07 UTC
@lmalvaran it didn't seem to work.
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:08 UTC
@matthew3454 what exactly does the task says?
matthew3454
@matthew3454
Jan 15 2016 03:08 UTC
Set remainder equal to the remainder of 11 divided by 3 using the remainder (%) operator.
@lmalvaran
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:08 UTC
@matthew3454 var remainder = 11%3;
matthew3454
@matthew3454
Jan 15 2016 03:09 UTC
@lmalvaran Thank you!
CamperBot
@camperbot
Jan 15 2016 03:09 UTC
matthew3454 sends brownie points to @lmalvaran :sparkles: :thumbsup: :sparkles:
:star: 43 | @lmalvaran | http://www.freecodecamp.com/lmalvaran
matthew3454
@matthew3454
Jan 15 2016 03:09 UTC
what are brownie points?
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:09 UTC
you're welcome just remember modulo operator is used to determine the remainder or divisibility of a number
matthew3454
@matthew3454
Jan 15 2016 03:10 UTC
I will thanks @lmalvaran
CamperBot
@camperbot
Jan 15 2016 03:10 UTC
matthew3454 sends brownie points to @lmalvaran :sparkles: :thumbsup: :sparkles:
:warning: matthew3454 already gave lmalvaran points
Ryan
@ryanforever
Jan 15 2016 03:10 UTC
@HoangTheCong hey did you figure it out?
Wessd8
@wessd8
Jan 15 2016 03:10 UTC
@matthew3454 brownie points are basically streaat cred
Ryan
@ryanforever
Jan 15 2016 03:10 UTC
My advice was actually not the best advice, now that I have taken a closer look :)
matthew3454
@matthew3454
Jan 15 2016 03:11 UTC
Can I buy something with them or just a good reputation? @wessd8
Wessd8
@wessd8
Jan 15 2016 03:11 UTC
@matthew3454 just a good rep :)
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:12 UTC
Artur
@ArturMC
Jan 15 2016 03:12 UTC
@matthew3454 it's just how far you got into the program and how much you helped out in the chat
Wessd8
@wessd8
Jan 15 2016 03:12 UTC
here have one tak @matthew3454
CamperBot
@camperbot
Jan 15 2016 03:12 UTC
wessd8 sends brownie points to @matthew3454 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for matthew3454
Hoang The Cong
@HoangTheCong
Jan 15 2016 03:12 UTC
@ryanforever i'm not yet
Ryan
@ryanforever
Jan 15 2016 03:12 UTC
well your code looks at contacts as a whole to see if it has the prop
but i think you want to look at them one at a time
cannelflow
@cannelflow
Jan 15 2016 03:13 UTC
@ArturMC what is repo then
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:13 UTC
@HoangTheCong i think there's 3 situation in the problem and returning different output
Artur
@ArturMC
Jan 15 2016 03:14 UTC
@cannelflow repo's refer to your GitHub repositories
Jenni
@BookSprite
Jan 15 2016 03:14 UTC

I don't understand what "The div element, also known as a division element, is a general purpose container for other elements.

The div element is probably the most commonly used HTML element of all. It's useful for passing the CSS of its own class declarations down to all the elements that it contains." means...?

I can do it, in the run, but I just want to understand it better
I can't fully conceptualize it's purpose at the moment
@BookSprite bookmark mozilla dev it should be your best friend
Ryan
@ryanforever
Jan 15 2016 03:15 UTC
It really doesn't have a function except to have other elements inside it
JSampaioL
@JSampaioL
Jan 15 2016 03:15 UTC
@BookSprite It's basically a thing whose only purpose is to hold other things, so that those other things are organized in groups. Does that help in any way?
Justin Lynn Reid
@synflyn28
Jan 15 2016 03:16 UTC
Hello everyone I think I have to report a bug in Waypoint 26 in the Basic JavaScript Section
Artur
@ArturMC
Jan 15 2016 03:16 UTC
@synflyn28 what is it? Check the FCC GitHub repo it's probably been reported
@synflyn28 if not then start an issue
Justin Lynn Reid
@synflyn28
Jan 15 2016 03:18 UTC
Oh ok never mind, I got it to work I forgot to add spaces in my response doh!
Though the way the test suite to the left displays the answer is odd though. It doesn't translate the escape sequences in the way that you expect
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:19 UTC
@HoangTheCong how about this
var firstNameNotExist=true;
  for(var i=1; i<contact.length; i++){}
      if(contacts[i].firstname === firsntName){
          if(contacts[i].hasOwnProperty(prop)){
              return contacts[i][prop];
          }else{
              return "Property does not exist";
          }
          firstNameExist=false;
      }
  }

  if(firstNameExist){
      return "Contacts does not exist";
  }
Artur
@ArturMC
Jan 15 2016 03:19 UTC
@synflyn28 i find that some are better than others
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:20 UTC
sorry it should be var i=0; in the for loop @HoangTheCong
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:20 UTC
anyone else completely thrown by Waypoint: Iterate over Arrays with map? i feel like it's missing some critical instructions...
Justin Lynn Reid
@synflyn28
Jan 15 2016 03:20 UTC
Oh yeah. Thanks for the help @ArturMC!
CamperBot
@camperbot
Jan 15 2016 03:20 UTC
synflyn28 sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
:star: 281 | @arturmc | http://www.freecodecamp.com/arturmc
Artur
@ArturMC
Jan 15 2016 03:20 UTC
@JSDesign What's the problem? I completed all of them so I could try to help
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:20 UTC
@HoangTheCong and if(firstNameNotExist) on the last part
var firstNameNotExist=true;
  for(var i=0; i<contact.length; i++){}
      if(contacts[i].firstname === firsntName){
          if(contacts[i].hasOwnProperty(prop)){
              return contacts[i][prop];
          }else{
              return "Property does not exist";
          }
          firstNameExist=false;
      }
  }

  if(firstNameNotExist){
      return "Contacts does not exist";
  }
Artur
@ArturMC
Jan 15 2016 03:21 UTC
@lmalvaran get rid of the last if statement. Just return it outside the function
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:21 UTC
@ArturMC it's hard to say because i just don't understand any of it.
Artur
@ArturMC
Jan 15 2016 03:21 UTC
@lmalvaran no need for the variable before the loop
@JSDesign I'll take a look. Which number is it?
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:22 UTC
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:22 UTC
@ArturMC ok, i'm just making sure that if ever it needs to return no contacts found
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:22 UTC
@ArturMC i'm not looking for the answer, i just want to understand what is going on
wileyc427
@wileyc427
Jan 15 2016 03:24 UTC
Can anyone explain what is going on in Waypoint: Introducing JavaScript Object Notation JSON... I have absolutely no idea where to start or what the problem is asking...
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:24 UTC
@ArturMC is the parameter(s) of the callback function supposed to be a reference to each element in the original array?
Artur
@ArturMC
Jan 15 2016 03:24 UTC
@JSDesign the map function goes through the array
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:24 UTC
ok
Artur
@ArturMC
Jan 15 2016 03:25 UTC
@JSDesign so, you make a variable with a new array, use the map function to cycle through each item in the array
@JSDesign and it does whatever you told it to do to each item
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:25 UTC
ok so that's what map does then?
wow that makes sense now
Artur
@ArturMC
Jan 15 2016 03:26 UTC
@JSDesign pretty much.
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:26 UTC
ok simpler than i thought - i was overthinking i think heh
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:26 UTC
thanks a lot @ArturMC :)
CamperBot
@camperbot
Jan 15 2016 03:26 UTC
jsdesign sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
:star: 282 | @arturmc | http://www.freecodecamp.com/arturmc
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:27 UTC
@ArturMC awesome, i'm reading it
Artur
@ArturMC
Jan 15 2016 03:30 UTC
@JSDesign wrong link >.<
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:31 UTC
ahh lol i wondered if i just needed to keep reading to get to what the Waypoint is doing
@ArturMC thanks again!
CamperBot
@camperbot
Jan 15 2016 03:31 UTC
jsdesign sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
:warning: jsdesign already gave arturmc points
Artur
@ArturMC
Jan 15 2016 03:31 UTC
@JSDesign yea that's my bad should of read it before sending :P
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:31 UTC
:P
Ricardo Sanchez
@ricsanm
Jan 15 2016 03:32 UTC
// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

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

  {{if (value === "");
      return prop.shift;     
     }

  if (value !== "" && prop !== tracks);

   return value.push;}


if (prop === tracks && value !== "");


  return collection;
}


// Alter values below to test your code
update(5439, "artist", "ABBA");
Any help here guys? I have no idea what I'm doing wrong and would like an explanation.
Artur
@ArturMC
Jan 15 2016 03:34 UTC
@ricsanm your first two return values are completely wrong
@ricsanm start there
Mark David Teo
@volaix
Jan 15 2016 03:35 UTC
Hey @ricsanm how do you post your code like that?
Also can anyone help me with this basic error?
http://puu.sh/mwboV/03edcd8d91.png
Artur
@ArturMC
Jan 15 2016 03:35 UTC
explain formatting
CamperBot
@camperbot
Jan 15 2016 03:35 UTC

: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

Harvey S
@harveysanders
Jan 15 2016 03:35 UTC
@ricsanm and you have some craziness with your brackets
Chris
@gmiwakko
Jan 15 2016 03:35 UTC
Need help on basic java #55
Ricardo Sanchez
@ricsanm
Jan 15 2016 03:35 UTC

Why? It says
If value is non-blank (value !== "") and prop is not "tracks" then update or set the value for the prop.

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

If value is blank, delete that prop.

Always return the entire collection object.

Mark David Teo
@volaix
Jan 15 2016 03:36 UTC
This message was deleted
Artur
@ArturMC
Jan 15 2016 03:36 UTC
@volaix it should be function()
DJ
@qualitymanifest
Jan 15 2016 03:36 UTC
@gmiwakko java !== javascript. anyway, post your code
Harvey S
@harveysanders
Jan 15 2016 03:37 UTC
@ricsanm how do you push an element into an array
?
Artur
@ArturMC
Jan 15 2016 03:37 UTC
@ricsanm you need to remember how you access the values inside arrays
Chris
@gmiwakko
Jan 15 2016 03:37 UTC

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

return item; // Change this line
}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(queue(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

Instructions

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 (arr) and a number (item) as arguments. Add the number to the end of the array, then remove the first element of array. The queue function should then return the element that was removed.

Run tests (ctrl + enter)
Reset Help Bug

"Before: [1,2,3,4,5]\n6\nAfter: [1,2,3,4,5]"

queue([], 1) should return 1
queue([2], 1) should return 2
queue([5,6,7,8,9], 1) should return 5
After queue(testArr, 10), myArr[4] should be 10

Mark David Teo
@volaix
Jan 15 2016 03:37 UTC
@ArturMC ohhhh shiz. Thanks man!
CamperBot
@camperbot
Jan 15 2016 03:37 UTC
volaix sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
:star: 283 | @arturmc | http://www.freecodecamp.com/arturmc
John Cerpa
@johncerpa
Jan 15 2016 03:37 UTC
explain formatting
CamperBot
@camperbot
Jan 15 2016 03:37 UTC

: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

DJ
@qualitymanifest
Jan 15 2016 03:38 UTC
@gmiwakko put item into the end of the array, then remove and return the first part of the array
John Cerpa
@johncerpa
Jan 15 2016 03:38 UTC
who needs help
maybe I can help
Ricardo Sanchez
@ricsanm
Jan 15 2016 03:38 UTC
@harveysanders Ok let me check that Waypoint and I'll get back to you
Mark David Teo
@volaix
Jan 15 2016 03:39 UTC
testing
<!-- Only change code above this line. -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
Shawn Samii
@samii1031
Jan 15 2016 03:39 UTC
@johncerpa I could use a hand on something
Artur
@ArturMC
Jan 15 2016 03:39 UTC
@samii1031 post away
John Cerpa
@johncerpa
Jan 15 2016 03:39 UTC
paste your code :)
check that out
John Cerpa
@johncerpa
Jan 15 2016 03:40 UTC
This message was deleted
This message was deleted
are you just testing the formatting
Harvey S
@harveysanders
Jan 15 2016 03:40 UTC
gotta go for a sec
Ricardo Sanchez
@ricsanm
Jan 15 2016 03:40 UTC
@harveysanders On it!
Artur
@ArturMC
Jan 15 2016 03:40 UTC
@harveysanders thanks for using moz dev
CamperBot
@camperbot
Jan 15 2016 03:40 UTC
arturmc sends brownie points to @harveysanders :sparkles: :thumbsup: :sparkles:
Mark David Teo
@volaix
Jan 15 2016 03:40 UTC
yeah i was just testing the formatting haha
CamperBot
@camperbot
Jan 15 2016 03:40 UTC
:star: 363 | @harveysanders | http://www.freecodecamp.com/harveysanders
John Cerpa
@johncerpa
Jan 15 2016 03:40 UTC
oh alright hahaha
Mark David Teo
@volaix
Jan 15 2016 03:41 UTC
cheers bro anyway!
John Cerpa
@johncerpa
Jan 15 2016 03:41 UTC
:)
Shawn Samii
@samii1031
Jan 15 2016 03:41 UTC
@johncerpa its the check point Checkpoint: Word Blanks
I am not sure what I am suppoed to do
Chris
@gmiwakko
Jan 15 2016 03:41 UTC

Now it does nothing, and nothing appears in the console windowfunction queue(arr, item) {
// Your code here
testArr = arr.push(item);
testArr.shift();
return testArr; // Change this line
}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(queue(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

Shawn Samii
@samii1031
Jan 15 2016 03:41 UTC
#163
John Cerpa
@johncerpa
Jan 15 2016 03:41 UTC
let me check the exercise
DJ
@qualitymanifest
Jan 15 2016 03:41 UTC
@samii1031 thats the madlibs one?
Artur
@ArturMC
Jan 15 2016 03:42 UTC
@gmiwakko don't assign it to a variable. Just use arr
John Cerpa
@johncerpa
Jan 15 2016 03:42 UTC
yes, is that one
DJ
@qualitymanifest
Jan 15 2016 03:42 UTC
@samii1031 make a string using the parameters passed into the function, with spaces in between
Shawn Samii
@samii1031
Jan 15 2016 03:42 UTC
yes thats the one
DJ
@qualitymanifest
Jan 15 2016 03:42 UTC
@samii1031 var whateveritscalled = variable + " " + variable +... etc
Chris
@gmiwakko
Jan 15 2016 03:42 UTC

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

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(queue(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
still nothing

Ricardo Sanchez
@ricsanm
Jan 15 2016 03:43 UTC
@harveysanders When they ask to delete that prop if value is blank, they mean pop?
DJ
@qualitymanifest
Jan 15 2016 03:43 UTC
@gmiwakko pretty much but you want to return the shifted value
splucena
@splucena
Jan 15 2016 03:43 UTC
oftopic anyone who knows nginx?
Shawn Samii
@samii1031
Jan 15 2016 03:43 UTC
@qualitymanifest thanks I'll try it again
CamperBot
@camperbot
Jan 15 2016 03:43 UTC
samii1031 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 795 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Chris
@gmiwakko
Jan 15 2016 03:44 UTC
ok, show me what the heck to do
DJ
@qualitymanifest
Jan 15 2016 03:45 UTC
arr.shift(); removes the first value and then throws it away. you could also assign that value to another variable, or just return that value
Juan Martinez
@juanmtz03
Jan 15 2016 03:45 UTC
Untitled.png
hernc
@hernc
Jan 15 2016 03:45 UTC
I don't know if my problem is syntax or logic. Can anyone help?
// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

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

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


}

// Alter values below to test your code
update(5439, "artist", "ABBA");
John Cerpa
@johncerpa
Jan 15 2016 03:45 UTC
@juanmtz03 use a dot before the class
Juan Martinez
@juanmtz03
Jan 15 2016 03:45 UTC
Some help? please
John Cerpa
@johncerpa
Jan 15 2016 03:45 UTC
like this
.smaller-image
Chris
@gmiwakko
Jan 15 2016 03:45 UTC
I have that line
John Cerpa
@johncerpa
Jan 15 2016 03:46 UTC
.red-text
Juan Martinez
@juanmtz03
Jan 15 2016 03:46 UTC
Ok bro
John Cerpa
@johncerpa
Jan 15 2016 03:46 UTC
inside the style
DJ
@qualitymanifest
Jan 15 2016 03:46 UTC
@gmiwakko nope. you're throwing that value away
@gmiwakko you want to return that value
John Cerpa
@johncerpa
Jan 15 2016 03:47 UTC
@juanmtz03 did it work?
DJ
@qualitymanifest
Jan 15 2016 03:48 UTC
@gmiwakko by doing return arr you are returning the numbers still in the array. instead, you want to return the value removed from the array - which arr.shift()can give you
John Cerpa
@johncerpa
Jan 15 2016 03:48 UTC
@hernc use bracket notation
collection[id][prop]
Artur
@ArturMC
Jan 15 2016 03:49 UTC

@hernc for the first one, you want to access the collection through it's id then it's prop, and assign it to the value

For the second one you want to access id then tracks then push the value

don't return collection until the end

you are accessing the array's wrong. You should be using brackets
John Cerpa
@johncerpa
Jan 15 2016 03:49 UTC
to update the value and set the value
Chris
@gmiwakko
Jan 15 2016 03:49 UTC
moved it to the return line...finally worked. Wish they included instructions as to what the heck they were really asking for. Thanks for the help!
John Cerpa
@johncerpa
Jan 15 2016 03:49 UTC
collections[id][prop] = value;
hernc
@hernc
Jan 15 2016 03:49 UTC
@johncerpa thanks parce
CamperBot
@camperbot
Jan 15 2016 03:49 UTC
hernc sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
:star: 250 | @johncerpa | http://www.freecodecamp.com/johncerpa
John Cerpa
@johncerpa
Jan 15 2016 03:49 UTC
collections[id][prop].push(value);
parce hahahaha
hernc
@hernc
Jan 15 2016 03:49 UTC
thanks @ArturMC
CamperBot
@camperbot
Jan 15 2016 03:49 UTC
hernc sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
:star: 284 | @arturmc | http://www.freecodecamp.com/arturmc
Artur
@ArturMC
Jan 15 2016 03:49 UTC
@johncerpa don't give answers
John Cerpa
@johncerpa
Jan 15 2016 03:50 UTC
okay sorry
hernc
@hernc
Jan 15 2016 03:51 UTC
@johncerpa yea give those privately! jaja
John Cerpa
@johncerpa
Jan 15 2016 03:52 UTC
haha where are you from?
Artur
@ArturMC
Jan 15 2016 03:52 UTC
@hernc but then you don't learn. You each his own I guess :P
John Cerpa
@johncerpa
Jan 15 2016 03:52 UTC
true
gotta figure it out yourself
there's no point in passing the exercise and not understanding it
Artur
@ArturMC
Jan 15 2016 03:55 UTC
@johncerpa especially since this is optional and the goal is just pure knowledge no grades ^.^
John Cerpa
@johncerpa
Jan 15 2016 03:56 UTC
that reminds me of school
Zaidiw
@Zaidiw
Jan 15 2016 03:57 UTC
Can anywhere here please help me with waypoint's size your images?
John Cerpa
@johncerpa
Jan 15 2016 03:57 UTC
what is it
paste your code
explain formatting
CamperBot
@camperbot
Jan 15 2016 03:57 UTC

: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

John Cerpa
@johncerpa
Jan 15 2016 03:58 UTC
you need a css class and use it in your image
for example
<img class="someclass"></img>
there's an example in the exercise to create the class
<style>

  .larger-image {

    width: 500px;

  }

</style>
aitruong
@aitruong
Jan 15 2016 03:59 UTC

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

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

return myObj[checkProp];
}

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

how to return “Not Found” if no value
Artur
@ArturMC
Jan 15 2016 03:59 UTC
@aitruong use an if statement
John Cerpa
@johncerpa
Jan 15 2016 03:59 UTC
else {}
Artur
@ArturMC
Jan 15 2016 03:59 UTC
if found, return like you did
Ricardo
@balloons789
Jan 15 2016 03:59 UTC
quick question
Artur
@ArturMC
Jan 15 2016 04:00 UTC
@aitruong then else return "Not Found"
Ricardo
@balloons789
Jan 15 2016 04:00 UTC
<button type="submit">Submit<form action="/submit-cat-photo" button>
<input type="text" placeholder="cat photo URL">
</form></button>
John Cerpa
@johncerpa
Jan 15 2016 04:00 UTC
what's up
Ricardo
@balloons789
Jan 15 2016 04:00 UTC
instructions say "your form should have a button inside it"
aitruong
@aitruong
Jan 15 2016 04:00 UTC
@johncerpa thanks
CamperBot
@camperbot
Jan 15 2016 04:00 UTC
aitruong sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
:warning: aitruong already gave johncerpa points
John Cerpa
@johncerpa
Jan 15 2016 04:00 UTC
<button></button>
aitruong
@aitruong
Jan 15 2016 04:00 UTC
@ArturMC thanks
CamperBot
@camperbot
Jan 15 2016 04:00 UTC
aitruong sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
:star: 285 | @arturmc | http://www.freecodecamp.com/arturmc
John Cerpa
@johncerpa
Jan 15 2016 04:00 UTC
to create a button
Artur
@ArturMC
Jan 15 2016 04:01 UTC
This message was deleted
Ricardo
@balloons789
Jan 15 2016 04:01 UTC
end the button before, let me check. t
Artur
@ArturMC
Jan 15 2016 04:01 UTC
@balloons789 wait fail, put it inside the form
Ricardo
@balloons789
Jan 15 2016 04:01 UTC
??
John Cerpa
@johncerpa
Jan 15 2016 04:01 UTC
exactly
Artur
@ArturMC
Jan 15 2016 04:01 UTC
@balloons789 <form><button></button></form>
Ricardo
@balloons789
Jan 15 2016 04:02 UTC
I see.
Artur
@ArturMC
Jan 15 2016 04:02 UTC
@balloons789 it's called nesting
Ricardo
@balloons789
Jan 15 2016 04:02 UTC
how do i send the famous brownie points ?
you sr deserve some magical brownies lol
John Cerpa
@johncerpa
Jan 15 2016 04:03 UTC
thanks @nameofsomeone
CamperBot
@camperbot
Jan 15 2016 04:03 UTC
johncerpa sends brownie points to @nameofsomeone :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for nameofsomeone
John Cerpa
@johncerpa
Jan 15 2016 04:03 UTC
thanks and click the name
Artur
@ArturMC
Jan 15 2016 04:04 UTC
help @balloons789
CamperBot
@camperbot
Jan 15 2016 04:04 UTC

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

Basic Commands:

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

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

Jon Spencer
@batboy138
Jan 15 2016 04:08 UTC
// Setup
var myStorage = {
  "car": {
    "inside": {
      "glove box": "maps",
      "passenger seat": "crumbs"
     },
    "outside": {
      "trunk": "jack"
    }
  }
};

// Only change code below this line
myStorage.car.inside["glove box"];
var gloveBoxContents = ""; // Change this line
I'm stuck on Accessing Nested Objects in JSON. Can I please get help?
Artur
@ArturMC
Jan 15 2016 04:09 UTC
@batboy138 hey I saw you before ^.^ wb
John Cerpa
@johncerpa
Jan 15 2016 04:09 UTC
use bracket notation to access the property
Jon Spencer
@batboy138
Jan 15 2016 04:09 UTC
@ArturMC Whuddup?
hernc
@hernc
Jan 15 2016 04:09 UTC
@johncerpa medellin, but i'm in the us. got here when i was little
Artur
@ArturMC
Jan 15 2016 04:09 UTC
@batboy138 you want the variable to equal that and use brackets
John Cerpa
@johncerpa
Jan 15 2016 04:10 UTC
@hernc that's nice, I live in B/quilla
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:10 UTC
You dont need to use bracket notation until you get to glove box dot notation will be fine for car and inside
Shawn Samii
@samii1031
Jan 15 2016 04:10 UTC
@qualitymanifest I got the first part, but how do call the other varibles?
hernc
@hernc
Jan 15 2016 04:10 UTC
@ArturMC nah I hear you guys about the cheating. i was just kidding. thanks for the help
CamperBot
@camperbot
Jan 15 2016 04:10 UTC
hernc sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
:warning: hernc already gave arturmc points
Artur
@ArturMC
Jan 15 2016 04:11 UTC
@hernc thank you come again :P
CamperBot
@camperbot
Jan 15 2016 04:11 UTC
arturmc sends brownie points to @hernc :sparkles: :thumbsup: :sparkles:
:star: 217 | @hernc | http://www.freecodecamp.com/hernc
hernc
@hernc
Jan 15 2016 04:11 UTC
@johncerpa oh nice. my sis is from san andres. don't know if its similiar
John Cerpa
@johncerpa
Jan 15 2016 04:12 UTC
@hernc it's close
Jon Spencer
@batboy138
Jan 15 2016 04:12 UTC
@ArturMC Aren't I already using bracket notation?
John Cerpa
@johncerpa
Jan 15 2016 04:12 UTC
@hernc but not really haha
@hernc san andres is an island
Artur
@ArturMC
Jan 15 2016 04:12 UTC
@batboy138 yea I was wrong. john confused me
Kenston
@kdrye72
Jan 15 2016 04:13 UTC
'''
var difference = 45 - 0;
var difference = 12- 0;
difference=12;
'''
'''
Make the variable difference equal 12.
Only change the first line
Use the - operator
'''
CamperBot
@camperbot
Jan 15 2016 04:13 UTC
:bulb: to format code use backticks! ``` more info
Artur
@ArturMC
Jan 15 2016 04:13 UTC
@batboy138 you were on point just put it into the variable
Rex Schrader
@SaintPeter
Jan 15 2016 04:13 UTC
@batboy138 THe problem is that, while you are accessing the variable correctly, you're not actually assigning it to gloveBoxContents
John Cerpa
@johncerpa
Jan 15 2016 04:13 UTC
hi @SaintPeter
Rex Schrader
@SaintPeter
Jan 15 2016 04:13 UTC
@johncerpa Hola
John Cerpa
@johncerpa
Jan 15 2016 04:14 UTC
are you the owner of this great thing
or something
I like it
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:14 UTC
He's the patron saint of code
John Cerpa
@johncerpa
Jan 15 2016 04:14 UTC
ohh alright
Rex Schrader
@SaintPeter
Jan 15 2016 04:14 UTC
@johncerpa While I am part of the Core Team, I am not by any stretch an "owner". I did recently rewrite the Basic Javascript Cirriculum.
John Cerpa
@johncerpa
Jan 15 2016 04:15 UTC
ohh that's nice
good job man :)
Jon Spencer
@batboy138
Jan 15 2016 04:15 UTC
// Setup
var myStorage = {
  "car": {
    "inside": {
      "glove box": "maps",
      "passenger seat": "crumbs"
     },
    "outside": {
      "trunk": "jack"
    }
  }
};

// Only change code below this line

var gloveBoxContents = myStorage.car.inside["glove box"]; // Change this line
Booyah.
Rex Schrader
@SaintPeter
Jan 15 2016 04:15 UTC
You can tell because my spelling is really bad and they're even now finding spelling errors in it ;)
@batboy138 Whoot!
Artur
@ArturMC
Jan 15 2016 04:15 UTC
@johncerpa He made the Javascript curriculum so thank him for all those nights you raged haha :P
CamperBot
@camperbot
Jan 15 2016 04:15 UTC
arturmc sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
:star: 251 | @johncerpa | http://www.freecodecamp.com/johncerpa
John Cerpa
@johncerpa
Jan 15 2016 04:15 UTC
hahahahaha
Kenston
@kdrye72
Jan 15 2016 04:15 UTC
Need help:
CHALLENGE:
'''Make the variable difference equal 12.
Only change the first line
Use the - operator
'''
CamperBot
@camperbot
Jan 15 2016 04:15 UTC
:bulb: to format code use backticks! ``` more info
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:15 UTC
@batboy138 that should be correct
Jon Spencer
@batboy138
Jan 15 2016 04:15 UTC
@allanarmstrong It is.
Rex Schrader
@SaintPeter
Jan 15 2016 04:15 UTC
@johncerpa @ArturMC I take full responsibility ;)
John Cerpa
@johncerpa
Jan 15 2016 04:15 UTC
it's challenging
so much better
that's how you actually learn
Artur
@ArturMC
Jan 15 2016 04:16 UTC
@SaintPeter tbh I expected more of a challenge ;)
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:16 UTC
@kdrye72 what problem is that
Jon Spencer
@batboy138
Jan 15 2016 04:16 UTC
@SaintPeter So YOU'RE the reason why we've got more waypoints to deal with!
John Cerpa
@johncerpa
Jan 15 2016 04:16 UTC
hahahah
Artur
@ArturMC
Jan 15 2016 04:16 UTC
@SaintPeter is that the best you got? :smile:
Rex Schrader
@SaintPeter
Jan 15 2016 04:16 UTC
@ArturMC They're not actually supposed to be "hard". They're supposed to teach you stuff so when you get to the Bonfires you're better prepared.
SaintPeter @SaintPeter shrugs
Rex Schrader
@SaintPeter
Jan 15 2016 04:17 UTC
@batboy138 You'll thank me later ;)
CamperBot
@camperbot
Jan 15 2016 04:17 UTC
saintpeter sends brownie points to @batboy138 :sparkles: :thumbsup: :sparkles:
:star: 246 | @batboy138 | http://www.freecodecamp.com/batboy138
Artur
@ArturMC
Jan 15 2016 04:17 UTC
@SaintPeter yea I know. Just messing with you. Tbh scared of the ziplines so I'm just hanging around here helping others haha
Rex Schrader
@SaintPeter
Jan 15 2016 04:17 UTC
Apperently I'll thank you now :D
Kenston
@kdrye72
Jan 15 2016 04:17 UTC
'''
var difference = 45 - 0;
var difference = 12 - 0;
'''
CamperBot
@camperbot
Jan 15 2016 04:17 UTC
:bulb: to format code use backticks! ``` more info
Shawn Samii
@samii1031
Jan 15 2016 04:17 UTC
go easy on SaintPeter, he's doing us all a service, including the frustrations, better to be frustrated in practice than in real life :)
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:17 UTC
@SaintPeter you just need to write a checkpoint as good as @AkiraLaine's. Really get them thinking ;)
John Cerpa
@johncerpa
Jan 15 2016 04:17 UTC
everything I'm going to learn in college I already know it
Rex Schrader
@SaintPeter
Jan 15 2016 04:17 UTC
@allanarmstrong My Checkpoint was "so good" it got turned into a Bonfire.
Jon Spencer
@batboy138
Jan 15 2016 04:18 UTC
@SaintPeter You're welcome, and thanks!
CamperBot
@camperbot
Jan 15 2016 04:18 UTC
batboy138 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 2285 | @saintpeter | http://www.freecodecamp.com/saintpeter
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:18 UTC
@kdrye72 you dont need to define difference twice
@SaintPeter which one was that?
Artur
@ArturMC
Jan 15 2016 04:18 UTC
@allanarmstrong Caesar's Cipher
Rex Schrader
@SaintPeter
Jan 15 2016 04:18 UTC
@allanarmstrong Caesar's Cipher
IN STEREO
Except I spelled it wrong ;)
John Cerpa
@johncerpa
Jan 15 2016 04:18 UTC
I want to go to a meet up
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:18 UTC
@kdrye72 just find a number between 0 and 45 that's 12 away from 45
John Cerpa
@johncerpa
Jan 15 2016 04:18 UTC
People here don't like programming :(
Artur
@ArturMC
Jan 15 2016 04:18 UTC
I see no errors :smile:
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:19 UTC
@SaintPeter oh yeah that was fun one
Rex Schrader
@SaintPeter
Jan 15 2016 04:19 UTC
I :heart: Code
John Cerpa
@johncerpa
Jan 15 2016 04:19 UTC
Same man
I meant, where I live
Kenston
@kdrye72
Jan 15 2016 04:19 UTC
@allanarmstrong im looking over it
John Cerpa
@johncerpa
Jan 15 2016 04:19 UTC
I'm from Colombia, Barranquilla :)
Artur
@ArturMC
Jan 15 2016 04:20 UTC
I love it so much I torture myself with it on top of college work <3 @johncerpa
John Cerpa
@johncerpa
Jan 15 2016 04:20 UTC
@ArturMC I'll be bored when I start college
Rex Schrader
@SaintPeter
Jan 15 2016 04:20 UTC
Well, I was coming in to help out . . . but no one has problems right now?
John Cerpa
@johncerpa
Jan 15 2016 04:20 UTC
I guess not
Artur
@ArturMC
Jan 15 2016 04:20 UTC
@SaintPeter it's really slow today. Yesterday was busy
@johncerpa oh trust me the work will keep you away from boredom
Shawn Samii
@samii1031
Jan 15 2016 04:21 UTC
@SaintPeter I culd use some help on the word blank checkpoint
Rex Schrader
@SaintPeter
Jan 15 2016 04:21 UTC
@samii1031 Lay it on me
John Cerpa
@johncerpa
Jan 15 2016 04:21 UTC
@ArturMC I enjoy it
Shawn Samii
@samii1031
Jan 15 2016 04:22 UTC
I don't know how to call the 2nd set of words
Ricardo Sanchez
@ricsanm
Jan 15 2016 04:22 UTC
@SaintPeter Every time I come online you're helping people, that's awesome.
Kenston
@kdrye72
Jan 15 2016 04:22 UTC
@allanarmstrong I dont quite get it. I came up with 33
'''
var difference = 45 - 0;
var difference = 33;
'''
CamperBot
@camperbot
Jan 15 2016 04:23 UTC
:bulb: to format code use backticks! ``` more info
Shawn Samii
@samii1031
Jan 15 2016 04:23 UTC
@SaintPeter to get the dog line to work all I had to do is result = ("dog " + "big " + "ran " + "quickly");
Rex Schrader
@SaintPeter
Jan 15 2016 04:23 UTC
@samii1031 You don't need to call them, they're called for you automatically. The 4 words are passed in as arguments to the function. All you need to do is join the variables together with spaces between them using the concatanation operator.
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:23 UTC
@kdrye72 read the instructions you only need to change the first line. You dont need to write anything more than that
Shawn Samii
@samii1031
Jan 15 2016 04:23 UTC
but I dunno how to call the cats words
Rex Schrader
@SaintPeter
Jan 15 2016 04:23 UTC
@samii1031 The variables are like myNoun and myAdjective
Jeff Balenton
@infiniteiq83
Jan 15 2016 04:24 UTC
I'm on Waypoint Accessing Nested Arrays. And totally lost because setup is completely different from example
Jeff Balenton
@infiniteiq83
Jan 15 2016 04:24 UTC

// 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; // Change this line

John Cerpa
@johncerpa
Jan 15 2016 04:24 UTC
you need to make a sentence with that, right?
add spaces
Rex Schrader
@SaintPeter
Jan 15 2016 04:25 UTC
@infiniteiq83 You've got an array with objects and one of the properties of the object is an array.
Jeff Balenton
@infiniteiq83
Jan 15 2016 04:25 UTC
I know but I'm lost on accessing it
Rex Schrader
@SaintPeter
Jan 15 2016 04:25 UTC
@infiniteiq83 You know how to access arrays with bracket notation and you can access an object with dot notation.
@infiniteiq83 Like: someVar[2].someProp[2] gets the 3rd item in the someVar array, then the property someProp and then the 3rd item in that prop's array
sukumarkutagulla
@sukumarkutagulla
Jan 15 2016 04:26 UTC
Hi can somebody help me with this
Rex Schrader
@SaintPeter
Jan 15 2016 04:26 UTC
@infiniteiq83 You just chain together bracket and/or dot notation as appropriate
sukumarkutagulla
@sukumarkutagulla
Jan 15 2016 04:26 UTC

function lookUp(firstName, prop){
// Only change code below this line
result = contacts[firstName][prop];
for(var i=0; i<contacts.length;i++){
if(firstName == contacts.firstName && prop === contacts[firstName][prop]){
return contacts[prop].firstName;

}else if (prop !== contacts){
return "No such contact";
} else if(prop !== contacts.firstName.prop){
return "No such property";
}

// Only change code above this line
}
return result;
}
// Change these values to test your function
lookUp("Akira", "likes");

John Cerpa
@johncerpa
Jan 15 2016 04:27 UTC
explain formatting
CamperBot
@camperbot
Jan 15 2016 04:27 UTC

: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

Rex Schrader
@SaintPeter
Jan 15 2016 04:27 UTC
@sukumarkutagulla You need to use hasOwnProperty to determine if something has a property
sukumarkutagulla
@sukumarkutagulla
Jan 15 2016 04:27 UTC
java script 98 checkpoint
Rex Schrader
@SaintPeter
Jan 15 2016 04:27 UTC
@sukumarkutagulla This prop === contacts[firstName][prop] will never be true. Or is unlikely to be true.
sukumarkutagulla
@sukumarkutagulla
Jan 15 2016 04:27 UTC
where? @SaintPeter
Rex Schrader
@SaintPeter
Jan 15 2016 04:27 UTC
@sukumarkutagulla See above.
sukumarkutagulla
@sukumarkutagulla
Jan 15 2016 04:27 UTC
ok
Shawn Samii
@samii1031
Jan 15 2016 04:28 UTC
@SaintPeter ok, I'll give that a shot
Rex Schrader
@SaintPeter
Jan 15 2016 04:28 UTC
@sukumarkutagulla Also, you need to look at contacts[i][whatever]
@samii1031 Remember that contacts is an ARRAY first.
Jon Spencer
@batboy138
Jan 15 2016 04:29 UTC
// Setup
var myPlants = [
  { 
    type: "flowers",
    list: [
      "rose",
      "tulip",
      "dandelion"
    ]
  },
  {
    type: "trees",
    list: [
      "fir",
      "pine",
      "birch"
    ]
  }  
];

// Only change code below this line

var secondTree = myPlants.type.trees.list[1]; // "pine"
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:29 UTC
John Cerpa
@johncerpa
Jan 15 2016 04:29 UTC
use bracket notation
Jon Spencer
@batboy138
Jan 15 2016 04:29 UTC
I think I'm doing something wrong...
John Cerpa
@johncerpa
Jan 15 2016 04:29 UTC
to access the array
Rex Schrader
@SaintPeter
Jan 15 2016 04:29 UTC
@batboy138 myPlants top level is an array. You need to use array bracket notation.
sukumarkutagulla
@sukumarkutagulla
Jan 15 2016 04:29 UTC
@batboy138 you need to replace trees with an array of
ok @allanarmstrong
Kenston
@kdrye72
Jan 15 2016 04:30 UTC
@allanarmstrong thanks bro the problem was so ridiculously easy I made it harder than it should have been.
CamperBot
@camperbot
Jan 15 2016 04:30 UTC
kdrye72 sends brownie points to @allanarmstrong :sparkles: :thumbsup: :sparkles:
:star: 771 | @allanarmstrong | http://www.freecodecamp.com/allanarmstrong
Tyler
@Tyrelx
Jan 15 2016 04:31 UTC
Can I get some help, I have no idea where to go from here.
// Setup
function phoneticLookup(val) {
  var result = "";

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

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

// Change this value to test
phoneticLookup("charlie");
Jon Spencer
@batboy138
Jan 15 2016 04:32 UTC
var secondTree = myPlants[1].list[1]; // "pine" Thanks guys!
John Cerpa
@johncerpa
Jan 15 2016 04:32 UTC
good
:)
"alpha": "Adams"
Rex Schrader
@SaintPeter
Jan 15 2016 04:32 UTC
@Tyrelx You've got a lookup. You need to actually look val up in it.
John Cerpa
@johncerpa
Jan 15 2016 04:32 UTC
it's like a dictionary
Rex Schrader
@SaintPeter
Jan 15 2016 04:32 UTC
@johncerpa That aspect of their code will technically work as written
John Cerpa
@johncerpa
Jan 15 2016 04:33 UTC
hmmn
that's how I did it
is it the same?
Rex Schrader
@SaintPeter
Jan 15 2016 04:33 UTC
@johncerpa properties with no space are legal in JS
John Cerpa
@johncerpa
Jan 15 2016 04:33 UTC
oh I get it
Rex Schrader
@SaintPeter
Jan 15 2016 04:33 UTC
@Tyrelx 2nd problem: You cannot use the name phoneticLookup for your object variable, becuase you overwrite the definition of your function name. Use a name like lookup
Elifaz Filho
@Elifaz
Jan 15 2016 04:34 UTC

@batboy138 On this case myPlants has 2 array values that are 2 objects, and within each array [objects] you have 2 properties, where the first has it’s value as a string, and the second has as its value another array with 3 values within. To access each object in the array you will use bracket notation, and then to access the objects you will access by dot notation, and then bracket notation again. Such as

getCoffee[20].temperature[hot];

Something on those lines.

Tyler
@Tyrelx
Jan 15 2016 04:35 UTC
@SaintPeter Ok I fixed the second problem, how do I lookup val?
KoToZ
@Mohamedtareque
Jan 15 2016 04:35 UTC
hey guys
//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intruiging Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    },
];


function lookUp(firstName, prop){
// Only change code below this line
  for(var i=0 ; i<=contacts.length ; i++){
    if(contacts[i].firstName!==firstName){
      return "No such contact";
    }
  }

// Only change code above this line

// Only change code above this line
}

// Change these values to test your function
lookUp("Akira", "likes");
Elifaz Filho
@Elifaz
Jan 15 2016 04:35 UTC
This message was deleted
Rex Schrader
@SaintPeter
Jan 15 2016 04:35 UTC
@Tyrelx You've got an object, and you've got a variable with a property name. You can use bracket notation on the object with the variable in it
KoToZ
@Mohamedtareque
Jan 15 2016 04:35 UTC
i stuck here as i can't under stand return in looping
Elifaz Filho
@Elifaz
Jan 15 2016 04:36 UTC
@Mohamedtareque in looping the basic principle is that a return statement will automatically return your request and skip the remainder of the loop.
Rex Schrader
@SaintPeter
Jan 15 2016 04:37 UTC
@Mohamedtareque You can't say "No such contact" inside the loop, because you need to have checked every part of the array before you can say that. If you DO find it, though, you can check to see if the property exists and, if it does, return the value.
Elifaz Filho
@Elifaz