These are chat archives for FreeCodeCamp/Help

13th
Jan 2016
Mateo Balcorta
@MrPocketPet
Jan 13 2016 00:00
@tommygebru How do I format my code like your example?
Deekshit.B.N
@deek28
Jan 13 2016 00:01

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

// Only change code below this line
function update(id, prop, value) {
switch(id)
{
case 2548: if(val !== "")
{
if(prop == "tracks")
{
collection[0].tracks.push(value);
}
else
{
collection[0].prop = value;
}
}

     break;
     case 2468:

if(val !== "")
{
if(prop == "tracks")
{
collection1.tracks.push(value);
}
else
{
collection1.prop = value;
}
}
break;
case 1245:
if(val !== "")
{
if(prop == "tracks")
{
collection2.tracks.push(value);
}
else
{
collection2.prop = value;
}
}
break;
case 5439:if(val !== "")
{
if(prop == "tracks")
{
collection3.tracks.push(value);
}
else
{
collection3.prop = value;
}
}
}
return collection;
}

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

tommy
@tommygebru
Jan 13 2016 00:01
@MrPocketPet ``` three backticks before and after the lines of your code
Hardcoremike
@Hardcoremike
Jan 13 2016 00:01

Waypoint: Assignment with a Returned Values

// Setup
var processed = 0;

function process(num) {
return (num + 3) / 5;
}

// Only change code below this line

Instructions
Call the process function with an argument of 7 and assign its return value to the variable processed.

I'm confused on how to call the function w/ an argument of 7. I tried changing the var processed to = 7 and then var processed = process(num) but I know that's not right, any help? Sorry I'm a noob

tommy
@tommygebru
Jan 13 2016 00:02
@Hardcoremike
var variable = 0 or ""
can have a value or string placed later
@MrPocketPet try formatting your code block
@deek28 very hard to read
Jennifer
@jjaurequi
Jan 13 2016 00:04
Why is the screen blank
William Walters
@Whwalter90
Jan 13 2016 00:04

Waypoint: Return Early Pattern for Function

Instructions
Modify the function abTest so that if a or b are less than 0 the function will immediately exit with a value of undefined.

// Setup
function abTest(a, b) {
// Only change code below this line

// Only change code above this line

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

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


On the above problem, I am not sure how to approach this. I know that a < 0 || b < 0 but not sure how to define this within the

section
Khan
@LegendaryKhan
Jan 13 2016 00:04
I still don't get it what is wrong?
Jennifer
@jjaurequi
Jan 13 2016 00:04
there's not way for me to attempt
Deekshit.B.N
@deek28
Jan 13 2016 00:05
@tommygebru it is waypoint 91 in javascript
Khan
@LegendaryKhan
Jan 13 2016 00:05

```<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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

h2 {
font-family: Lobster, Monospace;
}

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

.smaller-image {
width: 100px;
}
</style>

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

<img src="https://bit.ly/fcc-relaxing-cat" class=smaller-image>

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

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

William Walters
@Whwalter90
Jan 13 2016 00:05
I am assuming return undefined; will be a line but not sure how to display the or statement
Deekshit.B.N
@deek28
Jan 13 2016 00:05
please check it out
Khan
@LegendaryKhan
Jan 13 2016 00:05

```<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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

h2 {
font-family: Lobster, Monospace;
}

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

.smaller-image {
width: 100px;
}
</style>

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

<img src="https://bit.ly/fcc-relaxing-cat" class=smaller-image>

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

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

tommy
@tommygebru
Jan 13 2016 00:05
@deek28 a link and title is always preferable
Deekshit.B.N
@deek28
Jan 13 2016 00:06
Checkpoint: Record Collection
tommy
@tommygebru
Jan 13 2016 00:06
@LegendaryKhan smaller-image requires quotes
CompGeekGirl
@LisaRamos
Jan 13 2016 00:06

I'm still having trouble with CP: Counting Cards.

var count = 0;

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

  switch(card) {
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      count++;
      break;
    case 10:
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
      count--;
      break;
    default:
      break;
  }

  if(count === 0) {
    return count + "Bet";
  } else if(count === 0) {
    return count + "Hold";
  }
  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');

I'm still stuck and I don't know what I'm doing here. I would like some help please. Thanks.

tommy
@tommygebru
Jan 13 2016 00:07
@Whwalter90
The undefined property indicates that a variable has not been assigned a value, therefore we need to change the string to a property :smile:
Khan
@LegendaryKhan
Jan 13 2016 00:07
@tommygebru I added quotes but still nothing thiss is my code:

```<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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

h2 {
font-family: Lobster, Monospace;
}

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

.smaller-image {
width: 100px;
}
</style>

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

<img src="https://bit.ly/fcc-relaxing-cat" class="smaller-image">

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

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

Robert Richey
@0x0936
Jan 13 2016 00:08
@LisaRamos if count <= 0 Hold, else Bet
Justin Watson
@fallrisk
Jan 13 2016 00:08
@tommygebru https://christianalfoni.github.io/react-webpack-cookbook/Running-a-workflow.html This is litreally the greatest thing I have seen all day.
imedi
@imedi
Jan 13 2016 00:09
I'm having trouble with initializing variables
CompGeekGirl
@LisaRamos
Jan 13 2016 00:09
@0x0936 I tried that but it won't work.
var count = 0;

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

  switch(card) {
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      count++;
      break;
    case 10:
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
      count--;
      break;
    default:
      break;
  }

  if(count <= 0) {
    return count + "Bet";
  } else if(count === 0) {
    return count + "Hold";
  }
  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
Franco Zapata
@Francozt01
Jan 13 2016 00:09
@LisaRamos if (card <= 0) { return count + " Hold"; } else if (card >= 1) { return count + " Bet"; }
Ian
@IMLaing
Jan 13 2016 00:09
@imedi whats up?
tommy
@tommygebru
Jan 13 2016 00:10
@fallrisk that seems beyond me :worried:
Robert Richey
@0x0936
Jan 13 2016 00:10
@LisaRamos that's not what I wrote. check your conditions again
uCtrlr
@uCtrlr
Jan 13 2016 00:10
@LegendaryKhan what are the ' ' ' at the beginning and end for?
imedi
@imedi
Jan 13 2016 00:10
i can't seem to figure out how to initialize variables
for example
Franco Zapata
@Francozt01
Jan 13 2016 00:10
@LisaRamos where are the case 7,8,9 ? case 7: case 8: case 9: count = 0; break;
imedi
@imedi
Jan 13 2016 00:10
in java script
tommy
@tommygebru
Jan 13 2016 00:10
@uCtrlr formatting to look like this
like this
imedi
@imedi
Jan 13 2016 00:11
id like to make a have a value of 6
how would i go about doing this?
tommy
@tommygebru
Jan 13 2016 00:11
help format
CamperBot
@camperbot
Jan 13 2016 00:11

: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

CompGeekGirl
@LisaRamos
Jan 13 2016 00:11

@Francozt01 I tried doing this.

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

I got "" and it didn't go through.

Franco Zapata
@Francozt01
Jan 13 2016 00:11
@LisaRamos ur switch is wrong
CompGeekGirl
@LisaRamos
Jan 13 2016 00:11
@Francozt01 Maybe I'm forgetting those.
Franco Zapata
@Francozt01
Jan 13 2016 00:11
there are missed cases
lawrencebass
@lawrencebass
Jan 13 2016 00:11
@LisaRamos try switching the else if statement to a regular else and put a space before Bet and Hold
Mateo Balcorta
@MrPocketPet
Jan 13 2016 00:11
This message was deleted
Franco Zapata
@Francozt01
Jan 13 2016 00:12
7,8,9 should be count = 0;
uCtrlr
@uCtrlr
Jan 13 2016 00:12
@tommygebru Sorry I'm very new. Thanks! I figured it was some sort of chat format.
CamperBot
@camperbot
Jan 13 2016 00:12
uctrlr sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 289 | @tommygebru | http://www.freecodecamp.com/tommygebru
tommy
@tommygebru
Jan 13 2016 00:12
@MrPocketPet how you doing?
Ian
@IMLaing
Jan 13 2016 00:12
@imedi declare your variable and asign 6
Robert Richey
@0x0936
Jan 13 2016 00:12
@Francozt01 count doesn't get modified on 7, 8, 9 so it's ok to leave those out of the switch
Franco Zapata
@Francozt01
Jan 13 2016 00:13
@0x0936 ok
William Walters
@Whwalter90
Jan 13 2016 00:13
@tommygebru Thank you. I was able to get it.
CamperBot
@camperbot
Jan 13 2016 00:13
whwalter90 sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 290 | @tommygebru | http://www.freecodecamp.com/tommygebru
tommy
@tommygebru
Jan 13 2016 00:13
@LegendaryKhan still sizing images?
Pranav Doshi
@pranavdoshi
Jan 13 2016 00:13
wassup guys
tommy
@tommygebru
Jan 13 2016 00:14
welcome!
Robert Richey
@0x0936
Jan 13 2016 00:14
heya @pranavdoshi
Pranav Doshi
@pranavdoshi
Jan 13 2016 00:14
how r u
Robert Richey
@0x0936
Jan 13 2016 00:15
great. down to needing ziplines before earning front end cert :)
CompGeekGirl
@LisaRamos
Jan 13 2016 00:15
Now how do I still solve CP: Counting Cards?
var count = 0;

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

  switch(card) {
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      count++;
      break;
    case 10:
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
      count--;
      break;
    default:
      break;
  }

  if(card <= 0) {
    return count + "Bet";
  } else if(card >= 1) {
    return count + "Hold";
  }
  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
Diego Maranhão
@dmaranhao
Jan 13 2016 00:15
Hello
Franco Zapata
@Francozt01
Jan 13 2016 00:15
@LisaRamos my bad should be if (count <= 0) and else if (count >= 1) instead (card <= 0)
Diego Maranhão
@dmaranhao
Jan 13 2016 00:15
i'm stuck at 114
<script>
$(document).ready(function() {

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

});
</script>
Khan
@LegendaryKhan
Jan 13 2016 00:16
@tommygebru yes I am I have tried eveything thatI've searched for of people who also asked and followed what you told me but still dont see what is wrong
CompGeekGirl
@LisaRamos
Jan 13 2016 00:16
@Francozt01 I got 0Bet still.
Justin Watson
@fallrisk
Jan 13 2016 00:16
@tommygebru Just read through it slowly. It's not that bad.
Pranav Doshi
@pranavdoshi
Jan 13 2016 00:16
@dmaranhao wat happen
Khan
@LegendaryKhan
Jan 13 2016 00:16
Does it need a "/" at the end of the img?
tommy
@tommygebru
Jan 13 2016 00:16
@LegendaryKhan me neither try resetting
lawrencebass
@lawrencebass
Jan 13 2016 00:16
@LisaRamos To fix your statements you'd have to do something like this
 if(count > 0) {
    return count + " Bet";
  } else {
    return count + " Hold";
  }
Diego Maranhão
@dmaranhao
Jan 13 2016 00:17
I'm getting this error "Only add one class with each of your three selectors."
tommy
@tommygebru
Jan 13 2016 00:17
@LegendaryKhan possible it is a self-closing tag, try it !
Khan
@LegendaryKhan
Jan 13 2016 00:17
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

  .smaller-image {
    width: 100px;
  }
</style>

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

<img src="https://bit.ly/fcc-relaxing-cat" class="smaller-image">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Diego Maranhão
@dmaranhao
Jan 13 2016 00:17
And i don't know how to solve this problem
Anton Bredl
@antonbr13
Jan 13 2016 00:18
Help please!
var Car = function() {
  // this is a private variable
  var speed = 10;

  // these are public methods
  this.accelerate = function(change) {
    speed += change;
  };

  this.decelerate = function() {
    speed -= 5;
  };

  this.getSpeed = function() {
    return speed;
  };
};

// My Code below

var Bike = function() {

  // Only change code below this line.
  var gear = 4;

  this.setGear = function(change) {
    speed += change;
  };

  this.getGear = function() {
    speed -= 1;
  };



};

var myCar = new Car();

var myBike = new Bike();
CamperBot
@camperbot
Jan 13 2016 00:18
no wiki entry for: pleasevar car function this is a private variable var speed 10 these are public methods thisaccelerate functionchange speed change thisdecelerate function speed - 5 thisgetspeed function return speed my code belowvar bike function only change code below this line var gear 4 thissetgear functionchange speed change thisgetgear function speed - 1 var mycar new carvar mybike new bike
CompGeekGirl
@LisaRamos
Jan 13 2016 00:18
@lawrencebass I got 0Hold and it wouldn't go through based on the suggestion. :(
Anton Bredl
@antonbr13
Jan 13 2016 00:18
INSTRUCTIONS
Now try it yourself! Modify the Bike constructor to have a private property called gear and two public methods called getGear and setGear to get and set that value.
This message was deleted
lawrencebass
@lawrencebass
Jan 13 2016 00:19
@LisaRamos Don't forget to add the space
Anton Bredl
@antonbr13
Jan 13 2016 00:19

OBJECTIVES

The method getGear of myBike should be accessible outside the object.
The method setGear of myBike should be accessible outside the object.
myBike.gear should remain undefined.
myBike.getGear() should return 4 after myBike.setGear(4).

lawrencebass
@lawrencebass
Jan 13 2016 00:19
@LisaRamos
" Hold" and " Bet"
CompGeekGirl
@LisaRamos
Jan 13 2016 00:19
@lawrencebass I added space all right but nothing is happening. :(
Pranav Doshi
@pranavdoshi
Jan 13 2016 00:20
@antonbr13 can u post link to waypoint
Khan
@LegendaryKhan
Jan 13 2016 00:20
unless i try logging in and logging out?
lawrencebass
@lawrencebass
Jan 13 2016 00:22
@antonbr13 getGear should only return the value of gear
CompGeekGirl
@LisaRamos
Jan 13 2016 00:22
@lawrencebass Something is wrong here. I've been going crazy trying to fix everything and I'm still freaking out. :worried:
var count = 0;

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

  switch(card) {
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      count++;
      break;
    case 10:
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
      count--;
      break;
    default:
      break;
  }

  if (count > 0) {
    return count + "Hold";
  } else {
    return count + "Bet";
  }
  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
Irith Fuks
@irithfuks
Jan 13 2016 00:22
I dont understand what i have to do
lawrencebass
@lawrencebass
Jan 13 2016 00:23
Put a single space within the string "Hold" and "Bet". so It'd be " Hold" and " Bet" @LisaRamos
Pranav Doshi
@pranavdoshi
Jan 13 2016 00:23
@antonbr13 dude did u change the fcc prewriteen code??
uCtrlr
@uCtrlr
Jan 13 2016 00:23
@LegendaryKhan Which things don't check green when you run test?
CompGeekGirl
@LisaRamos
Jan 13 2016 00:24
@lawrencebass I'm still getting 0 Bet.
 if (count > 0) {
    return count + " Hold";
  } else {
    return count + " Bet";
  }
uCtrlr
@uCtrlr
Jan 13 2016 00:24
It looks the same as the code I created. idk why it wouldn't work
lawrencebass
@lawrencebass
Jan 13 2016 00:24
@antonbr13 and setGear should be changing the value of gear instead of speed
Nate Hutchison
@NateHutchison
Jan 13 2016 00:24
any hints for checkpoint: profile lookup ?
//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)
  return result;
  else if (firstName !== contacts)
    return "No such contact";
  else if (prop !== contacts)
    return "No such property";
// Only change code above this line
}


// Change these values to test your function
lookUp("Akira", "likes");
Anton Bredl
@antonbr13
Jan 13 2016 00:24
var Car = function() {
  // this is a private variable
  var speed = 10;

  // these are public methods
  this.accelerate = function(change) {
    speed += change;
  };

  this.decelerate = function() {
    speed -= 5;
  };

  this.getSpeed = function() {
    return speed;
  };
};

// My Code below

var Bike = function() {

  // Only change code below this line.
  var gear = 4;

  this.setGear = function() {

  };

  this.getGear = function() {
    return gear;
  };



};

var myCar = new Car();

var myBike = new Bike();
I got it somehow - gonna have to look over it to better understand tho!
Khan
@LegendaryKhan
Jan 13 2016 00:25
@uCtrlr This doesn't check red: Your image should be 100 pixels wide.
Anton Bredl
@antonbr13
Jan 13 2016 00:26
thanks @pranavdoshi
CamperBot
@camperbot
Jan 13 2016 00:26
antonbr13 sends brownie points to @pranavdoshi :sparkles: :thumbsup: :sparkles:
:star: 287 | @pranavdoshi | http://www.freecodecamp.com/pranavdoshi
tommy
@tommygebru
Jan 13 2016 00:26
@NateHutchison I don't know if the condition (firstName && prop) evaluates to anything....
smk319
@smk319
Jan 13 2016 00:26
I'm also trying to solve the card counting checkpoint and I've gotten the result {} from this:
var count = 0;

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

    return "Change Me";
}
lawrencebass
@lawrencebass
Jan 13 2016 00:26
@LisaRamos Try refreshing your browser
Nate Hutchison
@NateHutchison
Jan 13 2016 00:27
@tommygebru yeah...I'm not sure what I'm doing...been researching how to do it...
lawrencebass
@lawrencebass
Jan 13 2016 00:27
This message was deleted
chantaldesiree
@chantaldesiree
Jan 13 2016 00:27
I'm not sure if it was supposed to be done this way, but I just finished the card counting Waypoint with an if/else if/else statement.
tommy
@tommygebru
Jan 13 2016 00:27
@NateHutchison this challenge deserve paper and pencil !
CompGeekGirl
@LisaRamos
Jan 13 2016 00:28

@lawrencebass I tried refreshing my browser and nothing is working.

var count = 0;

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

  switch(card) {
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      count++;
      break;
    case 10:
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
      count--;
      break;
    default:
      break;
  }

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

  return "Change Me";
  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');

Still getting 0 Bet.

lawrencebass
@lawrencebass
Jan 13 2016 00:28
@antonbr13
  this.setGear = function(change) {
          gear += change;
  };
Nate Hutchison
@NateHutchison
Jan 13 2016 00:28
@tommygebru does that help you, writing it on paper sometimes?
tommy
@tommygebru
Jan 13 2016 00:29
yes the checkpoints are trickier than waypoints
Brad940
@Brad940
Jan 13 2016 00:29

Hi, I'm stuck at Waypoint: Using Objects for Lookups. My code

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

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

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

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

The response from the console is "" no matter what I change the value to. I need a clue as to what I'm missing.

chantaldesiree
@chantaldesiree
Jan 13 2016 00:29

'''
if (card == 2 || card == 3 || card == 4 || card == 5 || card == 6) {
count++;
var choice = "Bet";
}
else if (card == 10 || card == 'J' || card == 'Q' || card == 'K' || card == 'A') {
count--;
var choice = "Hold";
}
else {
var choice = "Hold";
}

return count + " " + choice;
'''

CamperBot
@camperbot
Jan 13 2016 00:29
:bulb: to format code use backticks! ``` more info
chantaldesiree
@chantaldesiree
Jan 13 2016 00:29
oops. fail.
Pathrinathan (Pat). P
@pathmanp
Jan 13 2016 00:30
@LisaRamos I just made this worked.
chantaldesiree
@chantaldesiree
Jan 13 2016 00:30
  if (card == 2 || card == 3 || card == 4 || card == 5 || card == 6) {
    count++;
    var choice = "Bet";
  }
  else if (card == 10 || card == 'J' || card == 'Q' || card == 'K' || card == 'A') {
    count--;
    var choice = "Hold";
  }
  else {
    var choice = "Hold";
  }

  return count + " " + choice;
uCtrlr
@uCtrlr
Jan 13 2016 00:30
@LegendaryKhan does the image shrink on the side when you added the smaller-image class?
lawrencebass
@lawrencebass
Jan 13 2016 00:30
@LisaRamos remove default: break;
case and the return "Change Me"
Darren
@TheLurkingDev
Jan 13 2016 00:30
Hi! I am on the next to the last question in the Bootstrap section. Each time I make my changes and then click "Run tests", nothing happens. I see the title in the tab flash, as though the page was refreshed via a submit. I have tried doing a hard refresh, I have tied resetting the code and making my changes again.
greg
@wearenotgroot
Jan 13 2016 00:30
@NateHutchison use .hasOwnProperty(arg) to check if the property exist!
Pathrinathan (Pat). P
@pathmanp
Jan 13 2016 00:31
@LisaRamos Do u want me to post the solution?
lawrencebass
@lawrencebass
Jan 13 2016 00:31
@LisaRamos Should end up with something like this
var count = 0;

function cc(card) {
  // Only change code below this line
  switch(card){
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      count++;
      break;
    case 10:
    case "J":
    case "Q":
    case "K":
    case "A":
      count--;
      break;
  }

  if(count > 0){
      return count + " Bet";
  } else {
      return count + " Hold";
  }
  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
CompGeekGirl
@LisaRamos
Jan 13 2016 00:31
@code4ninja Sure, go ahead.
Pathrinathan (Pat). P
@pathmanp
Jan 13 2016 00:32

@LisaRamos
var count = 0;

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

switch (card){

case 2:
case 3:
case 4:
case 5:
case 6:
  count++;
  return count + " Bet";
  break;

case 7:
case 8:
case 9:
  count = count + 0;
  return count + " Hold";
  break;

case 10:
case "J":
case "Q":
case "K":
case "A":
  count--;
  return count + " Hold";
  break;

}
// Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(3); cc(2); cc("A"); cc(10); cc("K");

CompGeekGirl
@LisaRamos
Jan 13 2016 00:32
@lawrencebass @code4ninja Now I got it. Thanks.
CamperBot
@camperbot
Jan 13 2016 00:32
lisaramos sends brownie points to @lawrencebass and @code4ninja :sparkles: :thumbsup: :sparkles:
:star: 241 | @lawrencebass | http://www.freecodecamp.com/lawrencebass
:star: 206 | @code4ninja | http://www.freecodecamp.com/code4ninja
lawrencebass
@lawrencebass
Jan 13 2016 00:33
@LisaRamos Np
Pathrinathan (Pat). P
@pathmanp
Jan 13 2016 00:33
@LisaRamos But, lisa, do u know how it was adding the total of all three scenarios?
tommy
@tommygebru
Jan 13 2016 00:33
@NateHutchison all the solutions for profile lookup so far has used a for loop
Pathrinathan (Pat). P
@pathmanp
Jan 13 2016 00:34
@tommygebru do u know how it was adding the total of all three scenarios for the one that I posted above?
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 00:34

Hi everyone, Anyone could help me how to define algorithm in this code? I am trying to convert Celsius to Fahrenheit function convert(celsius) {
// Only change code below this line

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

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

Khan
@LegendaryKhan
Jan 13 2016 00:34
@uCtrlr Yea it does shrink
greg
@wearenotgroot
Jan 13 2016 00:35
@NateHutchison remember there are serveral items in the contacts array so you have to loop through it. then check if the firstName is equal to a contacts firstName, then check if .hasOwnProperty(prop) exist
Khan
@LegendaryKhan
Jan 13 2016 00:35
@uCtrlr But it won't check green
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 00:35

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

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

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

96street
@96street
Jan 13 2016 00:35
i have two questions: 1. how do I add margin-top to my yellow box at the bottom (.line-story-div) 2. how do i make the yellow background at the bottom only cover the content and not 100% width like it is now http://codepen.io/anon/pen/yeXpYL
tommy
@tommygebru
Jan 13 2016 00:35
@code4ninja are you asking i explain this
if(count > 0){
return count + " Bet";
} else {
return count + " Hold";
}
Pathrinathan (Pat). P
@pathmanp
Jan 13 2016 00:35
@tommygebru I guess, its cuz, global count is set outside of function and every time it breaks, it’s adding to the count outside. Is it?
Deekshit.B.N
@deek28
Jan 13 2016 00:36
can any1 help me with waypoint 91.Checkpoint: Record Collection Incomplete  and 98.Checkpoint: Profile Lookup Incomplete  in basic javascript?
R. E. Daniels
@RDaniels34
Jan 13 2016 00:36
I'm doing the lesson on embedding an icon into a button. I have...
Pranav Doshi
@pranavdoshi
Jan 13 2016 00:37
wat error
facing guys
Darren
@TheLurkingDev
Jan 13 2016 00:37
Hi! I am on the next to the last question in the Bootstrap section. Each time I make my changes and then click "Run tests", nothing happens. I see the title in the tab flash, as though the page was refreshed via a submit. I have tried doing a hard refresh, I have tied resetting the code and making my changes again.
tommy
@tommygebru
Jan 13 2016 00:37
@code4ninja i believe so :+1:
lawrencebass
@lawrencebass
Jan 13 2016 00:37
@HaroonGhawsi The algorithm to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32.
celsius*(9.0/5.0) + 32.0;
R. E. Daniels
@RDaniels34
Jan 13 2016 00:38
I'm doing the lesson on embedding an icon into a button. I have... html <button class="btn btn-block btn-primary"><i class="fa fa-thumbsup">Like</i> </button> but it's not being inserted into the button.... Any help?
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 00:38
@lawrencebass Thank you. Where to mention it in the code?
CamperBot
@camperbot
Jan 13 2016 00:38
haroonghawsi sends brownie points to @lawrencebass :sparkles: :thumbsup: :sparkles:
:star: 242 | @lawrencebass | http://www.freecodecamp.com/lawrencebass
Pathrinathan (Pat). P
@pathmanp
Jan 13 2016 00:38
@tommygebru ok
lawrencebass
@lawrencebass
Jan 13 2016 00:39
@HaroonGhawsi Above the if statements between the two comments, don't forget to equate "fahrenheit" to the algorithm
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 00:40
@lawrencebass Thank you. just got done it.
CamperBot
@camperbot
Jan 13 2016 00:40
haroonghawsi sends brownie points to @lawrencebass :sparkles: :thumbsup: :sparkles:
:warning: haroonghawsi already gave lawrencebass points
William Walters
@Whwalter90
Jan 13 2016 00:40
Just realized that there is an issue with the checkpoint for counting cards. You can still pass that test even when I get a result of 1 hold which shouldn't happen as its a positive number.
smk319
@smk319
Jan 13 2016 00:40
welp i have no idea how i got through the card counting checkpoint but I did it! I definitely need to review js a lot more
lawrencebass
@lawrencebass
Jan 13 2016 00:41
@HaroonGhawsi No problem
dorkybelle
@dorkybelle
Jan 13 2016 00:41
@LegendaryKhan <img class ="smaller-image" src="etc">
Santiago de la Torre
@iargonut
Jan 13 2016 00:41
Your a element should be a dead link with a href attribute set to "#".
can anyone help ??
dont understand how the code should look like
R. E. Daniels
@RDaniels34
Jan 13 2016 00:42
@iargonut should look something like <a href="#"></a>
@smk319 reread the instructions and what passes... then share what you do understand
Santiago de la Torre
@iargonut
Jan 13 2016 00:44
@RDaniels34 thanks !!!
CamperBot
@camperbot
Jan 13 2016 00:44
iargonut sends brownie points to @rdaniels34 :sparkles: :thumbsup: :sparkles:
:star: 87 | @rdaniels34 | http://www.freecodecamp.com/rdaniels34
tommy
@tommygebru
Jan 13 2016 00:44
@TheLurkingDev still in Bootstrap?
uCtrlr
@uCtrlr
Jan 13 2016 00:44
@dorkybelle does the order matter?
tommy
@tommygebru
Jan 13 2016 00:45
@uCtrlr try switching the order
R. E. Daniels
@RDaniels34
Jan 13 2016 00:45
@iargonut glad to help!! and thanks for the thumbs up too!!
CamperBot
@camperbot
Jan 13 2016 00:45
rdaniels34 sends brownie points to @iargonut :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for iargonut
Andrew Kumlin
@Kumlin
Jan 13 2016 00:45
Anyone else here finish the Checkpoint: Profile Lookup? I just did and I'm sure there is a shorter way to do it. Please let me know if you think you can help, and I'll post my code!
Tony Miri
@TonyMiri
Jan 13 2016 00:45
So something is happening with my first test here. I can't figure it out because my second test returns correctly. Any help?
function lookUp(firstName, prop){
// Only change code below this line
 for (var i = 0; i <= contacts.length; i++) {
   if (contacts[i].firstName === firstName && contacts[i].hasOwnProperty(prop)) {
     return contacts[i].prop;
   } else if (contacts[i].firstName == firstName && !contacts[i].hasOwnProperty(prop)){
     return "No such property"; 
   } else {
     return "No such contact";    
   } 
 }
tommy
@tommygebru
Jan 13 2016 00:46
@NateHutchison how you doing
@Kumlin i would love to see your code
R. E. Daniels
@RDaniels34
Jan 13 2016 00:47
Any idea on using Font Awesome to insert the thumbs up in a button? I have... <button class="btn btn-block btn-primary"><i class="fa fa-thumbsup">Like</i> </button> but it's not being inserted into the button.... Any help?
Andrew Kumlin
@Kumlin
Jan 13 2016 00:47
@tommygebru Don't laugh at me to hard lol!
```

```function lookUp(firstName, prop){
// Only change code below this line

var catcherName = 0;
var catcherProp = 0;
for (var i = 0; i < contacts.length; i++){
if (contacts[i].firstName !== firstName){
catcherName++;
}
if (!contacts[i][prop]){
catcherProp++;
}
}
if (catcherName == contacts.length){
return "No such contact";
}else if(catcherProp == contacts.length){
return "No such property";
}
for(var j = 0; j < contacts.length; j++){
if(contacts[j].firstName == firstName){
return contacts[j][prop];
}
}
return contacts[firstName][prop];
// Only change code above this line
}

uCtrlr
@uCtrlr
Jan 13 2016 00:47
@tommygebru it's @LegendaryKhan issue. I was just trying to figure it out as well. His code looks the same as mine. I just wanted to know if order mattered.
Andrew Kumlin
@Kumlin
Jan 13 2016 00:47
Well I can't chat today
function lookUp(firstName, prop){
// Only change code below this line

  var catcherName = 0;
  var catcherProp = 0;
  for (var i = 0; i < contacts.length; i++){
    if (contacts[i].firstName !== firstName){
      catcherName++;
    } 
    if (!contacts[i][prop]){
      catcherProp++;
    }
  }
  if (catcherName == contacts.length){
    return "No such contact";
  }else if(catcherProp == contacts.length){
    return "No such property";
  } 
  for(var j = 0; j < contacts.length; j++){
    if(contacts[j].firstName == firstName){
      return contacts[j][prop];
    }  
  }
  return contacts[firstName][prop];  
// Only change code above this line
}
greg
@wearenotgroot
Jan 13 2016 00:48
@FatTone225 use return conatact[i][prop]
Darren
@TheLurkingDev
Jan 13 2016 00:48
@tommygebru Yes.
dorkybelle
@dorkybelle
Jan 13 2016 00:48
@tommygebru @uCtrlr @LegendaryKhan I'm not sure if order matters. But was missing class="smaller-image"
greg
@wearenotgroot
Jan 13 2016 00:48
@Kumlin you can revise that code to reduce the for loop
tommy
@tommygebru
Jan 13 2016 00:49
@TheLurkingDev Waypoint: Use Comments to Clarify Code ?
Andrew Kumlin
@Kumlin
Jan 13 2016 00:49
@wearenotgroot Yeah that's why I'm posting it because I finished the checkpoint, but I know I can make this better.
Just not sure what I need to do exactly
greg
@wearenotgroot
Jan 13 2016 00:49
@Kumlin you only really need 1 for loop
Andrew Kumlin
@Kumlin
Jan 13 2016 00:50
I went one day of not coding after learning what a JSON was and I felt like I forgot everything
Tony Miri
@TonyMiri
Jan 13 2016 00:50
@wearenotgroot Ok that helps. Thanks.
CamperBot
@camperbot
Jan 13 2016 00:50
fattone225 sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 389 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
tommy
@tommygebru
Jan 13 2016 00:50
@Kumlin wow i havent seen this type of solution
greg
@wearenotgroot
Jan 13 2016 00:50
@Kumlin you can either store the result of the lookup in a variable then test it outside the for loop or just make sure the if test is correctly arrange
tommy
@tommygebru
Jan 13 2016 00:50
@dorkybelle were you able to pass?
Brad940
@Brad940
Jan 13 2016 00:51
Can anyone please give me a clue of what I'm missing here? Waypoint Using objects for Lookups.
// Setup
function phoneticLookup(val) {
  var result = "";

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

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

// Change this value to test
phoneticLookup("delta");
dorkybelle
@dorkybelle
Jan 13 2016 00:51
@tommygebru nope still stuck :( .
Ray
@rbjr
Jan 13 2016 00:51
help v
CamperBot
@camperbot
Jan 13 2016 00:51
Ray
@rbjr
Jan 13 2016 00:51
help Checkpoint: Record Collection
CamperBot
@camperbot
Jan 13 2016 00:51

:point_right: checkpoint record collection [wiki]

Checkpoint: Record Collection

Instructions

You are given a JSON object representing (a small part of) your record collection. Each album is identified by a unique id number and has several properties. Not all albums have complete information.

Write a function which takes an id, a property (prop), and a value.

For the given id in collection:

If value is non-blank (value !== ""), then update or set the value for the prop.

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

If value is blank, delete that prop.

Always return the entire collection object.

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

:pencil: read more about checkpoint record collection on the FCC Wiki

Andrew Kumlin
@Kumlin
Jan 13 2016 00:51
@wearenotgroot Alright I'm gonna comment out the good code and redo it
greg
@wearenotgroot
Jan 13 2016 00:52
@Kumlin :+1:
@Brad940 use key:value pair to get result. remember how to get result from an array with objects
tommy
@tommygebru
Jan 13 2016 00:53
@Brad940 Use the parameter(val) of the function to access the object lookup within the function :smile:
This is similar to the previous exercise... work carefully
dorkybelle
@dorkybelle
Jan 13 2016 00:54

@tommygebru http://www.freecodecamp.com/challenges/waypoint-assignment-with-a-returned-value

I've tried several different things....assigning process to processed is just not happening...

// Setup
var processed = 0;

function process(num) {
return (num + 3) / 5;
}

// Only change code below this line

var processed = 2;
'use strict';

function process (num) {
var process = "7";
return process;
}
processed =process;

Nate Hutchison
@NateHutchison
Jan 13 2016 00:54
@tommygebru taking break, eating dinner; I'll let you know asap...
tommy
@tommygebru
Jan 13 2016 00:54
@FatTone225 how you doing with Profile Lookup?
Tony Miri
@TonyMiri
Jan 13 2016 00:54
@tommygebru Working on it. I'm adding some console.logs to see what's going on.
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 00:54

Hi guys, How can I single quote the below string?

var myStr = "<a href=\"http://www.example.com\" target=\"_blank\">Link</a>";

Darren
@TheLurkingDev
Jan 13 2016 00:55
@tommygebru No - "Label Bootstrap Buttons". I have reset my changes and tried to click "Run Tests" and it still does not work.
William Walters
@Whwalter90
Jan 13 2016 00:55
Where would I go to report code succeeding on a lesson when it should fail?
greg
@wearenotgroot
Jan 13 2016 00:56
@Whwalter90 report bug button?
William Walters
@Whwalter90
Jan 13 2016 00:57
Ahh I feel dumb for missing that. Thank you.
greg
@wearenotgroot
Jan 13 2016 00:58

Hint for Profile Lookup.

Use nested if statement
You have to check each item on the contacts array
CamperBot
@camperbot
Jan 13 2016 00:58
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
chantaldesiree
@chantaldesiree
Jan 13 2016 00:58
@Brad940 I'm also pretty sure you need to keep the "" around your "alpha" "bravo" parts.
lawrencebass
@lawrencebass
Jan 13 2016 00:59
@Brad940 If you notice at the bottom "delta" is being passed to your function as val but you object lookup table isn't doing anything with it. You should use a switch statement example:
switch(val) {
    case "alpha": 
      result = "Adams";
      break;
    // Fill out the rest
};
chantaldesiree
@chantaldesiree
Jan 13 2016 00:59
@lawrencebass the lesson says not to use a switch or if/else statement.
Tony Miri
@TonyMiri
Jan 13 2016 00:59
@tommygebru I'm kind of stuck though.
tommy
@tommygebru
Jan 13 2016 01:00
@dorkybelle
var variable = 0 or "" //means we can assign value or strings to the variable later :smile:
Be sure to check the hints under the console !
Brad940
@Brad940
Jan 13 2016 01:00
@lawrencebass I have to convert from switch to a lookup table.
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 01:00

Guys, how to single quote the below string?

var myStr = "<a href=\"http://www.example.com\" target=\"_blank\">Link</a>";

Hai Hu
@haih
Jan 13 2016 01:01
@HaroonGhawsi var myStr = '<a href=\"http://www.example.com\" target=\"_blank\">Link</a>';
Brad940
@Brad940
Jan 13 2016 01:01
@chantaldesiree I made the change you suggested but no dice.
chantaldesiree
@chantaldesiree
Jan 13 2016 01:01
@Brad940 At the bottom, you need to use your function: result = lookup(val), also.
dorkybelle
@dorkybelle
Jan 13 2016 01:02
@tommygebru the only hint I was given is You should assign process to processed
tommy
@tommygebru
Jan 13 2016 01:02
@dorkybelle
var variable=""
function(){
variable="newstring"
}
Tony Miri
@TonyMiri
Jan 13 2016 01:02
@tommygebru
function lookUp(firstName, prop){
// Only change code below this line
 for (var i = 0; i < contacts.length; i++) {
   if (contacts[i].firstName === firstName && contacts[i].hasOwnProperty(prop)) {
     console.log(contacts[i][prop]);
     return contacts[i][prop];
   } else if (contacts[i].firstName == firstName && !contacts[i].hasOwnProperty(prop)){
     console.log("No such property");
     return "No such property"; 
   } else {
     console.log("No such contact");
     return "No such contact";    
   } 
 }
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 01:02
@haih , thank you
CamperBot
@camperbot
Jan 13 2016 01:02
haroonghawsi sends brownie points to @haih :sparkles: :thumbsup: :sparkles:
:star: 202 | @haih | http://www.freecodecamp.com/haih
Hai Hu
@haih
Jan 13 2016 01:03
@HaroonGhawsi wlc
Tony Miri
@TonyMiri
Jan 13 2016 01:03
@tommygebru When it tests the initial case it logs the expected value to the console. The next cases following that don't though.
greg
@wearenotgroot
Jan 13 2016 01:03
@FatTone225 almost. try nesting the if cases instead
tommy
@tommygebru
Jan 13 2016 01:04
the initial case is the first if statement right?
Emile Choghi
@echoghi
Jan 13 2016 01:04
does anyone know how I can put one background above another like in the example zipline portfolio?
lawrencebass
@lawrencebass
Jan 13 2016 01:04

@Brad940 Oh okay, sorry about that. Then the only thing you need to add is

result = lookup[val];

before you return results. Because if you remember from earlier lessons there are two ways of accessing data within objects, either using "."(dot notation) or "[ ]" (brackets)

Tony Miri
@TonyMiri
Jan 13 2016 01:04
@tommygebru I mean when the function is actually called at the bottom of the code on the Checkpoint
That returns properly
After that none of the other calls return properly
Teleisha Hall
@hallnt
Jan 13 2016 01:05
@R0k0 i only used one for loop, not two and i used the.hasOwnProperty to check firstname and prop
Tony Miri
@TonyMiri
Jan 13 2016 01:05
@wearenotgroot I see. I'll give it a shot
greg
@wearenotgroot
Jan 13 2016 01:05
@FatTone225 also there is no need to return value immediately. remember you have to check the entire contacts
tommy
@tommygebru
Jan 13 2016 01:06
@echoghi have you been able to get help in the Zipline room?
https://gitter.im/orgs/FreeCodeCamp/rooms/
lavieb33
@lavieb33
Jan 13 2016 01:06
hello! can anyone out there tell me how to go back and change my previous code?
Emile Choghi
@echoghi
Jan 13 2016 01:06
@tommygebru nope
tommy
@tommygebru
Jan 13 2016 01:07
@echoghi you havent tried or havent recieved help?
lavieb33
@lavieb33
Jan 13 2016 01:07
haven't
Emile Choghi
@echoghi
Jan 13 2016 01:07
it just a simple CSS question but I can't seem to find anything about it online and no one responded in the zipline room
tommy
@tommygebru
Jan 13 2016 01:07
@lavieb33 undo
lavieb33
@lavieb33
Jan 13 2016 01:07
undo the source code?
Brian
@sludge256
Jan 13 2016 01:08
@lavieb33 can you be more specific when you say changing your previous code?
tommy
@tommygebru
Jan 13 2016 01:09
@echoghi I would like to be notified if you can get two backgrounds to work! I tried and failed miserably...... google
96street
@96street
Jan 13 2016 01:10
hey guys, struggling abit. i have two questions: 1. how do I add margin-top to my yellow box at the bottom (.line-story-div) 2. how do i make the yellow background at the bottom only cover the content and not 100% width like it is now http://codepen.io/anon/pen/yeXpYL
help appreciated
CamperBot
@camperbot
Jan 13 2016 01:10
no wiki entry for: appreciated
lavieb33
@lavieb33
Jan 13 2016 01:10
I made a mistake while trying to add a class on img then I hit the back button and now no longer able to make any change as I lost the image
Emile Choghi
@echoghi
Jan 13 2016 01:10
@tommygebru will do! I've found articles on how to stack multiple backgrounds on top of each other but not one after another
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 01:11

Why is this code not contaenating?

var myStr = "This is the start. " + " This is the end.";

Concatenating
tommy
@tommygebru
Jan 13 2016 01:12
@96street
Have you been helped in the other FreeCodeCamp Rooms :smile:
https://gitter.im/orgs/FreeCodeCamp/rooms/
@HaroonGhawsi that looks good try resetting and check the hints in the console
96street
@96street
Jan 13 2016 01:12
isn't this a 'help' room?
@tommygebru
tommy
@tommygebru
Jan 13 2016 01:13
@96street yes there are many
96street
@96street
Jan 13 2016 01:13
i went to the free chat room and they told me to come here @tommygebru
Julien Brault
@julienbrault
Jan 13 2016 01:13
I'm at Checkpoint: Word Blanks in the Javascript exercises and the task is so vague I have no idea what I'm supposed to code. I know its some kind of game, but I really don't understand what is the requirement. Did somebody had the same issue?
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 01:13
@96street, kool thanks
CamperBot
@camperbot
Jan 13 2016 01:13
haroonghawsi sends brownie points to @96street :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for 96street
Brad940
@Brad940
Jan 13 2016 01:14
@lawrencebass @tommygebru @wearenotgroot Thanks for your help and clues. Got there in the end.
CamperBot
@camperbot
Jan 13 2016 01:14
brad940 sends brownie points to @lawrencebass and @tommygebru and @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 243 | @lawrencebass | http://www.freecodecamp.com/lawrencebass
:star: 390 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
:star: 291 | @tommygebru | http://www.freecodecamp.com/tommygebru
Andrew Kumlin
@Kumlin
Jan 13 2016 01:14
@tommygebru @wearenotgroot I gotta go but I'm still working on this puzzle!
matthewahiles
@matthewahiles
Jan 13 2016 01:14
I'm feeling silly with this waypoint about style prioritization

<style>

pink-text {
color: pink;
}

body {
background-color: black;
font-family: Monospace;
color: green;
}

</style>

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

greg
@wearenotgroot
Jan 13 2016 01:14
@Brad940 good job
@Kumlin ok. GL
matthewahiles
@matthewahiles
Jan 13 2016 01:14
I'm not sure why my pink-text class isn't changing the color
greg
@wearenotgroot
Jan 13 2016 01:15
@matthewahiles misiing . on the pink-text{}
matthewahiles
@matthewahiles
Jan 13 2016 01:15
@wearenotgroot thank you
lawrencebass
@lawrencebass
Jan 13 2016 01:15
@julienbrault Its just a concatenation exercise, its asking you to build a long string sentence given the users input
matthewahiles
@matthewahiles
Jan 13 2016 01:15
I feel silly
greg
@wearenotgroot
Jan 13 2016 01:15
@matthewahiles you'll get the hang of it!
lawrencebass
@lawrencebass
Jan 13 2016 01:16
This message was deleted
@julienbrault
example:
result = "Blah Blah Blah" + myAdjective + " " + myNoun + " " + myVerb + " " + myAdverb + " Blah Blah";
Julien Brault
@julienbrault
Jan 13 2016 01:17
@lawrencebass Oh, they could have been more clear. Thanks so much for the help! I really was stucked.
CamperBot
@camperbot
Jan 13 2016 01:17
julienbrault sends brownie points to @lawrencebass :sparkles: :thumbsup: :sparkles:
:star: 244 | @lawrencebass | http://www.freecodecamp.com/lawrencebass
zhangkenny
@zhangkenny
Jan 13 2016 01:18
Hello World!
CamperBot
@camperbot
Jan 13 2016 01:18

welcome to FreeCodeCamp @zhangkenny!

Frank
@franky-boy-from-fl
Jan 13 2016 01:18
hi eveyone
greg
@wearenotgroot
Jan 13 2016 01:18
@zhangkenny Welcome
@franky-boy-from-fl O/
Frank
@franky-boy-from-fl
Jan 13 2016 01:19
I am stuck on one of the javascript lessons, i'm hoping someone can guide me in the right direction
is asking me
Encode the following sequence, separated by spaces:
backslash tab tab carriage-return new-line and assign it to myStr
Tony Miri
@TonyMiri
Jan 13 2016 01:19
@wearenotgroot I'm finding that I'm having a more difficult time nesting the if cases. Can you explain to me why the if cases don't work if I just test multiple things on one line?
Frank
@franky-boy-from-fl
Jan 13 2016 01:19
anyone familiar with that lesson that can help me. it would be greatly appreciated it
lawrencebass
@lawrencebass
Jan 13 2016 01:20
@julienbrault No problem yeah sometimes it is unclear what exactly they're asking for lol
Elifaz Filho
@Elifaz
Jan 13 2016 01:20
@franky-boy-from-fl Lets see what you have and we will go from there
Johnny Cornyn
@JMIHC
Jan 13 2016 01:20
hello all, I've got a issue with my code at Checkpoint: Counting Cards
if anyone can help let me know
Nate Hutchison
@NateHutchison
Jan 13 2016 01:20
@tommygebru back, piecing it together...
Elifaz Filho
@Elifaz
Jan 13 2016 01:20
@franky-boy-from-fl that exercise is basically for you to assign a variable with the keys representing the example on the left.
@JMIHC paste your code in here and we will go from there.
Johnny Cornyn
@JMIHC
Jan 13 2016 01:21
@Elifaz ok
tommy
@tommygebru
Jan 13 2016 01:21
@NateHutchison :+1:
Johnny Cornyn
@JMIHC
Jan 13 2016 01:21

'''var count = 0;

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

}

return "Change Me";
// Only change code above this line
}

CamperBot
@camperbot
Jan 13 2016 01:21
:bulb: to format code use backticks! ``` more info
Johnny Cornyn
@JMIHC
Jan 13 2016 01:21
oops, didn't put in backticks
greg
@wearenotgroot
Jan 13 2016 01:22
@FatTone225 go to private chat
Elifaz Filho
@Elifaz
Jan 13 2016 01:24
@JMIHC almost there, on your count= count++ don’t include Bet with it the same with the Hold and Hold bellow, here you don’t have to assign count to count unless you are setting it equal to it’s own value, on this case 0. Play a bit more and come back to us
Johnny Cornyn
@JMIHC
Jan 13 2016 01:25
@Elifaz thanks! I'll be on it
CamperBot
@camperbot
Jan 13 2016 01:25
jmihc sends brownie points to @elifaz :sparkles: :thumbsup: :sparkles:
:star: 322 | @elifaz | http://www.freecodecamp.com/elifaz
Elifaz Filho
@Elifaz
Jan 13 2016 01:26
@JMIHC just an append, so to increase and decrease counttake it out the assignment and the string concatenation, and to assign it to it’s own value, replace Hold for it’s own name, on this case count equals count.
Santiago de la Torre
@iargonut
Jan 13 2016 01:26
can anyone help me with 42 ??
Elifaz Filho
@Elifaz
Jan 13 2016 01:26
@iargonut what’s up?
Johnny Cornyn
@JMIHC
Jan 13 2016 01:26
right on
Santiago de la Torre
@iargonut
Jan 13 2016 01:27
i created my style and class , but cant get the background-color thing to work
tommy
@tommygebru
Jan 13 2016 01:27
@iargonut
you guys need to stop with the waypoint numbers
give the title and link :smile:
Elifaz Filho
@Elifaz
Jan 13 2016 01:27
@iargonut alright, that’s alright, we got you. Show us what you have and we will go from there, are you missing a ; on the property above?
Santiago de la Torre
@iargonut
Jan 13 2016 01:28
how do i darg my code here ??
Elifaz Filho
@Elifaz
Jan 13 2016 01:29
@iargonut copy from there, and in here you insert ``` one line before and after your code block

such as
```
paste your code here in the next line

```

Brian
@sludge256
Jan 13 2016 01:30
@lavieb33 there's a reset button on the page. Sorry I didn't see your message until now.
.
.
Santiago de la Torre
@iargonut
Jan 13 2016 01:30

<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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

h2 {
font-family: Lobster, Monospace;
}

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

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

.smaller-image {
width: 100px;
}

.gray-background {

background-color: gray;

}

</style>

<gray-background class="background-color"></gray-background>

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

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

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back" src="https://bit.ly/fcc-relaxing-cat"></a>

<div>
<gray-background class="background-color">
<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>
</div>

<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>

Artur
@ArturMC
Jan 13 2016 01:32
@iargonut format that pleaseeeeeeeee. Use the button above "tab" to put three ticks ``` before and after your code.
Elifaz Filho
@Elifaz
Jan 13 2016 01:32
@iargonut alright, the css style is fine, on the tags below, go to your gray-background and make sure that the class is written properly. If you have to place a class=“gray-background” on your div, then you remove your current code under the div and paste following the example on img class="smaller-image thick-green-border"
Nate Hutchison
@NateHutchison
Jan 13 2016 01:33
alright, what am I missing?
//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;) {
   if (contacts[i].firstName === firstName && contacts[i].hasOwnProperty(prop)) {
     return contacts[i][prop];
   } else if (contacts[i].firstName == firstName && !contacts[i].hasOwnProperty(prop)){
     return "No such property"; 
   } else {
     return "No such contact";    
   } 
 }
// Only change code above this line
}


// Change these values to test your function
lookUp("Akira", "likes");
no such property and no such contact are passing, but none of the others
Artur
@ArturMC
Jan 13 2016 01:35
@NateHutchison you didn't increment the for loop with i++
Elifaz Filho
@Elifaz
Jan 13 2016 01:35
@NateHutchison once you say return it will automattically skip out the remainder of the evaluation on the loop, take a look at your return
@NateHutchison @ArturMC Yeah, and increment your loop.
Nate Hutchison
@NateHutchison
Jan 13 2016 01:36
@Elifaz Oh! should I put a...break? okay I'll mess with it
Elifaz Filho
@Elifaz
Jan 13 2016 01:37
@NateHutchison actually, run your code just by adding i++at your loop before you mess below.
Nate Hutchison
@NateHutchison
Jan 13 2016 01:38
@Elifaz I did, didn't make a difference it seems
Cory O'Dell
@coryodell28
Jan 13 2016 01:38
Before I ask a question about the code, how do I post my question in here with the code formatted correctly?
Nate Hutchison
@NateHutchison
Jan 13 2016 01:39
@coryodell28 shift enter, then paste, shift enter
Elifaz Filho
@Elifaz
Jan 13 2016 01:39
@NateHutchison yeah, the return on the first statement is killing the remainder of the code without evaluating, try creating a new variable and assigning the result in there if it is temporary so the code can go down the chain.
jiujutsuka
@jiujutsuka
Jan 13 2016 01:39
Please help, I'm on waypoint 6 of jQuery.
Santiago de la Torre
@iargonut
Jan 13 2016 01:39
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

  .smaller-image {
    width: 100px;
  }

  .gray-background {

  background-color: gray;

}

</style>

<gray-background class="background-color"></gray-background>

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

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

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back" src="https://bit.ly/fcc-relaxing-cat"></a>

<div>
  <gray-background class="background-color">
  <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>
</div>

<form action="/submit-cat-photo">
  <label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
  <label><input type="checkbox" name="personality" checked> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Energetic</label>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>
jiujutsuka
@jiujutsuka
Jan 13 2016 01:39
blob
Santiago de la Torre
@iargonut
Jan 13 2016 01:39
im still very lost
Susan
@SusanGrattan
Jan 13 2016 01:40
So I might have created an infinite loop and now I can't access my bonfire. What do I do when this happens? I've restarted the browser already..
Nate Hutchison
@NateHutchison
Jan 13 2016 01:40
@Elifaz , okay I'll play with it...
greg
@wearenotgroot
Jan 13 2016 01:40
@NateHutchison either store the result on a variable and test it later or break up the if statement and let the loop finish
Elifaz Filho
@Elifaz
Jan 13 2016 01:41
@iargonut remove the gray-background before your class=“background-color” and place div instead.
Susan
@SusanGrattan
Jan 13 2016 01:41
@jiujutsuka what do you need help with?
xEpicDanielx
@xEpicDanielx
Jan 13 2016 01:41
Hey I could use some help with the Profile Lookup JS Challenge
jiujutsuka
@jiujutsuka
Jan 13 2016 01:41
I created the 3 jQuery selectors and I am not able to run tests an continue
xEpicDanielx
@xEpicDanielx
Jan 13 2016 01:41
I cannot search and tell if an object property exist or not.
jiujutsuka
@jiujutsuka
Jan 13 2016 01:41
I believe I did everything as instructed
greg
@wearenotgroot
Jan 13 2016 01:42
@jiujutsuka how about the animated part?
Thequadehunter
@Thequadehunter
Jan 13 2016 01:42
```
Cory O'Dell
@coryodell28
Jan 13 2016 01:43
This message was deleted
Susan
@SusanGrattan
Jan 13 2016 01:43
@jiujutsuka check your third selector. Something needs to be capitalized =]
line 6 @jiujutsuka
Santiago de la Torre
@iargonut
Jan 13 2016 01:43
@Elifaz doesnt change anything tho
Elifaz Filho
@Elifaz
Jan 13 2016 01:43
@iargonut div’s allow you to place chunks of html in the same block, therefore allowing you to have a more structure layout by styling the css.
@iargonut show me what you’ve got
Thequadehunter
@Thequadehunter
Jan 13 2016 01:43

Declare and initialize a variable total to 0. Use a for loop to add the value of each element of the myArr array to total.

I'm like 100% sure I did this right, and there's no goals showing up under the console. Is this a bug or did I make some kind of typo?

// Example
var ourArr = [ 9, 10, 11, 12];
var ourTotal = 0;

for (var i = 0; i < ourArr.length; i++) {
  ourTotal += ourArr[i];
}

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

// Only change code below this line

var myTotal = 0;

for (var i = 0; i < myArr.length; i++) {
  myTotal += myArr[i];
}
jiujutsuka
@jiujutsuka
Jan 13 2016 01:44
@SusanGrattan thanks!
CamperBot
@camperbot
Jan 13 2016 01:44
jiujutsuka sends brownie points to @susangrattan :sparkles: :thumbsup: :sparkles:
:star: 289 | @susangrattan | http://www.freecodecamp.com/susangrattan
greg
@wearenotgroot
Jan 13 2016 01:44
@jiujutsuka nvm you did it correctly
Santiago de la Torre
@iargonut
Jan 13 2016 01:44

@Elifaz ```

<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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

h2 {
font-family: Lobster, Monospace;
}

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

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

.smaller-image {
width: 100px;
}

.gray-background {

background-color: gray;

}

</style>

<div class="background-color"></div>

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

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

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back" src="https://bit.ly/fcc-relaxing-cat"></a>

<div>
<div class="background-color">
<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>
</div>

<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
```

Thequadehunter
@Thequadehunter
Jan 13 2016 01:44
woah, why is the last part as a note? It doesn't show up like that for me
Susan
@SusanGrattan
Jan 13 2016 01:44
You're welcome. =] @jiujutsuka
Santiago de la Torre
@iargonut
Jan 13 2016 01:44
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

  .smaller-image {
    width: 100px;
  }

  .gray-background {

  background-color: gray;

}

</style>

<div class="background-color"></div>

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

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

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back" src="https://bit.ly/fcc-relaxing-cat"></a>

<div>
  <div class="background-color">
  <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>
</div>

<form action="/submit-cat-photo">
  <label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
  <label><input type="checkbox" name="personality" checked> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Energetic</label>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>
Elifaz Filho
@Elifaz
Jan 13 2016 01:44
@iargonut edit your paste and put the ``` one line below my name.
xEpicDanielx
@xEpicDanielx
Jan 13 2016 01:44

  for(var i = 0; i<contacts.length; i++){
    if(contacts[i].firstName == firstName){
      console.log(contacts[i][prop]);
          if(contacts[i][prop] !== undefined)
            return contacts[i][prop];

            return "No such contact";

        }
  }
any idea why this is not working?
Elifaz Filho
@Elifaz
Jan 13 2016 01:45
@iargonut great, let me see
Brian
@sludge256
Jan 13 2016 01:45
@Thequadehunter it's because you need to specify which language your code is in like this: ```js
Cory O'Dell
@coryodell28
Jan 13 2016 01:45
I'm trying to get through this last waypoint before bed and I'm stuck.
Elifaz Filho
@Elifaz
Jan 13 2016 01:45
@iargonut alright, see that your <div class="background-color"></div> is opening and closing with nothing in between, make sure the </div> is at the far end of your code block.
greg
@wearenotgroot
Jan 13 2016 01:45
@xEpicDanielx try .hasOwnProperty(prop) instead of contacts[i][prop] !== undefined
Thequadehunter
@Thequadehunter
Jan 13 2016 01:46
@sludge256 I did that
// Example
var ourArr = [ 9, 10, 11, 12];
var ourTotal = 0;

for (var i = 0; i < ourArr.length; i++) {
  ourTotal += ourArr[i];
}

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

// Only change code below this line

var myTotal = 0;

for (var i = 0; i < myArr.length; i++) {
  myTotal += myArr[i];
}
I'm saying the very bottom is showing up in grey
xEpicDanielx
@xEpicDanielx
Jan 13 2016 01:46
Nope :/
Thequadehunter
@Thequadehunter
Jan 13 2016 01:46
when there is no reason it should be counted as a note
or a comment, i mean
Elifaz Filho
@Elifaz
Jan 13 2016 01:46
@iargonut and you also want to name that class of gray-background instead of background-color
Frank
@franky-boy-from-fl
Jan 13 2016 01:47
can anyone pleeeeeease give me an example of what they want on this lessonWaypoint: Escape Sequences in Strings
Brian
@sludge256
Jan 13 2016 01:47
@Thequadehunter I'm saying when you make this ``` add js after it
Frank
@franky-boy-from-fl
Jan 13 2016 01:47
Waypoint: Escape Sequences in Strings
xEpicDanielx
@xEpicDanielx
Jan 13 2016 01:47
if(contacts[i].hasOwnProperty(prop))
Return contacts[i][prop];
Frank
@franky-boy-from-fl
Jan 13 2016 01:47
I just can't figure it out
argghh
DJ
@qualitymanifest
Jan 13 2016 01:47
@coryodell28 just check to see if a OR b < 0 and return undefined if they are.
greg
@wearenotgroot
Jan 13 2016 01:47
@xEpicDanielx also it is wise to use{} when you have a lot if nesting loops
Thequadehunter
@Thequadehunter
Jan 13 2016 01:47
testing
that's exactly what i did
that's how I pasted the code in
Brian
@sludge256
Jan 13 2016 01:47
@Thequadehunter instead of just ``` have
```js
Thequadehunter
@Thequadehunter
Jan 13 2016 01:47
oh
ok
Cory O'Dell
@coryodell28
Jan 13 2016 01:47
@qualitymanifest alright I'll try it out. The example threw me completely off that train of though
t
xEpicDanielx
@xEpicDanielx
Jan 13 2016 01:48
@wearnotgroot that should not make a difference in this though. right?
Thequadehunter
@Thequadehunter
Jan 13 2016 01:48


// Example
var ourArr = [ 9, 10, 11, 12];
var ourTotal = 0;

for (var i = 0; i < ourArr.length; i++) {
  ourTotal += ourArr[i];
}

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

// Only change code below this line

var myTotal = 0;

for (var i = 0; i < myArr.length; i++) {
  myTotal += myArr[i];
}
Santiago de la Torre
@iargonut
Jan 13 2016 01:48
@Elifaz thanks man !! made my life easier
CamperBot
@camperbot
Jan 13 2016 01:48
iargonut sends brownie points to @elifaz :sparkles: :thumbsup: :sparkles:
:star: 323 | @elifaz | http://www.freecodecamp.com/elifaz
Elifaz Filho
@Elifaz
Jan 13 2016 01:48
@iargonut good to know, good luck!
greg
@wearenotgroot
Jan 13 2016 01:48
@xEpicDanielx it does. and btw you have to return under one if statement
Thequadehunter
@Thequadehunter
Jan 13 2016 01:48
There we go, still need help with the code part though, there's no reason it shouldn't work
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 01:48

Hi guys, I am trying to solve the below code but I am not able to, please help.

You will need to use string operators to build a new string, result, using the provided variables: myNoun, myAdjective, myVerb, and myAdverb.

You will also need to provide additional strings, which will not change, in between the provided words.

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

// Your code above this line

return result;
}

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

Elifaz Filho
@Elifaz
Jan 13 2016 01:49
Gotta go work on my zipline, guys and girls, have a great night!!
greg
@wearenotgroot
Jan 13 2016 01:49
@xEpicDanielx having curly braces helps readability and separating what gets executed properly
xEpicDanielx
@xEpicDanielx
Jan 13 2016 01:50

  for(var i = 0; i<contacts.length; i++){
    if(contacts[i].firstName == firstName){
          if(contacts[i].hasOwnProperty(prop)){
            return contacts[i][prop];
          }
         else
            return "No such contact";
        }
  }
  return "No such property";
Benjamin Starling
@bstarling
Jan 13 2016 01:50
Hi, can anyone point to a resource or explain why contact[prop] this works but contact.prop (undefined) this does not?
```js
var contact = {
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
}
Avery Lucas
@ItsMuse
Jan 13 2016 01:50
@HaroonGhawsi What exactly do you need help with? It looks like there is no code in your function.
Elifaz Filho
@Elifaz
Jan 13 2016 01:50
lottery 1.5B, remember me when you win! :smile:
greg
@wearenotgroot
Jan 13 2016 01:51
@xEpicDanielx
if(contacts[i].hasOwnProperty(prop)){
            return contacts[i][prop];
          }
         else
            return "No such contact"; //should be return "No such property" instead
        }
Benjamin Starling
@bstarling
Jan 13 2016 01:51
(retrying, premature enter)
Hi, can anyone point to a resource or explain why contact[prop] (returns array) works but contact.prop (undefined) this does not?
var prop = "likes"
var contact =     {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    }
Avery Lucas
@ItsMuse
Jan 13 2016 01:51
@nigeltea contact[prop] works because prop is a variable. The '.' refrence only works if the object your refering too has it. *Sorry dont know enough to make it simpler.
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 01:51

@ItsMuse This is the question actually

You will need to use string operators to build a new string, result, using the provided variables: myNoun, myAdjective, myVerb, and myAdverb.

You will also need to provide additional strings, which will not change, in between the provided words.

Brian
@sludge256
Jan 13 2016 01:51
@Thequadehunter which wp are you on?
Benjamin Starling
@bstarling
Jan 13 2016 01:52
I have solved the solution but I am curious why dot notion does not work when using a variable.
xEpicDanielx
@xEpicDanielx
Jan 13 2016 01:52
Ughhh.. Thank you @wearenotgroot ! Its always something stupid lol
CamperBot
@camperbot
Jan 13 2016 01:52
xepicdanielx sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 391 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
Avery Lucas
@ItsMuse
Jan 13 2016 01:52
@nigeltea dot notation dosnt replace variables
thats what I was trying to say
Francis Moisan
@frankmoisan
Jan 13 2016 01:52
Good evening! I'm going through the mongo portion, and my question is really simple: Why do learnyoumongo solutions use + next to the variable name? For example, { $gt: +age }
Benjamin Starling
@bstarling
Jan 13 2016 01:52
@itsmuse thanks for confirming for me, I got to that via trial and error but I guess it's above my head for the moment.
CamperBot
@camperbot
Jan 13 2016 01:52
nigeltea sends brownie points to @itsmuse :sparkles: :thumbsup: :sparkles:
:star: 219 | @itsmuse | http://www.freecodecamp.com/itsmuse
Brian
@sludge256
Jan 13 2016 01:52
dot notation wont work if it's a varible
Mike W.
@micwill007
Jan 13 2016 01:52
@nigeltea You kind of answered your question. It just doesn't :P
Brian
@sludge256
Jan 13 2016 01:52
dot notation will take the name of the variable and search for the property name that matches the name of the variable
greg
@wearenotgroot
Jan 13 2016 01:53
@xEpicDanielx just map out what you are trying to do in paper first to have overview of what is going on
Brian
@sludge256
Jan 13 2016 01:53
if it's in bracket notation it will convert to the value of the variable
Mike W.
@micwill007
Jan 13 2016 01:53
sludge's explanation is a bit more eloquent than mine
xEpicDanielx
@xEpicDanielx
Jan 13 2016 01:53
@wearenotgroot could i do hasOwnProperty for both first name and prop?
greg
@wearenotgroot
Jan 13 2016 01:53
@xEpicDanielx also avoid returning result too early. you still have to loop through the entire list of contacts
Benjamin Starling
@bstarling
Jan 13 2016 01:53
@sludge256 that makes sense..I guess there is no way of the program knowing if you are passing a variable or a property (if names were overlapping)
xEpicDanielx
@xEpicDanielx
Jan 13 2016 01:53
would that be more efficient.
Avery Lucas
@ItsMuse
Jan 13 2016 01:53
oh! @HaroonGhawsi Thats an easy one. I will let you think more on that. ;)
Benjamin Starling
@bstarling
Jan 13 2016 01:54
@sludge256 thanks for clearing it up. spent a lot of time over thinking that one!
CamperBot
@camperbot
Jan 13 2016 01:54
nigeltea sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 761 | @sludge256 | http://www.freecodecamp.com/sludge256
greg
@wearenotgroot
Jan 13 2016 01:54
@xEpicDanielx yes you could but it only check if the property exist not the value
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 01:54
@ItsMuse :)
Tony Miri
@TonyMiri
Jan 13 2016 01:54
@wearenotgroot @tommygebru Thanks for your help guys.
CamperBot
@camperbot
Jan 13 2016 01:54
fattone225 sends brownie points to @wearenotgroot and @tommygebru :sparkles: :thumbsup: :sparkles:
Jason
@funkystuffmalone
Jan 13 2016 01:54
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

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

// Test your code by modifying these values
checkObj("gift");
CamperBot
@camperbot
Jan 13 2016 01:54
:star: 292 | @tommygebru | http://www.freecodecamp.com/tommygebru
:star: 392 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
xEpicDanielx
@xEpicDanielx
Jan 13 2016 01:54
@wearenotgroot why would i not return it as soon as I find the answer? Wouldn't it be pointless to search the rest of the object once I find what I am looking for?
Sabrina Danielle Green
@SabrinaDanielle
Jan 13 2016 01:56
Hey yall... Can you help me figure out what I'm doing wrong?
Benjamin Starling
@bstarling
Jan 13 2016 01:56
On that note, g'night FCC, happy coding.
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 01:56
@ItsMuse if you could elaborate the question to me, that will be great. maybe I am not clear with the question
Santiago de la Torre
@iargonut
Jan 13 2016 01:56
<form action="/submit-cat-photo">
  <form id="cat-photo-form">
  <label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
  <label><input type="checkbox" name="personality" checked> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Energetic</label>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>

</form>
whats wrong in there ??
Mike W.
@micwill007
Jan 13 2016 01:56
@SabrinaDanielle Which section are you on?
Avery Lucas
@ItsMuse
Jan 13 2016 01:57
@HaroonGhawsi Basically, They want you to take the variables there giving you and put it into a string. I dont want to 'Give' the awnser Or mispell answer? but.. heres an example.
Brian
@sludge256
Jan 13 2016 01:57
@xEpicDanielx problem with returning early is, at least with the common mistakes people have made when posting their code, is that they check through the first contact then hit a return statement
Avery Lucas
@ItsMuse
Jan 13 2016 01:57
@HaroonGhawsi "The" + variable here + "car".. and so on.
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 01:57
@ItsMuse alright. thanks.
CamperBot
@camperbot
Jan 13 2016 01:57
haroonghawsi sends brownie points to @itsmuse :sparkles: :thumbsup: :sparkles:
:star: 220 | @itsmuse | http://www.freecodecamp.com/itsmuse
Tony Miri
@TonyMiri
Jan 13 2016 01:58
@xEpicDanielx You would want to exit if you found what you're looking for. BUT, if you don't get a hit on your search then you want to make sure your loop doesn't exit. Trust me I just went through that whole learning process. lol
Avery Lucas
@ItsMuse
Jan 13 2016 01:58
yay! brownies! Cant get enough of em... Im gonna keep working on my js now. Later guys.
Francis Moisan
@frankmoisan
Jan 13 2016 01:58
Good evening! I'm going through the mongo portion, and my question is really simple: Why do learnyoumongo solutions use + next to the variable name? For example, { $gt: +age }
if this is the wrong chat room to ask I apologise
cannelflow
@cannelflow
Jan 13 2016 01:59
@iargonut worked?
Avery Lucas
@ItsMuse
Jan 13 2016 01:59
@frankmoisan I really wish I could answer that... but your WAY ahead of me. Sorry. :(
Francis Moisan
@frankmoisan
Jan 13 2016 02:00
@ItsMuse No problem :) Either Google has failed me, or I'm just not searching for the right thing. I can do SQL no problem but mongo is a different beast altogether
Jason
@funkystuffmalone
Jan 13 2016 02:00
can anyone help me with waypoint 87

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

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

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

Santiago de la Torre
@iargonut
Jan 13 2016 02:01
@cannelflow yes but had to move the form id code right above where the code started
Jason
@funkystuffmalone
Jan 13 2016 02:01
```
cannelflow
@cannelflow
Jan 13 2016 02:02
@funkystuffmalone you have typo mistake it should be if(myObj)
Tony Miri
@TonyMiri
Jan 13 2016 02:02
@funkystuffmalone You have a typo in your if statement
@cannelflow Beat me to it
lol
Jason
@funkystuffmalone
Jan 13 2016 02:03
@cannelflow Thank you
CamperBot
@camperbot
Jan 13 2016 02:03
funkystuffmalone sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 392 | @cannelflow | http://www.freecodecamp.com/cannelflow
Minji
@mkimmy710
Jan 13 2016 02:05
Not sure what the solution for this waypoint is... Accessing Nested Arrays in JSON
Sabrina Danielle Green
@SabrinaDanielle
Jan 13 2016 02:05
@micwill007 I'm on the backslashes
var myStr "\"I am a \"double quoted\" string inside "double quotes\"";//
Minji
@mkimmy710
Jan 13 2016 02:05
var secondTree = myPlants.trees1 is not working?
Brian
@sludge256
Jan 13 2016 02:06
@SabrinaDanielle You don't actually need the extra quotes around the string
it's just in the answer to denote that it's a string
Simon
@simonshum
Jan 13 2016 02:06
i'm working on checkpoint: Record Collection. Could anyone give me some pointers on how to start? I'm not even sure where to begin
Bill
@kirah1314
Jan 13 2016 02:06
@mkimmy710 myPlants is an array of objects
Minji
@mkimmy710
Jan 13 2016 02:08
@kirah1314 right... so should I be including "type" or "lists" in the code?
Bill
@kirah1314
Jan 13 2016 02:09
@mkimmy710 well you access arrays like this myPlants[0] for first element (in this case, first object) right?
Avery Lucas
@ItsMuse
Jan 13 2016 02:10
This message was deleted
example
Adam Snetiker
@ajsnetiker
Jan 13 2016 02:10
When a Bonfire lists helpful links, is that a hint saying you can complete it with ONLY that method, or do you still always need other things?
Brian
@sludge256
Jan 13 2016 02:10
You can complete with whatever you want
as long as it returns the correct output
Adam Snetiker
@ajsnetiker
Jan 13 2016 02:10
i got one to return something correct but it’s still not right. I think i did way too much to get there too
Bill
@kirah1314
Jan 13 2016 02:10
@ajsnetiker you usually need more than just the helpful links but you're not required to use those methods if you prefer not to
cannelflow
@cannelflow
Jan 13 2016 02:11
@ajsnetiker you can do it with your own method
Avery Lucas
@ItsMuse
Jan 13 2016 02:11
Cannelflow...
Minji
@mkimmy710
Jan 13 2016 02:11
@kirah1314 var secondTree = myPlants1.lists1 am I on the right track....
Bill
@kirah1314
Jan 13 2016 02:11
@mkimmy710 yes, bingo!
Adam Snetiker
@ajsnetiker
Jan 13 2016 02:12
thanks. I’m starting all over, I think there’s a much easier way than I originally did it. I’m working on the Title Case one, sounds easy but i’ve been stuck a while
Bill
@kirah1314
Jan 13 2016 02:12
@mkimmy710 you had this right? myPlants[1].lists[1]
Minji
@mkimmy710
Jan 13 2016 02:12
@kirah1314 wrote lists instead of list. yay thanks for your help!!
CamperBot
@camperbot
Jan 13 2016 02:12
mkimmy710 sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 807 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Sabrina Danielle Green
@SabrinaDanielle
Jan 13 2016 02:12
@sludge256 thanks for trying to help... it's not working out though
CamperBot
@camperbot
Jan 13 2016 02:12
sabrinadanielle sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 762 | @sludge256 | http://www.freecodecamp.com/sludge256
Brian
@sludge256
Jan 13 2016 02:13
@SabrinaDanielle What do you have now?
Nate Hutchison
@NateHutchison
Jan 13 2016 02:13
@Elifaz thanks
CamperBot
@camperbot
Jan 13 2016 02:13
natehutchison sends brownie points to @elifaz :sparkles: :thumbsup: :sparkles:
:star: 324 | @elifaz | http://www.freecodecamp.com/elifaz
Bill
@kirah1314
Jan 13 2016 02:13
@mkimmy710 great to hear!
Simon
@simonshum
Jan 13 2016 02:16
can anyone help me out on checkpoint:Record Collection?
Ray
@rbjr
Jan 13 2016 02:16
help Checkpoint profile lookup
CamperBot
@camperbot
Jan 13 2016 02:16
no wiki entry for: checkpoint profile lookup
Ray
@rbjr
Jan 13 2016 02:17
help Checkpoint: Profile Lookup
CamperBot
@camperbot
Jan 13 2016 02:17
no wiki entry for: checkpoint profile lookup
Simon
@simonshum
Jan 13 2016 02:17
help checkpoint record collection
CamperBot
@camperbot
Jan 13 2016 02:17

:point_right: checkpoint record collection [wiki]

Checkpoint: Record Collection

Instructions

You are given a JSON object representing (a small part of) your record collection. Each album is identified by a unique id number and has several properties. Not all albums have complete information.

Write a function which takes an id, a property (prop), and a value.

For the given id in collection:

If value is non-blank (value !== ""), then update or set the value for the prop.

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

If value is blank, delete that prop.

Always return the entire collection object.

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

:pencil: read more about checkpoint record collection on the FCC Wiki

Matt Mayes
@mmayes098
Jan 13 2016 02:17

I’m having a bit of trouble with the Profile Lookup checkpoint. 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
  for (var i=0; i < contacts.length; i++) {
    if (contacts[i].firstName===firstName&&contacts[i].hasOwnProperty(prop)===true) {
      return contacts[i][prop];
    } else if (contacts[i].firstName===firstName&&contacts[i].hasOwnProperty(prop)===false) {
      return "No such property";
    } else if (contacts[i].firstName!==firstName) {
      return "No such contact";
    }
  }
// Only change code above this line
}

// Change these values to test your function
lookUp("Kristian", "lastName");

I understand what the problem is, since I’m using returns within the for loop, it is stopping once it hits a return and essentially it is only searching through contacts[0]. What I don’t know is how to fix it. Any help?

Ray
@rbjr
Jan 13 2016 02:23
@mmayes098 you don't need the for loop
Bill
@kirah1314
Jan 13 2016 02:25
@rbjr you finished it without a loop?
Matt Mayes
@mmayes098
Jan 13 2016 02:25
@rbjr How would I edit it then to take it out? Don’t I still need to iterate through each element in the array to search?
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 02:25
blob
I am not able to solve this problem, please help guys
greg
@wearenotgroot
Jan 13 2016 02:26

@mmayes098 how about removing

else if (contacts[i].firstName!==firstName) {
      return "No such contact";
    }

and just return "No such contact" outside the for loop
because you basically been through the entire contact list without that last else if

DJ
@qualitymanifest
Jan 13 2016 02:26
@HaroonGhawsi don't put the variables in quotation marks.
Artur
@ArturMC
Jan 13 2016 02:26
@HaroonGhawsi no need for the += either
Ray
@rbjr
Jan 13 2016 02:27
not for a lookup, all you need is the if/else if
Matt Mayes
@mmayes098
Jan 13 2016 02:27
@wearenotgroot Still doesn’t pass all the tests
@wearenotgroot Looks cleaner, though :)
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 02:28
@qualitymanifest Thank you very much its solved
CamperBot
@camperbot
Jan 13 2016 02:28
haroonghawsi sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 776 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Haroon Ghawsi
@HaroonGhawsi
Jan 13 2016 02:28
@ArturMC sure, thanks.
CamperBot
@camperbot
Jan 13 2016 02:28
haroonghawsi sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
:star: 254 | @arturmc | http://www.freecodecamp.com/arturmc
greg
@wearenotgroot
Jan 13 2016 02:29
@mmayes098
function lookUp(firstName, prop){
// Only change code below this line
  for (var i=0; i < contacts.length; i++) {
    if (contacts[i].firstName===firstName&&contacts[i].hasOwnProperty(prop)) {
      return contacts[i][prop];
     } else if (contacts[i].firstName===firstName && !contacts[i].hasOwnProperty(prop)) {
      return "No such property";
     }

// Only change code above this line
  }
return "No such contact";
}
Davis
@dfowlkes14
Jan 13 2016 02:29
can someone help me with the css code??
cannelflow
@cannelflow
Jan 13 2016 02:30
@dfowlkes14 can try
Davis
@dfowlkes14
Jan 13 2016 02:31
ok tell me the steps of turning some txt blue pls @cannelflow
Bill
@kirah1314
Jan 13 2016 02:31
@rbjr it's an array of objects, using if/else is a given. So how would you use if/else to compare the array of objects without iterating through it?
greg
@wearenotgroot
Jan 13 2016 02:31
@mmayes098 see the edit version
@mmayes098 that should do it
Ray
@rbjr
Jan 13 2016 02:31
my mistake
greg
@wearenotgroot
Jan 13 2016 02:33
@mmayes098 btw .hasOwnProperty() return boolean value so no need to === true or false. and watch out for curley braces
cannelflow
@cannelflow
Jan 13 2016 02:33
@dfowlkes14 if you have <h2 class="xyz">abc</h2> in style type xyx{color:blue}
sry .xyz
Matt Mayes
@mmayes098
Jan 13 2016 02:34
Yeah, that did it. Thanks @wearenotgroot
CamperBot
@camperbot
Jan 13 2016 02:34
mmayes098 sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 393 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
Davis
@dfowlkes14
Jan 13 2016 02:35
ill try it but it ask me to try <style> h2 {color: blue;} </style> @cannelflow
cannelflow
@cannelflow
Jan 13 2016 02:35
@dfowlkes14 show your code
you can do that also acc to what question had asked
which waypoint
Davis
@dfowlkes14
Jan 13 2016 02:37
ok well i just started today so i dont really know hoe=w to shw codes yet so how do you do that? @cannelflow
greg
@wearenotgroot
Jan 13 2016 02:37
wiki format
CamperBot
@camperbot
Jan 13 2016 02: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

greg
@wearenotgroot
Jan 13 2016 02:38
@dfowlkes14 there you go
cannelflow
@cannelflow
Jan 13 2016 02:38
@dfowlkes14 np ```(three bacticks) then shift+enter
Jota Sprout
@jotasprout
Jan 13 2016 02:39
Could somebody tell me whether I'm crazy or the browser is? I know my code is more perfect than any code in history but I can't seem to pass "Return Early Pattern for Functions"
Davis
@dfowlkes14
Jan 13 2016 02:39
thanks yall @cannelflow and @wearenotgroot
CamperBot
@camperbot
Jan 13 2016 02:39
dfowlkes14 sends brownie points to @cannelflow and @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 393 | @cannelflow | http://www.freecodecamp.com/cannelflow
:star: 394 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
Mike W.
@micwill007
Jan 13 2016 02:40
@jotasprout code?
Jota Sprout
@jotasprout
Jan 13 2016 02:40
Can I drop in a screenshot?
Artur
@ArturMC
Jan 13 2016 02:40
copy and paste the code @jotasprout
Jota Sprout
@jotasprout
Jan 13 2016 02:40
if (a < 0 || b < 0) {
return "undefined";
}
Artur
@ArturMC
Jan 13 2016 02:41
@jotasprout put `` before and after the code. can be found above the tab button
Three ticks
Jota Sprout
@jotasprout
Jan 13 2016 02:41
if (a < 0 || b < 0) { return "undefined"; }
Mike W.
@micwill007
Jan 13 2016 02:41
jsut return
dont return undefined
cannelflow
@cannelflow
Jan 13 2016 02:41
@jotasprout return "undefined" "ays" is string return underfined
Mike W.
@micwill007
Jan 13 2016 02:41
return;
Davis
@dfowlkes14
Jan 13 2016 02:42

<style>

h2 {color: red;}

</style> @cannelflow

Artur
@ArturMC
Jan 13 2016 02:42
@jotasprout take out the quotation marks
cannelflow
@cannelflow
Jan 13 2016 02:42
@dfowlkes14 whole code
which ex?
Chris S King
@CSKNG
Jan 13 2016 02:42
Hey all, hitting my first snag in these waypoints, can anyone tell me why this smaller-image demand isn't taking?
Davis
@dfowlkes14
Jan 13 2016 02:42
thats all that they gave me to work with
Jota Sprout
@jotasprout
Jan 13 2016 02:42
FACEPALM
Davis
@dfowlkes14
Jan 13 2016 02:43
@cannelflow
Chris S King
@CSKNG
Jan 13 2016 02:43

<style>

.smaller-image {

width: 100px;

}

</style>

<img src="https://bit.ly/fcc-relaxing-cat">

Jota Sprout
@jotasprout
Jan 13 2016 02:43
Seriously? OMG.
cannelflow
@cannelflow
Jan 13 2016 02:43
@CSKNG add class amaller-imafe to img
Jota Sprout
@jotasprout
Jan 13 2016 02:43
Thanks @ArturMC
greg
@wearenotgroot
Jan 13 2016 02:43
@CSKNG you need to apply the class to an element in this case <img>
CamperBot
@camperbot
Jan 13 2016 02:43
jotasprout sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
:star: 256 | @arturmc | http://www.freecodecamp.com/arturmc
Bill
@kirah1314
Jan 13 2016 02:44
@jotasprout that's like the top 5 FAQ these days so don't feel too bad about it :)
Artur
@ArturMC
Jan 13 2016 02:44
@CSKNG you need to add the class to the image
cannelflow
@cannelflow
Jan 13 2016 02:44
@dfowlkes14 full code and ex name
Krista Handel
@meloncatty
Jan 13 2016 02:44
I'm on the Stand in Line checkpoint
Artur
@ArturMC
Jan 13 2016 02:44
@kirah1314 Ceaser's Cipher was the big one when I last checked in here lol
Santiago de la Torre
@iargonut
Jan 13 2016 02:44
hey can anyone help me ??/ i have to get Both blue-text and pink-text should belong to the same h1 element.
  body {
    background-color: black;
    font-family: Monospace;
    color: blue;
  }
  .pink-text {
    color: blue;
  }
</style>
<h1 class="blue-text">Hello World!<h1 class="pink-text"></h1>
Krista Handel
@meloncatty
Jan 13 2016 02:45
and I'm getting a weird answer when I run my code
Bill
@kirah1314
Jan 13 2016 02:45
@ArturMC haha it WAS, but the instructions updated so it's more straight forward now
cannelflow
@cannelflow
Jan 13 2016 02:46
@meloncatty tried something?
Angelique Cortez
@NGEHLIQUE
Jan 13 2016 02:46
@CSKNG the code is <img class
Krista Handel
@meloncatty
Jan 13 2016 02:46
"Before: [1,2,3,4,5]\n1\After:[2,3,4,5,6]"
cannelflow
@cannelflow
Jan 13 2016 02:46
@CSKNG worked?
DJ
@qualitymanifest
Jan 13 2016 02:47
This message was deleted
@meloncatty is that your code, or are you pasting instructions?
Krista Handel
@meloncatty
Jan 13 2016 02:47
@qualitymanifest you didn't even see my code
cannelflow
@cannelflow
Jan 13 2016 02:47
@iargonut which ex?
@dfowlkes14 ?
Angelique Cortez
@NGEHLIQUE
Jan 13 2016 02:48
@CSKNG <img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat">
Krista Handel
@meloncatty
Jan 13 2016 02:48
// Setup
var myArr = [1,2,3,4,5];

function queue(arr, item) {
  // Your code here
  for(i = 0; i < myArr.length; i++){
    if(myArr[i] < item){
      var toAdd = myArr.shift();
      myArr.push(item);
      return toAdd;
    }
  }
}
my code is incomplete but that's just a weird output
so maybe I shouldn't be concerned anyway
Angelique Cortez
@NGEHLIQUE
Jan 13 2016 02:48
I was stuck on that as well @CSKNG
greg
@wearenotgroot
Jan 13 2016 02:49
@meloncatty why go through the array`? and why access the global variable
neuromeda
@neuromeda
Jan 13 2016 02:49
anyone stuck on js record collection?
JSantoyo
@JSantoyo
Jan 13 2016 02:50
I'm stuck on Waypoint: Link to External Pages with Anchor Elements
greg
@wearenotgroot
Jan 13 2016 02:50
@meloncatty hint! use the function parameters instead
JSantoyo
@JSantoyo
Jan 13 2016 02:50
Your a element should have the anchor text of "cat photos". is where I'm getting my error
<p><a href='http://freecatphotoapp.com'>cat photos</a></p> is what I have.
cannelflow
@cannelflow
Jan 13 2016 02:50
@JSantoyo code
Artur
@ArturMC
Jan 13 2016 02:51
@meloncatty you are going about it the wrong way. Look up the .push() and .shift() functions and try again
Krista Handel
@meloncatty
Jan 13 2016 02:51
dang I don't know what I was thinking when I was using myArr
didn't see the array at the bottom I guess
Brian
@brianmcoates
Jan 13 2016 02:51
@iargonut don't say class twice only once and put a space between the classes like this <h1 class=" blue-text pink-text">Hello World!</h1> you also have the start of a h1 in your code as well you should remove that.
cannelflow
@cannelflow
Jan 13 2016 02:52
@JSantoyo remove p tag
JSantoyo
@JSantoyo
Jan 13 2016 02:53
Thank you.
Worked.
greg
@wearenotgroot
Jan 13 2016 02:54
@meloncatty hint! code can be reduced to 2 lines
Artur
@ArturMC
Jan 13 2016 02:54
^^
cjackson1982
@cjackson1982
Jan 13 2016 02:54
can anyone help me with the object dot and bracket notation on this and explain why
JSantoyo
@JSantoyo
Jan 13 2016 02:54
@cannelflow Thank you Worked.
CamperBot
@camperbot
Jan 13 2016 02:54
jsantoyo sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
cjackson1982
@cjackson1982
Jan 13 2016 02:54

`// 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[0]]; // Change this line `

CamperBot
@camperbot
Jan 13 2016 02:54
:star: 394 | @cannelflow | http://www.freecodecamp.com/cannelflow
lavieb33
@lavieb33
Jan 13 2016 02:55
I keep getting this message" You need an "a"element that links to http://freecatphotoapp.com"and this is what my codes look like:<p> <a href="http: //freecatphotoapp.com">cat photos </a> </p> what is the error?
cjackson1982
@cjackson1982
Jan 13 2016 02:55
i'm supposed to retrieve the second tree from the myPlants variable using dot and bracket array notation
greg
@wearenotgroot
Jan 13 2016 02:55
@lavieb33 post the entire code
lavieb33
@lavieb33
Jan 13 2016 02:55
ok
Chris S King
@CSKNG
Jan 13 2016 02:55
@wearenotgroot @ArturMC Thanks!
CamperBot
@camperbot
Jan 13 2016 02:55
cskng sends brownie points to @wearenotgroot and @arturmc :sparkles: :thumbsup: :sparkles:
:star: 395 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
:star: 257 | @arturmc | http://www.freecodecamp.com/arturmc
Artur
@ArturMC
Jan 13 2016 02:56
@cjackson1982 don't try going for tree, think of it ass part of an array
cannelflow
@cannelflow
Jan 13 2016 02:56
@lavieb33 remove p tag
lavieb33
@lavieb33
Jan 13 2016 02:56
<p> <a href="http: //freecatphotoapp.com">cat photos </a> </p>
greg
@wearenotgroot
Jan 13 2016 02:56
@CSKNG :+1:
cannelflow
@cannelflow
Jan 13 2016 02:56
@lavieb33 remove p tag
cjackson1982
@cjackson1982
Jan 13 2016 02:56
@ArturMC so something like myPlants.trees1 ? but that didnt work
lavieb33
@lavieb33
Jan 13 2016 02:56
ok let me try
Ben Clist
@BenClist
Jan 13 2016 02:56
@lavieb33 check what text is supposed to go inside the a tag, pretty sure yours is wrong
Artur
@ArturMC
Jan 13 2016 02:57
@cjackson1982 there are two items in myPlants, which is an array.
Brian
@brianmcoates
Jan 13 2016 02:57
@cjackson1982 do the curly bracket and the square bracket need to be switched in their order under dandelion?
Artur
@ArturMC
Jan 13 2016 02:57
@cjackson1982 so first part is myPlants1
cjackson1982
@cjackson1982
Jan 13 2016 02:57
@ArturMC yeah both are arrays
Artur
@ArturMC
Jan 13 2016 02:57
@cjackson1982 myPlants1
@cjackson1982
myPlants[1].
lavieb33
@lavieb33
Jan 13 2016 02:57
I did remove de p tag but I still get the error message: You need an a element that links to http://freecatphotoapp.com
cannelflow
@cannelflow
Jan 13 2016 02:58
@lavieb33 show your code now
Artur
@ArturMC
Jan 13 2016 02:58
@cjackson1982 then instead of using the type, you want to access the "list" array
lavieb33
@lavieb33
Jan 13 2016 02:59
@BenClist <a href="http: //freecatphotoapp.com">cat photos </a>
cjackson1982
@cjackson1982
Jan 13 2016 02:59
@ArturMC so like myPlants1.list1 ?
greg
@wearenotgroot
Jan 13 2016 02:59
@meloncatty so did you finished it?
Artur
@ArturMC
Jan 13 2016 02:59
@cjackson1982 exactly like that but with the brackets
lavieb33
@lavieb33
Jan 13 2016 02:59
@cannelflow <a href="http: //freecatphotoapp.com">cat photos </a>
cannelflow
@cannelflow
Jan 13 2016 03:00
<a href="http://freecatphotoapp.com">cat photos</a> @lavieb33 code looks f9 try refreshing page
Adam Snetiker
@ajsnetiker
Jan 13 2016 03:00
ok totally stuck on the Title Case Bonfire. I got the correct result but did a lot to get there and it’s not recognizing it. (I know I probably have way too many variables but that’s just my thought process).
It prints out a lot of stuff in the console, but it returns correctly:
"I'm A Little Tea Pot Short And Stout Here Is My Handle Here Is My Spout"
var words = [];
var upperCaseLetter = "";
var lowerCaseLetters = "";
var fullWords = "";
var fullWordsArray = [];
var fullSentence = "";
function titleCase(str) {
  //Step 1: Split string into words; words is an array of strings
  console.log("ORIGINAL STRING: " + str);
  words = str.split(" ");
  console.log(words);
  //Step 2: For each word in the array, set the first letter to Uppercase.
  //Step 3: Print the first word with the uppercase letter, then print the rest of the word in lowercase.
  for (var i = 0; i < words.length; i++) {
   upperCaseLetter = words[i].charAt(0).toUpperCase();
   lowerCaseLetters = words[i].slice(1,words[i].length).toLowerCase();
   fullWords = upperCaseLetter + lowerCaseLetters;
    fullWordsArray.push(fullWords);

  //Step 4: Convert words array to a string
    fullSentence = fullWordsArray.join(" ");  
    console.log("NEW STRING: " + fullSentence);
  }
    return fullSentence;
}


titleCase("I'm a little tea pot");
titleCase("sHoRt AnD sToUt");
titleCase("HERE IS MY HANDLE HERE IS MY SPOUT");
cjackson1982
@cjackson1982
Jan 13 2016 03:00
@ArturMC got it thank you
CamperBot
@camperbot
Jan 13 2016 03:00
cjackson1982 sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
:star: 258 | @arturmc | http://www.freecodecamp.com/arturmc
Adam Snetiker
@ajsnetiker
Jan 13 2016 03:00
sorry i did 2 sets of code and it wouldnt format the second one
greg
@wearenotgroot
Jan 13 2016 03:00
@ajsnetiker edit it?
cjackson1982
@cjackson1982
Jan 13 2016 03:01
@ArturMC i understand the property access better now thanks bro
CamperBot
@camperbot
Jan 13 2016 03:01
:warning: cjackson1982 already gave arturmc points
cjackson1982 sends brownie points to @arturmc :sparkles: :thumbsup: :sparkles:
Artur
@ArturMC
Jan 13 2016 03:01
@ajsnetiker wrong chatroom but I can help you anyway since I did it already. What exactly are you having trouble with?
Mike W.
@micwill007
Jan 13 2016 03:01
This message was deleted
This was mine
Artur
@ArturMC
Jan 13 2016 03:01
@cjackson1982 no problem tried to walk you through it instead of just throwing the answer at you. Hope I helped
Mike W.
@micwill007
Jan 13 2016 03:01
Might help to see a shorter thought process
Adam Snetiker
@ajsnetiker
Jan 13 2016 03:02
@ArturMC oh right i forgot there’s a separate one for bonfires. I can go to that one if you want, otherwise scroll up. It returns the current string but it’s all checked off as wrong
greg
@wearenotgroot
Jan 13 2016 03:02
@ajsnetiker tip! no need for too many extra variables
Mike W.
@micwill007
Jan 13 2016 03:03
function titleCase(str) {
  var lower = str.toLowerCase();
  var result = [];
  var arr = lower.split(' ');
  for (i=0;i<arr.length;i++) {
    result.push(arr[i].charAt(0).toUpperCase() + arr[i].substr(1));
  }

  var final = result.join(' ');
  console.log(final);
  return final;
}


titleCase("I'm a little tea pot");
That was it
dfx113
@dfx113
Jan 13 2016 03:03
can someone help? I'm doing waypoint:continue working with nodejs servers
Santiago de la Torre
@iargonut
Jan 13 2016 03:03
@cannelflow its 55 havent made it work yet
dfx113
@dfx113
Jan 13 2016 03:03
I'm using var http = require('http'); at the top
Mike W.
@micwill007
Jan 13 2016 03:03
@ajsnetiker if you wanted to see my thought process for it
^
dfx113
@dfx113
Jan 13 2016 03:03
but it doesn't seem to be loading the packages?
Adam Snetiker
@ajsnetiker
Jan 13 2016 03:04
@micwill007 thanks. I’ll look through it and see what you did!
CamperBot
@camperbot
Jan 13 2016 03:04
ajsnetiker sends brownie points to @micwill007 :sparkles: :thumbsup: :sparkles:
:star: 270 | @micwill007 | http://www.freecodecamp.com/micwill007
smzagury
@smzagury
Jan 13 2016 03:04
I'm struggling with the Waypoint: Waypoint: Accessing Objects Properties with Variables. Help please?
lavieb33
@lavieb33
Jan 13 2016 03:04
@cannelflow ok here was the question:Create an a element that links to http://freecatphotoapp.com and has "cat photos" as its anchor text.
Teleisha Hall
@hallnt
Jan 13 2016 03:04
ready to start my Bonfires!
Ben Clist
@BenClist
Jan 13 2016 03:05
@lavieb33 your link is not correct
greg
@wearenotgroot
Jan 13 2016 03:05
@ajsnetiker you can also try to concat instead of pushing to another array.
Adam Snetiker
@ajsnetiker
Jan 13 2016 03:05

@micwill007 I missed the entire substring method, I didn’t run into that anywhere although I remember reading about it. That made it easier.

What I did was make the first letter uppercase then slice the rest of the word and tried to add them together.

lavieb33
@lavieb33
Jan 13 2016 03:06
@wearenotgroot that's right it's from the assignment
Ben Clist
@BenClist
Jan 13 2016 03:06
@lavieb33 Look at it closely, I 100% promise you it's not right
Adam Snetiker
@ajsnetiker
Jan 13 2016 03:06
definitely helpful, i’ll try using concat and see if i can get it that way so i don’t copy his
Mike W.
@micwill007
Jan 13 2016 03:06
@ajsnetiker I did a few things that aren't taught at FCC prior to that bonfire.. like charAt()
Artur
@ArturMC
Jan 13 2016 03:06
@ajsnetiker yea FCC doesn't cover it, you would have to look it up
Adam Snetiker
@ajsnetiker
Jan 13 2016 03:06
i looked up everything associated with split() but I must have missed that one
Artur
@ArturMC
Jan 13 2016 03:06
@micwill007 in my opinion charAt is a must for this bonfire
Mike W.
@micwill007
Jan 13 2016 03:07
id say so
cannelflow
@cannelflow
Jan 13 2016 03:07
@lavieb33 <a href="http://freecatphotoapp.com">cat photos</a>
Mike W.
@micwill007
Jan 13 2016 03:07
makes it a lot easier anyhow
lavieb33
@lavieb33
Jan 13 2016 03:07
@BenClist ok thanks im going to
CamperBot
@camperbot
Jan 13 2016 03:07
lavieb33 sends brownie points to @benclist :sparkles: :thumbsup: :sparkles:
:star: 279 | @benclist | http://www.freecodecamp.com/benclist
Artur
@ArturMC
Jan 13 2016 03:07
@ajsnetiker @micwill007 I did it in one line if you want to be even more precise :P
Adam Snetiker
@ajsnetiker
Jan 13 2016 03:07
haha
Mike W.
@micwill007
Jan 13 2016 03:07
show me
:P
Artur
@ArturMC
Jan 13 2016 03:08
function titleCase(str) {

      return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}
Adam Snetiker
@ajsnetiker
Jan 13 2016 03:08
My goal is to become that efficient.
i did a lot more steps but ultimately i got something to work, now i need to optimize it
Mike W.
@micwill007
Jan 13 2016 03:09
Very nice @ArturMC
smzagury
@smzagury
Jan 13 2016 03:09
Waypoint: Accessing Objects Properties with Variables Incomplete 
Mike W.
@micwill007
Jan 13 2016 03:09
props :P
Rex Schrader
@SaintPeter
Jan 13 2016 03:09
@ajsnetiker Premature optimization is the root of all evil ;)
lavieb33
@lavieb33
Jan 13 2016 03:09
@cannelflow thanks a lot it worked , I wonder what I did wrong now. about to check it
CamperBot
@camperbot
Jan 13 2016 03:09
lavieb33 sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 395 | @cannelflow | http://www.freecodecamp.com/cannelflow
smzagury
@smzagury
Jan 13 2016 03:09
I did this but it's not working and I can't fix it.
Waypoint: Accessing Objects Properties with Variables Incomplete 
Rex Schrader
@SaintPeter
Jan 13 2016 03:09
@ajsnetiker Don't sweat the "optimal" solution. It's hardly worth is on most of these. Just get it to work and move on.
Ben Clist
@BenClist
Jan 13 2016 03:09
@lavieb33 you had a space in your url after http://
smzagury
@smzagury
Jan 13 2016 03:10
var playerNumber = 16;
var player = testObj16;
greg
@wearenotgroot
Jan 13 2016 03:10
@SaintPeter prematue gigity?
Ben Clist
@BenClist
Jan 13 2016 03:10
@lavieb33 was trying not to just tell you the answer :)
Rex Schrader
@SaintPeter
Jan 13 2016 03:10
@wearenotgroot LOL
Artur
@ArturMC
Jan 13 2016 03:10
@SaintPeter Never :P
smzagury
@smzagury
Jan 13 2016 03:10
*there should be a bracket there
Rex Schrader
@SaintPeter
Jan 13 2016 03:10
@ArturMC "Let go your feelings . . ."
Jon Spencer
@batboy138
Jan 13 2016 03:13
I'm struggling with checkpoint: Golf Code.
lavieb33
@lavieb33
Jan 13 2016 03:13
@BenClist 3w?
Brian
@sludge256
Jan 13 2016 03:13
@smzagury So you already have playerNumber set to 16
@smzagury and the name of the waypoint is Waypoint: Accessing Objects Properties with Variables
lavieb33
@lavieb33
Jan 13 2016 03:14
@sludge256 yea thanks I found it
CamperBot
@camperbot
Jan 13 2016 03:14
lavieb33 sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 764 | @sludge256 | http://www.freecodecamp.com/sludge256
Ben Clist
@BenClist
Jan 13 2016 03:14
@lavieb33 you had
<a href="http:// freecatphotoapp.com">cat photos</a>
Brian
@sludge256
Jan 13 2016 03:14
@smzagury insteading of passing 16 directly as a value to testObj might you try something else?
Ben Clist
@BenClist
Jan 13 2016 03:14
should have been
<a href="http://freecatphotoapp.com">cat photos</a>
Jon Spencer
@batboy138
Jan 13 2016 03:15
function golfScore(par, strokes) {
  // Only change code below this line
  if(1) {
    return "Hole-in-one!";
  }
  else if( <= par - 2) {
    return "Eagle";
  }
  else if(par - 1) {
    return "Birdie";
  }
  else if(par) {
    return "Par";
  }
  else if(par + 1) {
    return "Bogey";
  }
  else if(par + 2) {
    return "Double Bogey";
  }
  else {
    return "Go Home!";
  }
  return "Change Me";
  // Only change code above this line
}

// Change these values to test
golfScore(5, 4);
Artur
@ArturMC
Jan 13 2016 03:16
@batboy138 switch is your friend in that waypoint
smzagury
@smzagury
Jan 13 2016 03:16
@sludge256 Thanks. Still trying to figure it out though.
CamperBot
@camperbot
Jan 13 2016 03:16
smzagury sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 765 | @sludge256 | http://www.freecodecamp.com/sludge256
Jon Spencer
@batboy138
Jan 13 2016 03:17
@ArturMC But switch isn't introduced til after the checkpoint.
Brian
@sludge256
Jan 13 2016 03:17
@smzagury so testObj[16] doesn't work
but is there something else that is also 16?
that you could put in there?
smzagury
@smzagury
Jan 13 2016 03:18
@sludge256 THANK YOU. Can't believe I couldn't figure it out.
CamperBot
@camperbot
Jan 13 2016 03:18
smzagury sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
Artur
@ArturMC
Jan 13 2016 03:18
@batboy138 oh I have fail memory
CamperBot
@camperbot
Jan 13 2016 03:18
:warning: smzagury already gave sludge256 points
Artur
@ArturMC
Jan 13 2016 03:19
@batboy138 you aren't comparing it to strokes
Jelo Lawrence C. Canlas
@jelocanlas
Jan 13 2016 03:19
@batboy138 What seems to be the problem>
Artur
@ArturMC
Jan 13 2016 03:19

@batboy138

if (strokes == 1) {

and so on

Jelo Lawrence C. Canlas
@jelocanlas
Jan 13 2016 03:19
@batboy138 Yup.
Jon Spencer
@batboy138
Jan 13 2016 03:19
I can't get the first two else ifs to work.
Jelo Lawrence C. Canlas
@jelocanlas
Jan 13 2016 03:20
@batboy138 Follow @ArturMC 's hint
Ben Clist
@BenClist
Jan 13 2016 03:20
@batboy138 look at the arguments being passed to the function, you've used par, but you haven't used strokes
Jon Spencer
@batboy138
Jan 13 2016 03:21
@ArturMC It worked! Thanks @ArturMC
CamperBot
@camperbot
Jan 13 2016 03:21
batboy138 sends brownie points to @arturmc and @arturmc :sparkles: :thumbsup: :sparkles:
:star: 259 | @arturmc | http://www.freecodecamp.com/arturmc
:star: 259 | @arturmc | http://www.freecodecamp.com/arturmc
Niki
@ttmwebdesign
Jan 13 2016 03:25
Is anyone else having issues with Waypoint: Iterate Through an Array with a For Loop - where the console is being very strange?
in Safari I get: {"line":22,"column":116}, and in Chrome it's just {} ... Firefox is even worse.
ktestgit
@ktestgit
Jan 13 2016 03:27
/help stand in Line
CamperBot
@camperbot
Jan 13 2016 03:27

:point_right: checkpoint stand in line [wiki]

Checkpoint: Stand In Line

About queues

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

Instructions

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

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

The queue function should return the element that was removed.

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

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

Christine Miller
@cmiller13
Jan 13 2016 03:27
anyone else having problems with stand in line
Artur
@ArturMC
Jan 13 2016 03:27
I got it so if you need help
hit me up
Brian
@sludge256
Jan 13 2016 03:28
oh wait you said console
@ttmwebdesign the browser console or the FCC output box?
ktestgit
@ktestgit
Jan 13 2016 03:28
yes im having an issue with stand in line
Diego Burela
@dburela
Jan 13 2016 03:29
Guys guys any idea on what is making my code not work?
//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
  contacts.forEach(function(contact){
     if(contact.firstName === firstName && contact.hasOwnProperty(prop)){
         return contact[prop];
     }
     else {
         return "Not such property!";
     } 
  });
    // Only change code above this line
}

// Change these values to test your function
lookUp("Sherlock", "likes");
Artur
@ArturMC
Jan 13 2016 03:29
@ktestgit @cmiller13 try looking up the .push() and .shift() functions
Christine Miller
@cmiller13
Jan 13 2016 03:29
@ktestgit @ArturMC why doesnt arr.push(item); and return arr.shift(); work
Artur
@ArturMC
Jan 13 2016 03:30
@cmiller13 it worked for me. Show me your code?
greg
@wearenotgroot
Jan 13 2016 03:30
@dburela you forgot .hasOwnProperty(arg) check
Bill
@kirah1314
Jan 13 2016 03:30
@cmiller13 if you're getting maximum stack then refresh your browser
ktestgit
@ktestgit
Jan 13 2016 03:30
same here i am using arr.push(item) and return arr.shift()
Artur
@ArturMC
Jan 13 2016 03:31
@kirah1314 @cmiller13 yea try refreshing forgot I had that problem as well
Christine Miller
@cmiller13
Jan 13 2016 03:31
@kirah1314 omg thank you lol
CamperBot
@camperbot
Jan 13 2016 03:31
cmiller13 sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 808 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Diego Burela
@dburela
Jan 13 2016 03:31
@wearenotgroot still not giving me the results, but thanks for reminding me about that check
CamperBot
@camperbot
Jan 13 2016 03:31
dburela sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 396 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
Artur
@ArturMC
Jan 13 2016 03:31
@kirah1314 to the rescue :P
ktestgit
@ktestgit
Jan 13 2016 03:31
wow @kirah1314 refreshing worked
thanks
greg
@wearenotgroot
Jan 13 2016 03:32
@dburela remember you can also nest if statements
Crazypkr1099
@Crazypkr1099
Jan 13 2016 03:33
@Crazypkr1099
Can anyone help?
The second element in your target elements should bounce.
Waypoint: Target a Specific Child of an Element Using jQuery
(my answer) $(".target:nth-child(2)").addClass("animated-bounce");
Diego Burela
@dburela
Jan 13 2016 03:33
@wearenotgroot You mean to validate the return value ?
Bill
@kirah1314
Jan 13 2016 03:33
@ktestgit @ArturMC :thumbsup:
Crazypkr1099
@Crazypkr1099
Jan 13 2016 03:33
Nvm figured it out
Niki
@ttmwebdesign
Jan 13 2016 03:34
@sludge256 I guess the FCC output box? The little black box in the left sidebar.
Diego Burela
@dburela
Jan 13 2016 03:34
maybe the Checkpoint doesn't want me to use the method forEach()
greg
@wearenotgroot
Jan 13 2016 03:34
@dburela you have to perform 2 check. first if the firstName equal the firstName in the ith contact then check if .hasOwnProperty(prop)
@dburela then if both are true you can return result
Brian
@sludge256
Jan 13 2016 03:35
@ttmwebdesign I'm posting an issue about it as we speak. In the meantime if you need help I'm sure someone in chat can give you better error messages than that box :D
Diego Burela
@dburela
Jan 13 2016 03:35
yeah I updated my code, it should be doing that.
Niki
@ttmwebdesign
Jan 13 2016 03:36
As long as it is doing that I won't be able to complete that waypoint. I guess i'll see if I can skip it for now and wait until it's fixed. Thanks @sludge256
CamperBot
@camperbot
Jan 13 2016 03:36
ttmwebdesign sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 766 | @sludge256 | http://www.freecodecamp.com/sludge256
greg
@wearenotgroot
Jan 13 2016 03:36
@dburela what about if there isn't a contact with the given name(firstName)`?
Rex Schrader
@SaintPeter
Jan 13 2016 03:37
@dburela The problem with forEach is that it must loop through every item. When you "return" from inside it you're only returning to the closure. Basically: You can't use that to solve this problem . . . at least not easily.
Diego Burela
@dburela
Jan 13 2016 03:37
@SaintPeter I see what you mean, thanks
CamperBot
@camperbot
Jan 13 2016 03:37
dburela sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 2264 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Jan 13 2016 03:38
@dburela You could use a function like .every, because you could return "false" as soon as you found the item to stop the itteration.
@dburela But it's not a really obvious use case. You'd have to use a variable outside the .every loop to hold your output.
@dburela A for loop really is better, since you can just exit it with a simple return once you've found (or not found) the data.
Diego Burela
@dburela
Jan 13 2016 03:40
@SaintPeter What about declaring a variable in the outer function's scope and then returning it. would that work ?
i guess not because im dealing with different values?
Santiago de la Torre
@iargonut
Jan 13 2016 03:41
totally stuck in 74 can anyone helkp ??? :smile:
Rex Schrader
@SaintPeter
Jan 13 2016 03:41
@dburela You could do that - it's just more complicated and less effecient than doing it with a for. The problem is now you have to detect if there were no property for a given contact and return that. More logic to write.
@dburela It's less effecient becuase even if you found the thing in the first loop, you're going to loop through them all. You also need code to detect that.
greg
@wearenotgroot
Jan 13 2016 03:42
@dburela you almost have it. just change to regular for loop
Rex Schrader
@SaintPeter
Jan 13 2016 03:42
@dburela Imagine for a moment that the list were 50000 names long. Would you want to loop through all of them every time?
smzagury
@smzagury
Jan 13 2016 03:44
@iargonut Switch statements?
Diego Burela
@dburela
Jan 13 2016 03:44
@SaintPeter That makes sense. it wouldn't be too efficient if it has to loop until it reaches the last element. thanks again
CamperBot
@camperbot
Jan 13 2016 03:44
dburela sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: dburela already gave saintpeter points
Diego Burela
@dburela
Jan 13 2016 03:44
@wearenotgroot Yeah I will just use a for loop
Robert Richey
@0x0936
Jan 13 2016 03:45
binary search ;p
Santiago de la Torre
@iargonut
Jan 13 2016 03:45
@smzagury Your div element should have the class container-fluid. Make sure you have nested all HTML elements in .container-fluid.
@smzagury the div i got it all set
Gabe Pressman
@gpressman
Jan 13 2016 03:46
Anyone in here know Ruby on Rails?
matthew3454
@matthew3454
Jan 13 2016 03:46
Can someone please help me on Waypoint" Responsively Style Radio Buttons?
Sami Zaman
@sydszaman
Jan 13 2016 03:49

<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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


h2 {
font-family: Lobster, Monospace;
}

.smaller-image {
width: 100px;
}

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

</style>

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

<img src="https://bit.ly/fcc-relaxing-cat">
<img class="smaller-image">

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

the smaller image class isn't working
can someone please help
Manish Giri
@Manish-Giri
Jan 13 2016 03:49
@sydszaman the problem is here
<img src="https://bit.ly/fcc-relaxing-cat">
<img class="smaller-image">
Sami Zaman
@sydszaman
Jan 13 2016 03:50
what should i do then ?
Manish Giri
@Manish-Giri
Jan 13 2016 03:50
@sydszaman you need to have just one img element with the src and class attributes declared in the same img element
<img class="x" src="y">
Sami Zaman
@sydszaman
Jan 13 2016 03:51
thank you soo much
smzagury
@smzagury
Jan 13 2016 03:51
@iargonut Sorry. This is my first time helping someone in there. You need to put all the HTML in a div, as per usual. Then you need to give that div a class. Remember how classes are identified in css. Is that where the issue is?
Sami Zaman
@sydszaman
Jan 13 2016 03:51
i'll give it a shot
smzagury
@smzagury
Jan 13 2016 03:51
I need help with Waypoint: Using Objects for Lookups
LComplex
@LComplex
Jan 13 2016 03:51
hi im trying to complete the global scope and functions waypoint in the javascript section and i cant seem to understand why (so far) nothing ive written will give me a green checkmark besides not declaring oopsGlobal with a var keyword
Santiago de la Torre
@iargonut
Jan 13 2016 03:52
@smzagury i think so , first time seeing container-fluid thing , dont know what coes before class
LComplex
@LComplex
Jan 13 2016 03:52

```var myGlobal = 10;// Declare your variable here

function fun1() {
oopsGlobal = 5;// Assign 5 to oopsGlobal Here

}

// Only change code above this line
function fun2() {
var output = "";
if(typeof myGlobal != "undefined") {
output += "myGlobal: " + myGlobal;
}
if(typeof oopsGlobal != "undefined") {
output += " oopsGlobal: " + oopsGlobal;
}
console.log(output);
}
```

sorry i thought that was how you embed script
smzagury
@smzagury
Jan 13 2016 03:52
@iargonut what if that's the name of the class.
tommy
@tommygebru
Jan 13 2016 03:53
@LComplex ticks before and after lines of code
Santiago de la Torre
@iargonut
Jan 13 2016 03:53
@smzagury thats what i dont know lol
LComplex
@LComplex
Jan 13 2016 03:53
var myGlobal = 10;// Declare your variable here


function fun1() {
  oopsGlobal = 5;// Assign 5 to oopsGlobal Here

}

// Only change code above this line
function fun2() {
  var output = "";
  if(typeof myGlobal != "undefined") {
    output += "myGlobal: " + myGlobal;
  }
  if(typeof oopsGlobal != "undefined") {
    output += " oopsGlobal: " + oopsGlobal;
  }
  console.log(output);
}
jmesa92
@jmesa92
Jan 13 2016 03:54
I'm having some trouble with "Waypoint: Using Objects for Lookups"

Here's what I have
// Setup
function phoneticLookup(val) {
var result =

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

smzagury
@smzagury
Jan 13 2016 03:54
@iargonut Give it a shot. Let's say that for the sake of waypoints, you can use a class in your HTML even if you haven't defined it in your CSS
LComplex
@LComplex
Jan 13 2016 03:54
i thought it was asking me to making a var called myGlobal and assign 10 to it. and then to write in the fun1 function "oopsGlobal = 5;" but on the left hand side its still telling me that my global should be defined, that it should have a value of 10, that i need to define it with the var keyword and that oopsGlobal needs to have a value of 5. am i missing something?
tommy
@tommygebru
Jan 13 2016 03:54
@sydszaman reset code if not working come back to it later
Ben Clist
@BenClist
Jan 13 2016 03:55
@LComplex try resetting and doing it again, I can't see anything wrong with your code
LComplex
@LComplex
Jan 13 2016 03:55
ive reset about 20 times now thinking i still wrote something wrong
tommy
@tommygebru
Jan 13 2016 03:55
@jmesa92 i dont see switch
smzagury
@smzagury
Jan 13 2016 03:56
I'm struggling with Waypoint: Using Objects for Lookups

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

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

val = console.log(lookup);

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

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

jmesa92
@jmesa92
Jan 13 2016 03:56
@tommygebru it specifically says not to use switch
LComplex
@LComplex
Jan 13 2016 03:57
but thanks BenClist for that input. at least iknow im not going crazy :p
Robert Richey
@0x0936
Jan 13 2016 03:57
@LComplex hmm. after resetting your code did you also refresh your browser?
DJ
@qualitymanifest
Jan 13 2016 03:58
@LComplex i agree it looks fine from here. which waypoint is this?
tommy
@tommygebru
Jan 13 2016 03:58
@jmesa92 true I see it now
DJ
@qualitymanifest
Jan 13 2016 03:58
yep that should work
smzagury
@smzagury
Jan 13 2016 04:00

@tommygebru I'm also struggling with this one. But i've got var lookup = {
"alpha": "Adams",
"bravo": "Boston",
"charlie": "Chicago",
"delta": "Denver",
"echo": "Easy",
"foxtrot": "Frank"
};

val = lookup[];

tommy
@tommygebru
Jan 13 2016 04:00
@jmesa92 you have to create an object to contain all the data
smzagury
@smzagury
Jan 13 2016 04:01
@tommygebru I did - var lookup
tommy
@tommygebru
Jan 13 2016 04:01

@smzagury format it

properly

use three backticks ``` before and after the lines of code
to enter press (shift and enter)

jmesa92
@jmesa92
Jan 13 2016 04:04

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

// Only change code below this line
{
var lookup = {
"alpha": "Adams",

 "bravo":   "Boston",

 "charlie": "Chicago",

 "delta":   "Denver",

 "echo":    "Easy",

 "foxtrot": "Frank"
};

}

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

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

tommy
@tommygebru
Jan 13 2016 04:05
@jmesa92 remember the previous exercise on how to access an object
neuromeda
@neuromeda
Jan 13 2016 04:06
// 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[5439].artist = "ABBA"; 
  }

  return collection;
}
is this code redundant or am i on the right track?
Cody Noyes
@c-smooth
Jan 13 2016 04:07

I'm having trouble with the size your images waypoint I'm supposed to change the image size to 100px <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<style>

.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}
.smaller-image {
width: 100px;
}
p {
font-size: 16px;
font-family: Monospace;
}
</style>

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

<img src="https://bit.ly/fcc-relaxing-cat">

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

I'm not sure if that was the right way to post it
I can get it to change if use just the img tag and then tell it the width
but I need to create a custom class
tommy
@tommygebru
Jan 13 2016 04:09
@c-smooth are you saying that this doesnt work?
<img src="https://bit.ly/fcc-relaxing-cat" class="smaller-image">