These are chat archives for FreeCodeCamp/Help

15th
Jan 2016
tommy
@tommygebru
Jan 15 2016 00:00
@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
@tommygebru Waypoint: Introducing JavaScript Object Notation JSON
tommy
@tommygebru
Jan 15 2016 00:00
@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
@tommygebru : should i use if or switch for this case?
tommy
@tommygebru
Jan 15 2016 00:01
@becorry
var myString="";
myString="something";
sunandakothapalli
@sunandakothapalli
Jan 15 2016 00:01
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

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
@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
okay thanks @tommygebru I figured it out
CamperBot
@camperbot
Jan 15 2016 00:02
becorry sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 330 | @tommygebru | http://www.freecodecamp.com/tommygebru
sunandakothapalli
@sunandakothapalli
Jan 15 2016 00:02
Waypoint: Make Images Mobile Responsive
tommy
@tommygebru
Jan 15 2016 00:02
@becorry nice :+1:
@sunandakothapalli also link please :+1:
CompGeekGirl
@LisaRamos
Jan 15 2016 00:03

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
@charst46 Do you have a question or would you like to share your code?
Brian
@sludge256
Jan 15 2016 00:04
@LisaRamos product is not an array
arr is however
sunandakothapalli
@sunandakothapalli
Jan 15 2016 00:04
need help with the above
Charles Stoy
@charst46
Jan 15 2016 00:04

@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
@aitruong the instructions ask for switch
Cristian V. Nica
@cristianvnica
Jan 15 2016 00:05
@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
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
@sunandakothapalli I can help you.
Glen Roberts
@ZeroAccess
Jan 15 2016 00:05
@cristianvnica no worries glad ya got it :D
tommy
@tommygebru
Jan 15 2016 00:05
@charst46 :+1: What was the question?
aitruong
@aitruong
Jan 15 2016 00:05

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
@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
@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
@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

@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
@aitruong try resetting
also maybe myDog needs only one friend
DJ
@qualitymanifest
Jan 15 2016 00:07
@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
@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
@sludge256 Okay.
tommy
@tommygebru
Jan 15 2016 00:09
@LisaRamos I think its returning product and not console.log .....
aitruong
@aitruong
Jan 15 2016 00:09
@tommygebru thank you. Fixed!
CamperBot
@camperbot
Jan 15 2016 00:09
aitruong sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:warning: aitruong already gave tommygebru points
tommy
@tommygebru
Jan 15 2016 00:09
@aitruong nice :+1:
DJ
@qualitymanifest
Jan 15 2016 00:09
Selection_093.png
tommy
@tommygebru
Jan 15 2016 00:09
@sludge256 :+1:
CompGeekGirl
@LisaRamos
Jan 15 2016 00:10
@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
@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
Hi @LisaRamos , if you just want to log the product, simply remove the return statement
Charles Stoy
@charst46
Jan 15 2016 00:12
@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

@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
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
@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
@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
@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
@qualitymanifest Understand. Sorry for re-asking and thank you again.
CamperBot
@camperbot
Jan 15 2016 00:14
majortom-1225 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: majortom-1225 already gave qualitymanifest points
DJ
@qualitymanifest
Jan 15 2016 00:14
@MajorTom-1225 no worries. it's just one of those quirks
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:14
@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
thanks @tommygebru Saw the note about needing the comma between objects but that note did not register...
CamperBot
@camperbot
Jan 15 2016 00:14
charst46 sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 331 | @tommygebru | http://www.freecodecamp.com/tommygebru
tommy
@tommygebru
Jan 15 2016 00:17
@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
@LisaRamos hint! accumulate the multiplied values into a variable
tommy
@tommygebru
Jan 15 2016 00:18
@wearenotgroot :+1:
CompGeekGirl
@LisaRamos
Jan 15 2016 00:19
@tommygebru @wearenotgroot How do I do that?
greg
@wearenotgroot
Jan 15 2016 00:22
@LisaRamos hint! use *
CompGeekGirl
@LisaRamos
Jan 15 2016 00:22
@wearenotgroot Where do I put that?
greg
@wearenotgroot
Jan 15 2016 00:23
@LisaRamos console.log(arr[i][j]); remove console.log use it right here
Therese
@halyang87
Jan 15 2016 00:23
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
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
@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

"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
@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
@LisaRamos
console.log(arr[i][j]);//Replace this with your algorithm
alasdairr
@alasdairr
Jan 15 2016 00:26
thanks, i misread that lol
Therese
@halyang87
Jan 15 2016 00:26
@qualitymanifest should i change my code or?
greg
@wearenotgroot
Jan 15 2016 00:26
@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
@halyang87 remove assignment operator =
DJ
@qualitymanifest
Jan 15 2016 00:27
@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
@alasdairr have you tried the bonfire room ?
https://gitter.im/orgs/FreeCodeCamp/rooms/
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:27
@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
Instructions
Combine the if statements into a single if/else statement.
DJ
@qualitymanifest
Jan 15 2016 00:27
@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
@lmalvaran psst. do not show entire solution!
tommy
@tommygebru
Jan 15 2016 00:28
@qualitymanifest :+1: i didnt see that they were different
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:28
im sorry
CompGeekGirl
@LisaRamos
Jan 15 2016 00:28
@lmalvaran Thanks. It worked.
CamperBot
@camperbot
Jan 15 2016 00:28
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
thanks for the brownie @LisaRamos
CamperBot
@camperbot
Jan 15 2016 00:29
lmalvaran sends brownie points to @lisaramos :sparkles: :thumbsup: :sparkles:
:star: 264 | @lisaramos | http://www.freecodecamp.com/lisaramos
tommy
@tommygebru
Jan 15 2016 00:29
@lmalvaran keep trying to drop hints :+1: and make them beg for the answer
MUHAHAHA
greg
@wearenotgroot
Jan 15 2016 00:29
@LisaRamos did you understand why it worked?
DJ
@qualitymanifest
Jan 15 2016 00:29
it's beets
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:29
ok @tommygebru
DJ
@qualitymanifest
Jan 15 2016 00:29
why isn't there a beet emoji
Therese
@halyang87
Jan 15 2016 00:29

@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
@ZeroAccess thanks, the psuedocode you posted for someone like 25 mins ago just helped me too :)
CamperBot
@camperbot
Jan 15 2016 00:30
aoxom sends brownie points to @zeroaccess :sparkles: :thumbsup: :sparkles:
:star: 281 | @zeroaccess | http://www.freecodecamp.com/zeroaccess
Therese
@halyang87
Jan 15 2016 00:30
*my code i showed you
DJ
@qualitymanifest
Jan 15 2016 00:30
@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
@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
@halyang87 Share link please or title of the waypoint
DJ
@qualitymanifest
Jan 15 2016 00:30
@MajorTom-1225 :+1:
tommy
@tommygebru
Jan 15 2016 00:31
@MajorTom-1225 :+1:
Therese
@halyang87
Jan 15 2016 00:31
Waypoint: Introducing Else Statements
@tommygebru
DJ
@qualitymanifest
Jan 15 2016 00:31
@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
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
@qualitymanifest But except this palindrome("0_0 (: /-\ :) 0-0") as you said before.
Cory O'Dell
@coryodell28
Jan 15 2016 00:32

// 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
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
@barbaralukasz i think it needs to be btn btn-block
you replaced btn right?
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:35
@barbaralukasz check your style .btn-block, you're missing the attributes
tommy
@tommygebru
Jan 15 2016 00:36
@halyang87 look carefully result is not return :smile:
bash
@barbaralukasz
Jan 15 2016 00:38
@lmalvaran @qualitymanifest i changed class from .btn-block to .btn.btn-block and still not working
DJ
@qualitymanifest
Jan 15 2016 00:38
@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
@qualitymanifest Done! var norArr = lcStr.match(/[A-Za-z0-9]/gi);
Abhisek Pattnaik
@abhisekp
Jan 15 2016 00:38
@tommygebru      :+1:
@qualitymanifest :+1:
DJ
@qualitymanifest
Jan 15 2016 00:38
@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
@qualitymanifest its tell me "Your button should have the class btn-block"
Therese
@halyang87
Jan 15 2016 00:38
@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
@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
@qualitymanifest THANKS! go it :)
CamperBot
@camperbot
Jan 15 2016 00:39
barbaralukasz sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 793 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
tommy
@tommygebru
Jan 15 2016 00:39
@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
@barbaralukasz :+1:
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:40
@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
ok, going to bed. GL all and keep on coding :smile:
Edgyveggieyogi
@Edgyveggieyogi
Jan 15 2016 00:40
hello everyone, i'm got stuck in Waypoint: "size your images"
Patrick Magee
@patjmagee
Jan 15 2016 00:40
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

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

}

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

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
Hi everyone....
tommy
@tommygebru
Jan 15 2016 00:52
@codescout811 welcome
Patrick Magee
@patjmagee
Jan 15 2016 00:52
@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
patjmagee sends brownie points to @aoxom :sparkles: :thumbsup: :sparkles:
:star: 387 | @aoxom | http://www.freecodecamp.com/aoxom
Chris
@Aoxom
Jan 15 2016 00:53
@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
@LisaRamos
if (firstName, prop === true) {//explain this please
Donald
@codescout811
Jan 15 2016 00:55
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
hi has anybody completed "Checkpoint: Stand in Line"
Chris
@Aoxom
Jan 15 2016 00:56
@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
@tommygebru How do I do that? I'm not sure.
Chris
@Aoxom
Jan 15 2016 00:56
@LisaRamos this quote helped me with that checkpoint
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 00:57
@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
@LisaRamos I am asking because i want to know what you are trying to do
Tim R
@amenshamen
Jan 15 2016 00:57
@kunalg1 sure - Whats your question? ;)
tommy
@tommygebru
Jan 15 2016 00:58
@LisaRamos
also I am sure this
return "value";//does nothing
Kunal
@kunalg1
Jan 15 2016 00:58
@amenshamen , well the code works for two tests, but other two tests fail
CompGeekGirl
@LisaRamos
Jan 15 2016 00:58

@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
Well you have to show us your code in order to get help
Kunal
@kunalg1
Jan 15 2016 00:59

@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
@LisaRamos use a for loop
CompGeekGirl
@LisaRamos
Jan 15 2016 01:00
@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
@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
@LisaRamos and for each iteration check for the firstname and property value
Chris
@Aoxom
Jan 15 2016 01:00
@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 :)
Kunal
@kunalg1
Jan 15 2016 01:01
CompGeekGirl
@LisaRamos
Jan 15 2016 01:01
@Aoxom The instructions are a bit confusing but how do I change what you mentioned around?
Chris
@Aoxom
Jan 15 2016 01:02
@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
@LisaRamos the function is about checking if the contact exist and showing the value of the properties
Chris
@Aoxom
Jan 15 2016 01:02
@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
@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
@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
@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
oh
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 01:05
@LisaRamos i prefer to use the for in loop..
for(var person in contacts){....}
Kunal
@kunalg1
Jan 15 2016 01:07
@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
@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
@kunalg1 is this the Waypoint: Stand in Line
Kunal
@kunalg1
Jan 15 2016 01:11
@tommygebru yes this is
Tim R
@amenshamen
Jan 15 2016 01:11
@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
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
show me your new code
@kunalg1
Kunal
@kunalg1
Jan 15 2016 01:12

@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
@CodeDavidB whats the waypoint?
David Biedenbender
@CodeDavidB
Jan 15 2016 01:13
finding the remainder in javascript
tommy
@tommygebru
Jan 15 2016 01:13
@kunalg1
arr.shift(); is called twice therefore it gives a different answer
Tim R
@amenshamen
Jan 15 2016 01:13
@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
@amenshamen :+1:
David Biedenbender
@CodeDavidB
Jan 15 2016 01:14
im not clear on the instructions or just dont get the question...
Kunal
@kunalg1
Jan 15 2016 01:14
ok let me try just returning arr.shift();
CompGeekGirl
@LisaRamos
Jan 15 2016 01:14
@Aoxom Can you requote that again using the backticks please? I'm quite confused.
Kunal
@kunalg1
Jan 15 2016 01:14
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
@CodeDavidB show what you have tried :smile:
David Biedenbender
@CodeDavidB
Jan 15 2016 01:16
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
@kunalg1 you understand the concept now therefore reset the code and try again :smile:
Kunal
@kunalg1
Jan 15 2016 01:16
i did reset twice :worried:
tommy
@tommygebru
Jan 15 2016 01:16
@CodeDavidB The computer will do the math 11%3;
David Biedenbender
@CodeDavidB
Jan 15 2016 01:16
the answer to 11/3 is 3.667 but not sure how to show that
tommy
@tommygebru
Jan 15 2016 01:17
@kunalg1 now type in the code again
Tim R
@amenshamen
Jan 15 2016 01:17
@kunalg1 Your code is 100% correct :O
Kunal
@kunalg1
Jan 15 2016 01:18
dunno what happened, lol
i think there was a glitch on my side
tommy
@tommygebru
Jan 15 2016 01:18
@amenshamen the computer needs to be reset on that specific Waypoint!
Tim R
@amenshamen
Jan 15 2016 01:18
@kunalg1 so it works now?
lenaecb
@lenaecb
Jan 15 2016 01:18
anyone have trouble with the increment a number wit JS lesson?
Kunal
@kunalg1
Jan 15 2016 01:18
thanks guys @amenshamen @tommygebru
CamperBot
@camperbot
Jan 15 2016 01:18
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
i can't get it to return what i need
tommy
@tommygebru
Jan 15 2016 01:18
@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
@lenaecb think you leave out the i
tommy
@tommygebru
Jan 15 2016 01:21
@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

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
Screen Shot 2016-01-14 at 8.23.51 PM.png
@tommygebru like above?
tommy
@tommygebru
Jan 15 2016 01:24
@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
@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
@tommygebru - so when i just do - var myVar ++; it still isn't giving me 88
CompGeekGirl
@LisaRamos
Jan 15 2016 01:26
@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
@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
@tommygebru Could you give me an example if you don't mind?
tommy
@tommygebru
Jan 15 2016 01:30
This message was deleted
lenaecb
@lenaecb
Jan 15 2016 01:30
@tommygebru go it :)
tommy
@tommygebru
Jan 15 2016 01:30
@lenaecb nice :+1:
chantaldesiree
@chantaldesiree
Jan 15 2016 01:30
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
@tommygebru How do I explain the first if statement?
tommy
@tommygebru
Jan 15 2016 01:31
@chantaldesiree I think that is how it is supposed to behave
chantaldesiree
@chantaldesiree
Jan 15 2016 01:31
Really? It's never looked like that before.
tommy
@tommygebru
Jan 15 2016 01:32
@LisaRamos i only mean what does the comma mean or true ? within the parantheses?
Brian
@BWColley
Jan 15 2016 01:32

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
@chantaldesiree it will continue to look like that
@BWColley welcome
Brian
@BWColley
Jan 15 2016 01:32
but my outut remains 87
thanks tommy
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:32

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
@BWColley remove myVar=
Tim R
@amenshamen
Jan 15 2016 01:34
@BWColley myVar++; is the same as myVar = myVar +1;
Brian
@BWColley
Jan 15 2016 01:34
ahhh, ok, THANKS!
tommy
@tommygebru
Jan 15 2016 01:34
@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
hey guys! im having some trouble with my javascript
aitruong
@aitruong
Jan 15 2016 01:38
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
@aitruong Link to the Waypoint please :)
@dcordoba1 which sort of trouble? ;)
Danielle Cordoba
@dcordoba1
Jan 15 2016 01:39
im having issues with converting celsius to fehrenheit
tommy
@tommygebru
Jan 15 2016 01:39
@aitruong Remember what your parameter is
Danielle Cordoba
@dcordoba1
Jan 15 2016 01:39
my code is right but i feel like its being put in the wrong place
aitruong
@aitruong
Jan 15 2016 01:40
@tommygebru : it it val
CompGeekGirl
@LisaRamos
Jan 15 2016 01:40
@tommygebru How do we do that?
tommy
@tommygebru
Jan 15 2016 01:40
@aitruong where is your other val
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:40

@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
@tommygebru underneath your profile you have the option of joining a room like FreeCodeCamp/Help
CompGeekGirl
@LisaRamos
Jan 15 2016 01:41
@tommygebru I put the comma within the parenthesis.
tommy
@tommygebru
Jan 15 2016 01:41
aitruong
@aitruong
Jan 15 2016 01:42
how to return multiple values from one object?
within a function
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:43
blob
@tommygebru
tommy
@tommygebru
Jan 15 2016 01:44
@LisaRamos lets talk pm
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:44
@tommygebru Ok
cannelflow
@cannelflow
Jan 15 2016 01:44
@HaroonGhawsi ?
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:44
Thanks
Stephen Fox
@stevemasta34
Jan 15 2016 01:44
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
@aitruong for var key in lookup should be removed there is already a function called
phoneticLookup();
cannelflow
@cannelflow
Jan 15 2016 01:45
@stevemasta34 code?
Tim R
@amenshamen
Jan 15 2016 01:45
@dcordoba1 Well show us your code so we can check if its really right ;)
tommy
@tommygebru
Jan 15 2016 01:45
@cannelflow reinforcements!
Stephen Fox
@stevemasta34
Jan 15 2016 01:46
nvm, found it
cannelflow
@cannelflow
Jan 15 2016 01:46
@tommygebru :+1:
Stephen Fox
@stevemasta34
Jan 15 2016 01:46
@cannelflow it wanted me to use <i> tags instead of <em> tags
cannelflow
@cannelflow
Jan 15 2016 01:49
@stevemasta34 yes you have to use i tag http://www.w3schools.com/tags/tag_i.asp
Jeannie Stevenson
@JSDesign
Jan 15 2016 01:50
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
blob
@tommygebru How to include the count variable within the Switch statement values?
Zina Astafyeva
@tragetraje
Jan 15 2016 01:52
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
@HaroonGhawsi do lihe case: case: case then at last count++
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:53
@cannelflow Ooh ok
thanks
tommy
@tommygebru
Jan 15 2016 01:53
@HaroonGhawsi nice :+1:
Zina Astafyeva
@tragetraje
Jan 15 2016 01:53
Is the switch statement the only way to solve it?
cannelflow
@cannelflow
Jan 15 2016 01:53
@tragetraje you havr to return count+++" Hold" see instruction
Jeannie Stevenson
@JSDesign
Jan 15 2016 01:53
or even just a hit of where i'm going wrong so i can do research
Zina Astafyeva
@tragetraje
Jan 15 2016 01:54
I was thinking I can approach it with if/else...
cannelflow
@cannelflow
Jan 15 2016 01:54
@tragetraje yes you can
tommy
@tommygebru
Jan 15 2016 01:54
@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
@cannelflow Thanks, but what instruction you mean?
CamperBot
@camperbot
Jan 15 2016 01:54
tragetraje sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 407 | @cannelflow | http://www.freecodecamp.com/cannelflow
cannelflow
@cannelflow
Jan 15 2016 01:55
@tragetraje Example Output
"-3 Hold"
"5 Bet"
@tragetraje you are only counting
Jeannie Stevenson
@JSDesign
Jan 15 2016 01:56
has anyone here completed Checkpoint: Profile Lookup ?
Zina Astafyeva
@tragetraje
Jan 15 2016 01:56
@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
Can you type the goal of the problem? Im not there yet
the instructions
Zina Astafyeva
@tragetraje
Jan 15 2016 01:57
thanks @tommygebru, I see
CamperBot
@camperbot
Jan 15 2016 01:57
tragetraje sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 335 | @tommygebru | http://www.freecodecamp.com/tommygebru
cannelflow
@cannelflow
Jan 15 2016 01:57
@tragetraje do concat like count++ + " Hold"
Jeannie Stevenson
@JSDesign
Jan 15 2016 01:58
@neoprez are you asking me?
cannelflow
@cannelflow
Jan 15 2016 01:58
@neoprez its good to mention ppl in comment :smile:
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 01:59
@tommygebru This what I have done so far but not able to solve it.
blob
Rodny
@neoprez
Jan 15 2016 01:59
my bad @JSDesign. Thanks @cannelflow . The message was for @tragetraje
CamperBot
@camperbot
Jan 15 2016 01:59
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
@neoprez cool np :)
cannelflow
@cannelflow
Jan 15 2016 01:59
@neoprez :+1:
tommy
@tommygebru
Jan 15 2016 02:00
@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
thanks @tommygebru
CamperBot
@camperbot
Jan 15 2016 02:00
neoprez sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 336 | @tommygebru | http://www.freecodecamp.com/tommygebru
cannelflow
@cannelflow
Jan 15 2016 02:01
@HaroonGhawsi try pointing curser at yello triangle it will say what is error
tommy
@tommygebru
Jan 15 2016 02:01
@neoprez :+1:
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 02:03
@cannelflow it says unreable break after return
@cannelflow I don't whats that.
know*
cannelflow
@cannelflow
Jan 15 2016 02:05
@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
@JSDesign I am on that checkpoint as well..
Haroon Ghawsi
@HaroonGhawsi
Jan 15 2016 02:06
@cannelflow Ok, thanks
CamperBot
@camperbot
Jan 15 2016 02:06
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
@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
@cannelflow got it thanks
CamperBot
@camperbot
Jan 15 2016 02:08
haroonghawsi sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:warning: haroonghawsi already gave cannelflow points
Jon Spencer
@batboy138
Jan 15 2016 02:11
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
@batboy138 is myObj existing?
Jon Spencer
@batboy138
Jan 15 2016 02:14
Yes.
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:14
can you show me the task please?
Andrew Charlebois
@andrewchar
Jan 15 2016 02:14
<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
// 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
@batboy138 what does it exactly asks to return?
John Cerpa
@johncerpa
Jan 15 2016 02:16
This message was deleted
it should return
return "Change Me!";
Steven
@a00000a41
Jan 15 2016 02:17
Do not change code above the line what is means?
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:17
@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
What is wrong here???
function myFunction(c, d){
console.log(c + d);
}
myFunction(3, 4);
Andrew Charlebois
@andrewchar
Jan 15 2016 02:18
how do i post the code like batboy just did
John Cerpa
@johncerpa
Jan 15 2016 02:18
erase the else statement
hmm n
no
Wesley Robertson
@adoptedmanatee
Jan 15 2016 02:19
I am a little stuck on Checkpoint: Stand in Line
John Cerpa
@johncerpa
Jan 15 2016 02:19
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
@edburdett what does the task asks you to do?
edburdett
@edburdett
Jan 15 2016 02:20
Create a function myFunction that takes two arguments and outputs their sum
aitruong
@aitruong
Jan 15 2016 02:21
@HaroonGhawsi did you get answer?
edburdett
@edburdett
Jan 15 2016 02:21
myFunction(1,2) should output 3
John Cerpa
@johncerpa
Jan 15 2016 02:21
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
@edburdett code looks good to me
Rae
@cs-knight
Jan 15 2016 02:22
trying to change div element color
Kevin Rodriguez
@kevin2r
Jan 15 2016 02:22
can you help me with "Bonfire: Truncate a string", i don't understand very well the question
CamperBot
@camperbot
Jan 15 2016 02:22
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Luciano
@StrikingLoo
Jan 15 2016 02:22
This message was deleted
Rae
@cs-knight
Jan 15 2016 02:22

  .gray-background {
    background-color: gray;
  }
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:23
@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
grey
use the class
edburdett
@edburdett
Jan 15 2016 02:23
@adoptedmanatee it looks fine to me to, but it's not passing
Luciano
@StrikingLoo
Jan 15 2016 02:23
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
@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
var code = "formatted";
whoops
trying to figure out how to post the code
John Cerpa
@johncerpa
Jan 15 2016 02:24
@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

: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
@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
hmm still not gray
<div class="gray-background">
Alvis Ng
@vizFlux
Jan 15 2016 02:26
This message was deleted
Wesley Robertson
@adoptedmanatee
Jan 15 2016 02:26
@edburdett what WP is it
cannelflow
@cannelflow
Jan 15 2016 02:26
@kevin2r did you worked it out?
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:26
@edburdett can you post the complete challenge please
edburdett
@edburdett
Jan 15 2016 02:27
Passing values to functions with arguments
cannelflow
@cannelflow
Jan 15 2016 02:28
@csrae in style for class grey backgroud you have to give background-color:grey
Andrew Charlebois
@andrewchar
Jan 15 2016 02:28

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

alert ( add ( 1.2) );
js

Kevin Rodriguez
@kevin2r
Jan 15 2016 02:29
@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
@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
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
@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
first one had an error
cannelflow
@cannelflow
Jan 15 2016 02:32
@kevin2r which ex?
edburdett
@edburdett
Jan 15 2016 02:33
@adoptedmanatee tried that too
Andrew Charlebois
@andrewchar
Jan 15 2016 02:33
im having a problem with Waypoint: Style Text Inputs as Form Controls
Kevin Rodriguez
@kevin2r
Jan 15 2016 02:33
@cannelflow Bonfire: Truncate a string
ALINATSUI
@ALINATSUI
Jan 15 2016 02:33
@kodinglife I got the answer already....
Andrew Charlebois
@andrewchar
Jan 15 2016 02:33
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
@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
@cannelflow I think that i'm getting close
cannelflow
@cannelflow
Jan 15 2016 02:34
@kevin2r can you show your code
edburdett
@edburdett
Jan 15 2016 02:34
@adoptedmanatee that's where my thoughts were going
allenlao26
@allenlao26
Jan 15 2016 02:34
@andrewchar you have an extra hypen
Rae
@cs-knight
Jan 15 2016 02:34
@cannelflow yes i added it to style
ALINATSUI
@ALINATSUI
Jan 15 2016 02:35
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
@cannelflow I'm starting to write it
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:35
@andrewchar do you really have to include the class btn-btn-primary in your <i element?
Jon Spencer
@batboy138
Jan 15 2016 02:35
@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
stuck on checkpoint: stand in line
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:36
@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
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
trying to make sense of it at the moment
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:36
@andrewchar look at your button class
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:36
@ALINATSUI myObj.hasOwnProperty() <--- you need the property inside the () to check for
cannelflow
@cannelflow
Jan 15 2016 02:37
@andrewchar ?
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:37
@andrewchar i think it should be class="btn btn-primary" not class="btn-btn-primary".
ALINATSUI
@ALINATSUI
Jan 15 2016 02:37
@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
omg
lol
cannelflow
@cannelflow
Jan 15 2016 02:37
@andrewchar class="btn btn-primary"
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:38
@ALINATSUI you have the checkProp variable
allenlao26
@allenlao26
Jan 15 2016 02:38
stuck on waypoint: using objects for lookups
Luciano
@StrikingLoo
Jan 15 2016 02:38
can anyone tell me how they solved checkpoint:record collection?
allenlao26
@allenlao26
Jan 15 2016 02:38

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

}
ALINATSUI
@ALINATSUI
Jan 15 2016 02:40
@lmalvaran I think I tried that, but it didn't work...
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:41
@ALINATSUI check the code posted by @johncerpa
ALINATSUI
@ALINATSUI
Jan 15 2016 02:42
@lmalvaran When was it posted?
John Cerpa
@johncerpa
Jan 15 2016 02:42
is above
your comment
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:42
@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
if (myObj.hasOwnProperty(checkProp)) {
}
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:42
@ALINATSUI so in this example myObj is the object.. while checkProp variable is used as the property
ALINATSUI
@ALINATSUI
Jan 15 2016 02:43
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
return the property
like this
This message was deleted
return myObj[checkProp];
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:43
:+1:
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 02:44
if(myObj.hasOwnProperty(checkProp)){
   //do your code here
}
John Cerpa
@johncerpa
Jan 15 2016 02:44
:)
return should be inside the if statement
ALINATSUI
@ALINATSUI
Jan 15 2016 02:44
@johncerpa Thanks...I'm still trying to wrap my head around this concept...
CamperBot
@camperbot
Jan 15 2016 02:44
alinatsui sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
Jon Spencer
@batboy138
Jan 15 2016 02:44
@johncerpa Thanks!
CamperBot
@camperbot
Jan 15 2016 02:44
:star: 248 | @johncerpa | http://www.freecodecamp.com/johncerpa
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:45
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
good :)
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:45
function sumPrimes(num) {

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

}
//  /\__/\
//->O <> O<-
//   \--/
sumPrimes(10);
Luciano
@StrikingLoo
Jan 15 2016 02:45
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
I also made a cute cat there xD
John Cerpa
@johncerpa
Jan 15 2016 02:46
hahaha
Alexander Køpke
@alexanderkopke
Jan 15 2016 02:48
well time to dance.. stay fresh! :)
Ryan
@ryanforever
Jan 15 2016 02:50
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
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
use
return result = lookup[val];
Hoang The Cong
@HoangTheCong
Jan 15 2016 02:57
stuck on Checkpoint: Profile Lookup
John Cerpa
@johncerpa
Jan 15 2016 02:57
paste your code
Hoang The Cong
@HoangTheCong
Jan 15 2016 02:57
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
@johncerpa but val is an array?
Andrew Charlebois
@andrewchar
Jan 15 2016 02:59
in which order should i learn these... javascript & JQuery
John Cerpa
@johncerpa
Jan 15 2016 02:59
no
val is a property
Jared Bardell
@darthredskin
Jan 15 2016 02:59
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
@HoangTheCong what does it return?
thorgall
@thorgall
Jan 15 2016 03:00
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
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
it return dobule quoute ""
thorgall
@thorgall
Jan 15 2016 03:00
I had a similar code anyway
aitruong
@aitruong
Jan 15 2016 03:01
@johncerpa thank you. Fixed!
CamperBot
@camperbot
Jan 15 2016 03:01
aitruong sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
:star: 249 | @johncerpa | http://www.freecodecamp.com/johncerpa
Ryan
@ryanforever
Jan 15 2016 03:01
well prop isn't always just a value...it can be an array too
thorgall
@thorgall
Jan 15 2016 03:01
@JSampaioL if you are using chrome, try switching to firefox.
John Cerpa
@johncerpa
Jan 15 2016 03:01
good :)
matthew3454
@matthew3454
Jan 15 2016 03:01
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
use modulus
operator
JSampaioL
@JSampaioL
Jan 15 2016 03:02
@thorgall I am, and I will
John Cerpa
@johncerpa
Jan 15 2016 03:02
@matthew3454 % modulus operator
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:02
@matthew3454 return number%divisor;
John Cerpa
@johncerpa
Jan 15 2016 03:02
11 % 2 = 1
munozu
@munozu
Jan 15 2016 03:02
@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
example
matthew3454
@matthew3454
Jan 15 2016 03:03
I'll try it @johncerpa
John Cerpa
@johncerpa
Jan 15 2016 03:03
paste the code if it fails
thorgall
@thorgall
Jan 15 2016 03:04
@JSampaioL had the same thing. It took me a while before I went: "heeeey, wait a minute..."
matthew3454
@matthew3454
Jan 15 2016 03:04
var remainder 11 % 3 = 2 @johncerpa
JSampaioL
@JSampaioL
Jan 15 2016 03:05
@munozu uh, awesome, worked like a charm. Thanks!
CamperBot
@camperbot
Jan 15 2016 03:05
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
hmmn
munozu
@munozu
Jan 15 2016 03:05
np :smile:
John Cerpa
@johncerpa
Jan 15 2016 03:05
let the computer do the operation
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:05
@matthew3454 it should be something like this ```
var remainder = 11%2;
matthew3454
@matthew3454
Jan 15 2016 03:06
var remainder=11%2;
@lmalvaran
JSampaioL
@JSampaioL
Jan 15 2016 03:07
@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
@lmalvaran it didn't seem to work.
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:08
@matthew3454 what exactly does the task says?
matthew3454
@matthew3454
Jan 15 2016 03:08
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
@matthew3454 var remainder = 11%3;
matthew3454
@matthew3454
Jan 15 2016 03:09
@lmalvaran Thank you!
CamperBot
@camperbot
Jan 15 2016 03:09
matthew3454 sends brownie points to @lmalvaran :sparkles: :thumbsup: :sparkles:
:star: 43 | @lmalvaran | http://www.freecodecamp.com/lmalvaran
matthew3454
@matthew3454
Jan 15 2016 03:09
what are brownie points?
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:09
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
I will thanks @lmalvaran
CamperBot
@camperbot
Jan 15 2016 03:10
matthew3454 sends brownie points to @lmalvaran :sparkles: :thumbsup: :sparkles:
:warning: matthew3454 already gave lmalvaran points
Ryan
@ryanforever
Jan 15 2016 03:10
@HoangTheCong hey did you figure it out?
Wessd8
@wessd8
Jan 15 2016 03:10
@matthew3454 brownie points are basically streaat cred
Ryan
@ryanforever
Jan 15 2016 03:10
My advice was actually not the best advice, now that I have taken a closer look :)
matthew3454
@matthew3454
Jan 15 2016 03:11
Can I buy something with them or just a good reputation? @wessd8
Wessd8
@wessd8
Jan 15 2016 03:11
@matthew3454 just a good rep :)
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:12
Artur
@ArturMC
Jan 15 2016 03:12
@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
here have one tak @matthew3454
CamperBot
@camperbot
Jan 15 2016 03:12
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
@ryanforever i'm not yet
Ryan
@ryanforever
Jan 15 2016 03:12
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
@ArturMC what is repo then
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:13
@HoangTheCong i think there's 3 situation in the problem and returning different output
Artur
@ArturMC
Jan 15 2016 03:14
@cannelflow repo's refer to your GitHub repositories
Jenni
@BookSprite
Jan 15 2016 03:14

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
It really doesn't have a function except to have other elements inside it
JSampaioL
@JSampaioL
Jan 15 2016 03:15
@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
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
@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
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
@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
@synflyn28 i find that some are better than others
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:20
sorry it should be var i=0; in the for loop @HoangTheCong
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:20
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
Oh yeah. Thanks for the help @ArturMC!
CamperBot
@camperbot
Jan 15 2016 03:20
synflyn28 sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
:star: 281 | @arturmc | http://www.freecodecamp.com/arturmc
Artur
@ArturMC
Jan 15 2016 03:20
@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
@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
@lmalvaran get rid of the last if statement. Just return it outside the function
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:21
@ArturMC it's hard to say because i just don't understand any of it.
Artur
@ArturMC
Jan 15 2016 03:21
@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
Lester Lucky Alvaran
@lmalvaran
Jan 15 2016 03:22
@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
@ArturMC i'm not looking for the answer, i just want to understand what is going on
wileyc427
@wileyc427
Jan 15 2016 03:24
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
@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
@JSDesign the map function goes through the array
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:24
ok
Artur
@ArturMC
Jan 15 2016 03:25
@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
ok so that's what map does then?
wow that makes sense now
Artur
@ArturMC
Jan 15 2016 03:26
@JSDesign pretty much.
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:26
ok simpler than i thought - i was overthinking i think heh
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:26
thanks a lot @ArturMC :)
CamperBot
@camperbot
Jan 15 2016 03:26
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
@ArturMC awesome, i'm reading it
Artur
@ArturMC
Jan 15 2016 03:30
@JSDesign wrong link >.<
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:31
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
jsdesign sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
:warning: jsdesign already gave arturmc points
Artur
@ArturMC
Jan 15 2016 03:31
@JSDesign yea that's my bad should of read it before sending :P
Jeannie Stevenson
@JSDesign
Jan 15 2016 03:31
:P
Ricardo Sanchez
@ricsanm
Jan 15 2016 03:32
// 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
@ricsanm your first two return values are completely wrong
@ricsanm start there
Mark David Teo
@volaix
Jan 15 2016 03:35
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
explain formatting
CamperBot
@camperbot
Jan 15 2016 03:35

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

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

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

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
@ArturMC ohhhh shiz. Thanks man!
CamperBot
@camperbot
Jan 15 2016 03:37
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
explain formatting
CamperBot
@camperbot
Jan 15 2016 03:37

: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
@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
who needs help
maybe I can help
Ricardo Sanchez
@ricsanm
Jan 15 2016 03:38
@harveysanders Ok let me check that Waypoint and I'll get back to you
Mark David Teo
@volaix
Jan 15 2016 03:39
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
@johncerpa I could use a hand on something
Artur
@ArturMC
Jan 15 2016 03:39
@samii1031 post away
John Cerpa
@johncerpa
Jan 15 2016 03:39
paste your code :)
check that out
John Cerpa
@johncerpa
Jan 15 2016 03:40
This message was deleted
This message was deleted
are you just testing the formatting
Harvey S
@harveysanders
Jan 15 2016 03:40
gotta go for a sec
Ricardo Sanchez
@ricsanm
Jan 15 2016 03:40
@harveysanders On it!
Artur
@ArturMC
Jan 15 2016 03:40
@harveysanders thanks for using moz dev
CamperBot
@camperbot
Jan 15 2016 03:40
arturmc sends brownie points to @harveysanders :sparkles: :thumbsup: :sparkles:
Mark David Teo
@volaix
Jan 15 2016 03:40
yeah i was just testing the formatting haha
CamperBot
@camperbot
Jan 15 2016 03:40
:star: 363 | @harveysanders | http://www.freecodecamp.com/harveysanders
John Cerpa
@johncerpa
Jan 15 2016 03:40
oh alright hahaha
Mark David Teo
@volaix
Jan 15 2016 03:41
cheers bro anyway!
John Cerpa
@johncerpa
Jan 15 2016 03:41
:)
Shawn Samii
@samii1031
Jan 15 2016 03:41
@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

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

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
@harveysanders When they ask to delete that prop if value is blank, they mean pop?
DJ
@qualitymanifest
Jan 15 2016 03:43
@gmiwakko pretty much but you want to return the shifted value
splucena
@splucena
Jan 15 2016 03:43
oftopic anyone who knows nginx?
Shawn Samii
@samii1031
Jan 15 2016 03:43
@qualitymanifest thanks I'll try it again
CamperBot
@camperbot
Jan 15 2016 03:43
samii1031 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 795 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Chris
@gmiwakko
Jan 15 2016 03:44
ok, show me what the heck to do
DJ
@qualitymanifest
Jan 15 2016 03:45
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
Untitled.png
hernc
@hernc
Jan 15 2016 03:45
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
@juanmtz03 use a dot before the class
Juan Martinez
@juanmtz03
Jan 15 2016 03:45
Some help? please
John Cerpa
@johncerpa
Jan 15 2016 03:45
like this
.smaller-image
Chris
@gmiwakko
Jan 15 2016 03:45
I have that line
John Cerpa
@johncerpa
Jan 15 2016 03:46
.red-text
Juan Martinez
@juanmtz03
Jan 15 2016 03:46
Ok bro
John Cerpa
@johncerpa
Jan 15 2016 03:46
inside the style
DJ
@qualitymanifest
Jan 15 2016 03:46
@gmiwakko nope. you're throwing that value away
@gmiwakko you want to return that value
John Cerpa
@johncerpa
Jan 15 2016 03:47
@juanmtz03 did it work?
DJ
@qualitymanifest
Jan 15 2016 03:48
@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
@hernc use bracket notation
collection[id][prop]
Artur
@ArturMC
Jan 15 2016 03:49

@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
to update the value and set the value
Chris
@gmiwakko
Jan 15 2016 03:49
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
collections[id][prop] = value;
hernc
@hernc
Jan 15 2016 03:49
@johncerpa thanks parce
CamperBot
@camperbot
Jan 15 2016 03:49
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
collections[id][prop].push(value);
parce hahahaha
hernc
@hernc
Jan 15 2016 03:49
thanks @ArturMC
CamperBot
@camperbot
Jan 15 2016 03:49
hernc sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
:star: 284 | @arturmc | http://www.freecodecamp.com/arturmc
Artur
@ArturMC
Jan 15 2016 03:49
@johncerpa don't give answers
John Cerpa
@johncerpa
Jan 15 2016 03:50
okay sorry
hernc
@hernc
Jan 15 2016 03:51
@johncerpa yea give those privately! jaja
John Cerpa
@johncerpa
Jan 15 2016 03:52
haha where are you from?
Artur
@ArturMC
Jan 15 2016 03:52
@hernc but then you don't learn. You each his own I guess :P
John Cerpa
@johncerpa
Jan 15 2016 03:52
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
@johncerpa especially since this is optional and the goal is just pure knowledge no grades ^.^
John Cerpa
@johncerpa
Jan 15 2016 03:56
that reminds me of school
Zaidiw
@Zaidiw
Jan 15 2016 03:57
Can anywhere here please help me with waypoint's size your images?
John Cerpa
@johncerpa
Jan 15 2016 03:57
what is it
paste your code
explain formatting
CamperBot
@camperbot
Jan 15 2016 03:57

: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
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

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

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
// 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
@batboy138 hey I saw you before ^.^ wb
John Cerpa
@johncerpa
Jan 15 2016 04:09
use bracket notation to access the property
Jon Spencer
@batboy138
Jan 15 2016 04:09
@ArturMC Whuddup?
hernc
@hernc
Jan 15 2016 04:09
@johncerpa medellin, but i'm in the us. got here when i was little
Artur
@ArturMC
Jan 15 2016 04:09
@batboy138 you want the variable to equal that and use brackets
John Cerpa
@johncerpa
Jan 15 2016 04:10
@hernc that's nice, I live in B/quilla
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:10
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
@qualitymanifest I got the first part, but how do call the other varibles?
hernc
@hernc
Jan 15 2016 04:10
@ArturMC nah I hear you guys about the cheating. i was just kidding. thanks for the help
CamperBot
@camperbot
Jan 15 2016 04:10
hernc sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
:warning: hernc already gave arturmc points
Artur
@ArturMC
Jan 15 2016 04:11
@hernc thank you come again :P
CamperBot
@camperbot
Jan 15 2016 04:11
arturmc sends brownie points to @hernc :sparkles: :thumbsup: :sparkles:
:star: 217 | @hernc | http://www.freecodecamp.com/hernc
hernc
@hernc
Jan 15 2016 04:11
@johncerpa oh nice. my sis is from san andres. don't know if its similiar
John Cerpa
@johncerpa
Jan 15 2016 04:12
@hernc it's close
Jon Spencer
@batboy138
Jan 15 2016 04:12
@ArturMC Aren't I already using bracket notation?
John Cerpa
@johncerpa
Jan 15 2016 04:12
@hernc but not really haha
@hernc san andres is an island
Artur
@ArturMC
Jan 15 2016 04:12
@batboy138 yea I was wrong. john confused me
Kenston
@kdrye72
Jan 15 2016 04:13
'''
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
:bulb: to format code use backticks! ``` more info
Artur
@ArturMC
Jan 15 2016 04:13
@batboy138 you were on point just put it into the variable
Rex Schrader
@SaintPeter
Jan 15 2016 04:13
@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
hi @SaintPeter
Rex Schrader
@SaintPeter
Jan 15 2016 04:13
@johncerpa Hola
John Cerpa
@johncerpa
Jan 15 2016 04:14
are you the owner of this great thing
or something
I like it
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:14
He's the patron saint of code
John Cerpa
@johncerpa
Jan 15 2016 04:14
ohh alright
Rex Schrader
@SaintPeter
Jan 15 2016 04:14
@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
ohh that's nice
good job man :)
Jon Spencer
@batboy138
Jan 15 2016 04:15
// 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
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
@johncerpa He made the Javascript curriculum so thank him for all those nights you raged haha :P
CamperBot
@camperbot
Jan 15 2016 04:15
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
hahahahaha
Kenston
@kdrye72
Jan 15 2016 04:15
Need help:
CHALLENGE:
'''Make the variable difference equal 12.
Only change the first line
Use the - operator
'''
CamperBot
@camperbot
Jan 15 2016 04:15
:bulb: to format code use backticks! ``` more info
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:15
@batboy138 that should be correct
Jon Spencer
@batboy138
Jan 15 2016 04:15
@allanarmstrong It is.
Rex Schrader
@SaintPeter
Jan 15 2016 04:15
@johncerpa @ArturMC I take full responsibility ;)
John Cerpa
@johncerpa
Jan 15 2016 04:15
it's challenging
so much better
that's how you actually learn
Artur
@ArturMC
Jan 15 2016 04:16
@SaintPeter tbh I expected more of a challenge ;)
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:16
@kdrye72 what problem is that
Jon Spencer
@batboy138
Jan 15 2016 04:16
@SaintPeter So YOU'RE the reason why we've got more waypoints to deal with!
John Cerpa
@johncerpa
Jan 15 2016 04:16
hahahah
Artur
@ArturMC
Jan 15 2016 04:16
@SaintPeter is that the best you got? :smile:
Rex Schrader
@SaintPeter
Jan 15 2016 04:16
@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
@batboy138 You'll thank me later ;)
CamperBot
@camperbot
Jan 15 2016 04:17
saintpeter sends brownie points to @batboy138 :sparkles: :thumbsup: :sparkles:
:star: 246 | @batboy138 | http://www.freecodecamp.com/batboy138
Artur
@ArturMC
Jan 15 2016 04:17
@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
Apperently I'll thank you now :D
Kenston
@kdrye72
Jan 15 2016 04:17
'''
var difference = 45 - 0;
var difference = 12 - 0;
'''
CamperBot
@camperbot
Jan 15 2016 04:17
:bulb: to format code use backticks! ``` more info
Shawn Samii
@samii1031
Jan 15 2016 04:17
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
@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
everything I'm going to learn in college I already know it
Rex Schrader
@SaintPeter
Jan 15 2016 04:17
@allanarmstrong My Checkpoint was "so good" it got turned into a Bonfire.
Jon Spencer
@batboy138
Jan 15 2016 04:18
@SaintPeter You're welcome, and thanks!
CamperBot
@camperbot
Jan 15 2016 04:18
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
@kdrye72 you dont need to define difference twice
@SaintPeter which one was that?
Artur
@ArturMC
Jan 15 2016 04:18
@allanarmstrong Caesar's Cipher
Rex Schrader
@SaintPeter
Jan 15 2016 04:18
@allanarmstrong Caesar's Cipher
IN STEREO
Except I spelled it wrong ;)
John Cerpa
@johncerpa
Jan 15 2016 04:18
I want to go to a meet up
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:18
@kdrye72 just find a number between 0 and 45 that's 12 away from 45
John Cerpa
@johncerpa
Jan 15 2016 04:18
People here don't like programming :(
Artur
@ArturMC
Jan 15 2016 04:18
I see no errors :smile:
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:19
@SaintPeter oh yeah that was fun one
Rex Schrader
@SaintPeter
Jan 15 2016 04:19
I :heart: Code
John Cerpa
@johncerpa
Jan 15 2016 04:19
Same man
I meant, where I live
Kenston
@kdrye72
Jan 15 2016 04:19
@allanarmstrong im looking over it
John Cerpa
@johncerpa
Jan 15 2016 04:19
I'm from Colombia, Barranquilla :)
Artur
@ArturMC
Jan 15 2016 04:20
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
@ArturMC I'll be bored when I start college
Rex Schrader
@SaintPeter
Jan 15 2016 04:20
Well, I was coming in to help out . . . but no one has problems right now?
John Cerpa
@johncerpa
Jan 15 2016 04:20
I guess not
Artur
@ArturMC
Jan 15 2016 04:20
@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
@SaintPeter I culd use some help on the word blank checkpoint
Rex Schrader
@SaintPeter
Jan 15 2016 04:21
@samii1031 Lay it on me
John Cerpa
@johncerpa
Jan 15 2016 04:21
@ArturMC I enjoy it
Shawn Samii
@samii1031
Jan 15 2016 04:22
I don't know how to call the 2nd set of words
Ricardo Sanchez
@ricsanm
Jan 15 2016 04:22
@SaintPeter Every time I come online you're helping people, that's awesome.
Kenston
@kdrye72
Jan 15 2016 04:22
@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
:bulb: to format code use backticks! ``` more info
Shawn Samii
@samii1031
Jan 15 2016 04:23
@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
@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
@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
but I dunno how to call the cats words
Rex Schrader
@SaintPeter
Jan 15 2016 04:23
@samii1031 The variables are like myNoun and myAdjective
Jeff Balenton
@infiniteiq83
Jan 15 2016 04:24
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

// 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
you need to make a sentence with that, right?
add spaces
Rex Schrader
@SaintPeter
Jan 15 2016 04:25
@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
I know but I'm lost on accessing it
Rex Schrader
@SaintPeter
Jan 15 2016 04:25
@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
Hi can somebody help me with this
Rex Schrader
@SaintPeter
Jan 15 2016 04:26
@infiniteiq83 You just chain together bracket and/or dot notation as appropriate
sukumarkutagulla
@sukumarkutagulla
Jan 15 2016 04:26

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
explain formatting
CamperBot
@camperbot
Jan 15 2016 04:27

: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
@sukumarkutagulla You need to use hasOwnProperty to determine if something has a property
sukumarkutagulla
@sukumarkutagulla
Jan 15 2016 04:27
java script 98 checkpoint
Rex Schrader
@SaintPeter
Jan 15 2016 04:27
@sukumarkutagulla This prop === contacts[firstName][prop] will never be true. Or is unlikely to be true.
sukumarkutagulla
@sukumarkutagulla
Jan 15 2016 04:27
where? @SaintPeter
Rex Schrader
@SaintPeter
Jan 15 2016 04:27
@sukumarkutagulla See above.
sukumarkutagulla
@sukumarkutagulla
Jan 15 2016 04:27
ok
Shawn Samii
@samii1031
Jan 15 2016 04:28
@SaintPeter ok, I'll give that a shot
Rex Schrader
@SaintPeter
Jan 15 2016 04:28
@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
// 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
John Cerpa
@johncerpa
Jan 15 2016 04:29
use bracket notation
Jon Spencer
@batboy138
Jan 15 2016 04:29
I think I'm doing something wrong...
John Cerpa
@johncerpa
Jan 15 2016 04:29
to access the array
Rex Schrader
@SaintPeter
Jan 15 2016 04:29
@batboy138 myPlants top level is an array. You need to use array bracket notation.
sukumarkutagulla
@sukumarkutagulla
Jan 15 2016 04:29
@batboy138 you need to replace trees with an array of
ok @allanarmstrong
Kenston
@kdrye72
Jan 15 2016 04:30
@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
kdrye72 sends brownie points to @allanarmstrong :sparkles: :thumbsup: :sparkles:
:star: 771 | @allanarmstrong | http://www.freecodecamp.com/allanarmstrong
Tyler
@Tyrelx
Jan 15 2016 04:31
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
var secondTree = myPlants[1].list[1]; // "pine" Thanks guys!
John Cerpa
@johncerpa
Jan 15 2016 04:32
good
:)
"alpha": "Adams"
Rex Schrader
@SaintPeter
Jan 15 2016 04:32
@Tyrelx You've got a lookup. You need to actually look val up in it.
John Cerpa
@johncerpa
Jan 15 2016 04:32
it's like a dictionary
Rex Schrader
@SaintPeter
Jan 15 2016 04:32
@johncerpa That aspect of their code will technically work as written
John Cerpa
@johncerpa
Jan 15 2016 04:33
hmmn
that's how I did it
is it the same?
Rex Schrader
@SaintPeter
Jan 15 2016 04:33
@johncerpa properties with no space are legal in JS
John Cerpa
@johncerpa
Jan 15 2016 04:33
oh I get it
Rex Schrader
@SaintPeter
Jan 15 2016 04:33
@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

@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
@SaintPeter Ok I fixed the second problem, how do I lookup val?
KoToZ
@Mohamedtareque
Jan 15 2016 04:35
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
This message was deleted
Rex Schrader
@SaintPeter
Jan 15 2016 04:35
@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
i stuck here as i can't under stand return in looping
Elifaz Filho
@Elifaz
Jan 15 2016 04:36
@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
@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
Jan 15 2016 04:37
@Mohamedtareque choose carefully where you want to place it and how many statements you want to make to fully cover the exercise request
KoToZ
@Mohamedtareque
Jan 15 2016 04:37
so @Elifaz how can i fix that as i use conditional if inside it and i wanna my iterating to be complete !
Rick Markins
@rkmarks
Jan 15 2016 04:38
Bondfire title case a sentence
Elifaz Filho
@Elifaz
Jan 15 2016 04:38
@Mohamedtareque if you want your loop to go down the drill try creating a variable and store the early result in that variable, and use return in the areas where you think the code should be finished by then. Give it a try and come back to us
KoToZ
@Mohamedtareque
Jan 15 2016 04:39
@SaintPeter how can i check every part in object or in loop !!
Jon Spencer
@batboy138
Jan 15 2016 04:39
// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

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


  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");
I'm so lost, I barely know where to begin. I think I'll need a if statement for this.
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:40
@batboy138 for loops and if statements
Netrunner12
@Netrunner12
Jan 15 2016 04:40
hey guys, how do I paste my code like others are doing?
Allan Armstrong
@allanarmstrong
Jan 15 2016 04:40
help format