These are chat archives for FreeCodeCamp/Help

8th
Jan 2016
Rae
@cs-knight
Jan 08 2016 00:00
<img src="https://bit.ly/fcc-relaxing-cat" class=smaller-image>
Buba
@bubacarrsowe
Jan 08 2016 00:00
@Takumar no worries, appreciate it
Matt Fay
@username1001
Jan 08 2016 00:01
canSomeoneHelpMePleasecanSomeoneHelpMePlease
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:01
@username1001 myMusic = [{stuff},{stuff}]
Matt Fay
@username1001
Jan 08 2016 00:01
@DevPoetsSociety Ahhh, I knew it was something simple. Thank you very much!
CamperBot
@camperbot
Jan 08 2016 00:01
username1001 sends brownie points to @devpoetssociety :sparkles: :thumbsup: :sparkles:
:star: 290 | @devpoetssociety | http://www.freecodecamp.com/devpoetssociety
vguria
@vguria
Jan 08 2016 00:03
@csrae you have to quote the classes, also if you add more than one, you must separate them with spaces
class="class1 class2 class3"
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:06
I am stuck again at Waypoint: Filter Arrays with filter. Please help.
var oldArray = [1,2,3,4,5,6,7,8,9,10];
var newArray = [];

// Only change code below this line.

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

newArray;
gavhanna
@gavhanna
Jan 08 2016 00:06
Anybody have any advice on how to tackle the "Checkpoint: Record Collection" javascript JSON challenge?
Craig McKenna
@craigdmckenna
Jan 08 2016 00:07
@ganeshkmurthy .push ?
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:07
@gavhanna post your code.
greg
@wearenotgroot
Jan 08 2016 00:07
@gavhanna read the instruction multiple time very carefully :)
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:08
@gavhanna That one you may want to work out the logic on paper first.
greg
@wearenotgroot
Jan 08 2016 00:08
@gavhanna then break it down to what kind of test to do with those variable
gavhanna
@gavhanna
Jan 08 2016 00:08
not sure of the syntax to check if the "value" part is non-blank
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:08
I figured it out. it should be <= 5.
gavhanna
@gavhanna
Jan 08 2016 00:09
if (collection[id].prop[value] !== "") ... doesnt seem to be the way!
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:09
blank == ""
Test the variables you're given before deciding what to do.
gavhanna
@gavhanna
Jan 08 2016 00:10
kk
ill mess around a bit more. cheers!
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:11
Read the instructions again. You have to do very different things depending on circumstances.
Gotta run. Good luck!
gavhanna
@gavhanna
Jan 08 2016 00:11
cheers!
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:12
@DevPoetsSociety is there a way to run tests without getting the massive success dialog?
greg
@wearenotgroot
Jan 08 2016 00:13
@ganeshkmurthy what you mean?
Luis Felipe López G.
@luishendrix92
Jan 08 2016 00:13
Copying and pasting the code on your browser's dev console (F12)
or using repl.it
Rae
@cs-knight
Jan 08 2016 00:13
<img src="https://bit.ly/fcc-relaxing-cat" class="smaller-image"</img>
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:13
@luishendrix92 but, FCC does not include all of the HTML, it hides the headers and everything. The code will not work outside of FCC.
pravisti
@pravisti
Jan 08 2016 00:16

Hi, I don't understand what I am supposed to do here - 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. var myArr = [1,2,3,4,5];

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

return item; // Change this line
}

Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:16
@wearenotgroot I usually run my tests and see the results in the bottom left-hand corner. I am having to close this green success dialog between tests. should be possible to hit a button and get the results.
GiovannyJean
@GiovannyJean
Jan 08 2016 00:16
var count = 0;

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

  if (card == 2,3,4,5,6){

    count++;

  }
  else if (card == 7,8,9){



  }
  else if (card == 10,'J','Q','K','A'){

    count--;

  }
  else if (card <= 0 ){
    count += "Hold";
  }

  else if (card > 0){
    count += "Bet";
  }








  return count;
  // 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');
Help!!!! Checkpoint: Counting Cards
greg
@wearenotgroot
Jan 08 2016 00:17
@ganeshkmurthy ctrl + enter. and in google chrome hit F12 and go to console so you can check the output and test it there
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:17
@wearenotgroot ctrl+enter pulls up the success dialog.
Thequadehunter
@Thequadehunter
Jan 08 2016 00:17
Can you just copy and paste code into the chat?
Aleksander Gębicki
@Takumar
Jan 08 2016 00:18

@GiovannyJean you cannot check values like that: "if (card == 2,3,4,5,6){"
do something like that instead: if (card>= 2 && card <= 6) {

else if (card == 7,8,9){  }

this is empty so it is not needed when it is not doing anything.

Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:18
@GiovannyJean switch statement would be easier. if you want to use if then it should be if ( card == '2' || card = '3' etc.
GiovannyJean
@GiovannyJean
Jan 08 2016 00:19
@Takumar @ganeshkmurthy Thanks!
CamperBot
@camperbot
Jan 08 2016 00:19
giovannyjean sends brownie points to @takumar and @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:star: 1602 | @takumar | http://www.freecodecamp.com/takumar
:star: 257 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
Sean McGuinness
@smmcguinness
Jan 08 2016 00:19
im having issues with using objects for lookups
Aleksander Gębicki
@Takumar
Jan 08 2016 00:19

@GiovannyJean

else if (card <= 0 ){
    count += "Hold";
  }

  else if (card > 0){
    count += "Bet";
  }

these conditions are never checked!
Create separate if/else condition for them.

Sean McGuinness
@smmcguinness
Jan 08 2016 00:20
using val to lookup
// Setup
function phoneticLookup(val) {
var result = "";

// Only change code below this line

var lookup= {
"alpha": function() {
return "Adams";
},
"bravo": function() {
return "Boston";
},
"charlie": function() {
return "Chicago";
},
"delta": function() {
return "Denver";
},
"echo": function() {
return "Easy";
},
"foxtrot": function() {
return "Frank";
}
};
lookup=["alpha"];
lookup=["bravo"];


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

// Change this value to test
phoneticLookup("charlie");
values from the lookuptable
Aleksander Gębicki
@Takumar
Jan 08 2016 00:20
@smmcguinness I think you overcomplicated your code.
greg
@wearenotgroot
Jan 08 2016 00:21
@smmcguinness key : value pair. and put it in the result variable
Thequadehunter
@Thequadehunter
Jan 08 2016 00:21

I'll just give the copy paste thing a shot I guess

Anybody know why myVar is still considered global? It says I declared a local variable but I still have a global one.

function myFunction() {
'use strict';
var myVar = "Come on";
console.log(myVar);
}
myFunction();

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

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

Oh wow sorry
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:21
@pravisti what is the waypoint name?
Thequadehunter
@Thequadehunter
Jan 08 2016 00:21
How do you paste code in the correct format?
Aleksander Gębicki
@Takumar
Jan 08 2016 00:21
@Thequadehunter wiki format
wiki format
CamperBot
@camperbot
Jan 08 2016 00:21

: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

Thequadehunter
@Thequadehunter
Jan 08 2016 00:21
Oh thanks

```function myFunction() {
'use strict';
var myVar = "Come on";
console.log(myVar);
}
myFunction();

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

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

Aleksander Gębicki
@Takumar
Jan 08 2016 00:22
@Thequadehunter remove these lines: console.log(myVar);
pravisti
@pravisti
Jan 08 2016 00:22
@ganeshkmurthy Checkpoint:Stand in Line
Thequadehunter
@Thequadehunter
Jan 08 2016 00:22
Aggh
I did and it still won't work
Aleksander Gębicki
@Takumar
Jan 08 2016 00:22
@Thequadehunter backticks have to be in their lines alone without any code
```
your code
```
Thequadehunter
@Thequadehunter
Jan 08 2016 00:22
Oh I didn't close it

function myFunction() {
  'use strict';
  var myVar = "Come on";
  console.log(myVar);
}
myFunction();

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

// now remove the console log line to pass the test
There we go
Aleksander Gębicki
@Takumar
Jan 08 2016 00:23
@Thequadehunter read the comments in code
// now remove the console log line to pass the test
Thequadehunter
@Thequadehunter
Jan 08 2016 00:23
I did that
Sean McGuinness
@smmcguinness
Jan 08 2016 00:23
@takumar @wearenotgroot i used this format from mdn because i had no success using waypoint example
Aleksander Gębicki
@Takumar
Jan 08 2016 00:23
@Thequadehunter remove both and try to refresh your browser.
Thequadehunter
@Thequadehunter
Jan 08 2016 00:24
Here's the thing, When I take out myFunction(); it still logs "come on"
Ok I'll try that
Wow
it worked
Thanks guys!
Aleksander Gębicki
@Takumar
Jan 08 2016 00:24
@Thequadehunter yupi! :-)
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:25
@pravisti you will need to use push function to add an item to the end of the list and the shift function to remove the first item and return it.
Thequadehunter
@Thequadehunter
Jan 08 2016 00:25
Is there anything I need to do to give you guys brownie points or whatever? Or is that automatic?
Aleksander Gębicki
@Takumar
Jan 08 2016 00:25
@smmcguinness use key:value syntax:
var lookup = {
"alpha": "Adams",
"bravo": "Boston",
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:25
@Thequadehunter thank them with @username
CamperBot
@camperbot
Jan 08 2016 00:25
ganeshkmurthy sends brownie points to @thequadehunter and @username :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for username
:star: 174 | @thequadehunter | http://www.freecodecamp.com/thequadehunter
Thequadehunter
@Thequadehunter
Jan 08 2016 00:26
@Takumar thanks!
Aleksander Gębicki
@Takumar
Jan 08 2016 00:26
Thank you @Thequadehunter is better :-)
CamperBot
@camperbot
Jan 08 2016 00:26
takumar sends brownie points to @thequadehunter :sparkles: :thumbsup: :sparkles:
:star: 175 | @thequadehunter | http://www.freecodecamp.com/thequadehunter
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:26
hmm...camperbot?
Aleksander Gębicki
@Takumar
Jan 08 2016 00:26
@Thequadehunter thanks! < this is not working :-(
Thequadehunter
@Thequadehunter
Jan 08 2016 00:27
huh
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:27
camperbot only understands thank you.
Thequadehunter
@Thequadehunter
Jan 08 2016 00:27
Oh
Thank you @Takumar
CamperBot
@camperbot
Jan 08 2016 00:27
thequadehunter sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 1603 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Jan 08 2016 00:27
@smmcguinness how is your code?
Rae
@cs-knight
Jan 08 2016 00:28
eh is this a bug?
Aleksander Gębicki
@Takumar
Jan 08 2016 00:28
@Thequadehunter I am glad that I could help :-)
Rae
@cs-knight
Jan 08 2016 00:28
I can't seem to resize my img
Aleksander Gębicki
@Takumar
Jan 08 2016 00:28
@csrae show your code.
pravisti
@pravisti
Jan 08 2016 00:28
@ganeshkmurthy myArray.push(), that is all I have right now. Do I have to use push and shift on the same line? I don't know how I can have the queue function return the element removed...
greg
@wearenotgroot
Jan 08 2016 00:28
@smmcguinness i suggest you read up on array and object. read up here http://www.w3schools.com/js/js_arrays.asp
Rae
@cs-knight
Jan 08 2016 00:28
<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;
  }

  img {
    img.smaller-image 
    width: 100px;
  }

</style>

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

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

<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>
Aleksander Gębicki
@Takumar
Jan 08 2016 00:29
@pravisti shift() method is returning removed value, you can store this value in any variable.
Fernando Barra
@ferbarra2207
Jan 08 2016 00:29
anyone stuck with basic javascript checkpoint: Record Collection.
Aleksander Gębicki
@Takumar
Jan 08 2016 00:29

@csrae please correct your CSS class definition:

img {
    img.smaller-image 
    width: 100px;
  }

You should start with class name:

.smaller-image { }
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:30
@pravisti you will need to pass the item as a parameter to push. example: arr.push(val). create a new variable to capture the removed value from the shift function and then return it. you will need to lookup previous waypoints to finish this checkpoint.
David Collins Moore
@3chordme
Jan 08 2016 00:31
@ferbarra2207 that is a particularly poorly worded set of instructions, it seems to be tripping up a lot of people. Are you stuck?
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:32
@pravisti push and shift should be in separate lines.
Rumen1982
@Rumen1982
Jan 08 2016 00:34
hey can anyone help me creating abootstrap button
vguria
@vguria
Jan 08 2016 00:34
i am a bit stuck at bonfire Where art thou
greg
@wearenotgroot
Jan 08 2016 00:35
@smmcguinness check you private chat
pravisti
@pravisti
Jan 08 2016 00:35
@ganeshkmurthy would this work to store the removed value from the shift function? - var returnMe = myArray.shift();
Aleksander Gębicki
@Takumar
Jan 08 2016 00:35
@Rumen1982 create <button></button> pair and add bootstrap classes to <button>
Rumen1982
@Rumen1982
Jan 08 2016 00:36
*a bootstrap button
vguria
@vguria
Jan 08 2016 00:36
function where(collection, source) {

  console.log('----------');
  console.log(collection);
  console.log(source);

  var sourceKeys = Object.keys(source);
  var retArr = [];

  retArr = collection.filter(function(val){
    for(var i = 0; i < sourceKeys.length; i++){
      if(val.hasOwnProperty(sourceKeys[i]) && val[sourceKeys[i]] === source[sourceKeys[i]]) {
        return true;
      }
      return false;
    }
  });


  console.log(retArr);
  // What's in a name?
  return retArr;
}
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:36
@pravisti yes, it will.
vguria
@vguria
Jan 08 2016 00:36
it doesn't pass the 2 last tests, and i think it is not filtering properly
Sean McGuinness
@smmcguinness
Jan 08 2016 00:36

@takumar ```js
// 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",
};
lookup["alpha"];
lookup["foxtrot"];

var val= "Adams";
lookup(val);
// Only change code above this line
return result;
}

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

// 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",
};
lookup["alpha"];
lookup["foxtrot"];

var val= "Adams";
lookup(val);
// Only change code above this line
return result;
}

// Change this value to test
phoneticLookup("charlie");
vguria
@vguria
Jan 08 2016 00:37
but i cant really find the problem
David Taylor
@cornjacket
Jan 08 2016 00:37
Hi, I just finished my first basejump. Can I get any volunteers to help me test it out. Any feedback would be great. Thanks.
Aleksander Gębicki
@Takumar
Jan 08 2016 00:37

@smmcguinness remove that:

lookup["alpha"];
lookup["foxtrot"];

var val= "Adams";

at the end of your function you return result variable, that variable is empty string, so it means that you should assign result to that variable.
You have to select correct value from your lookup table.

pravisti
@pravisti
Jan 08 2016 00:38
@ganeshkmurthy and to push an item at the end of the array - myArr.push(item); ?
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:38
@pravisti exactly.
John Irle
@JohnIrle
Jan 08 2016 00:38
Could someone help me with the record collection checkpoint? I feel like I'm close and I just have syntax wrong
Francisco
@a40637francisco
Jan 08 2016 00:38
c9.io is so sloow!!
Aleksander Gębicki
@Takumar
Jan 08 2016 00:39

@smmcguinness what you wrote: lookup["alpha"]; will give you in result "Adams" string and that's good path, but you want to get value according to val parameter.
Remember you call your function with argument:

phoneticLookup("charlie");

that means that val === "charlie"

Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:39
@doudeman post your code. it is easier if you post your code with your question.
John Irle
@JohnIrle
Jan 08 2016 00:40
// 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) {
  for (id in collection) {
    if (value !== "") {
      id.prop = value;
    } else if (prop == "tracks" && value !== "") {
        id.tracks.push(value);
    } else if (prop === "") {
        delete prop.value;
    }
  }



  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");
David Collins Moore
@3chordme
Jan 08 2016 00:41
@doudeman that one is tripping up everyone! my solution was to make three if statements that each modified the collection according to the instructions, and then return the collection at the end
pravisti
@pravisti
Jan 08 2016 00:41

@ganeshkmurthy It's giving me a range error: Maximum call stack size exceeded, I don't know what that means. Can you look at my code and see what I am doing wrong? Thanks! var myArr = [1,2,3,4,5];

function queue(arr, item) {

myArr.push(item);

var returnMe = myArray.shift();

return returnMe;
}

CamperBot
@camperbot
Jan 08 2016 00:41
pravisti sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:star: 258 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
David Collins Moore
@3chordme
Jan 08 2016 00:41
@doudeman which it looks like you've done ;) sorry
John Irle
@JohnIrle
Jan 08 2016 00:41
@3chordme I'm having problems with properties being read only or something not modifying the collection
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:41
@doudeman why use the for? it will assign the values for every item in the collection. you will need to assign the value only to the id that is sent to the function.
John Irle
@JohnIrle
Jan 08 2016 00:42
@ganeshkmurthy It's not doing the same thing as a for loop that counts?
greg
@wearenotgroot
Jan 08 2016 00:42
@smmcguinness checkout private chat again
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:43
@pravisti change myArray to myArr.
John Irle
@JohnIrle
Jan 08 2016 00:43
@ganeshkmurthy I don't think it's the for loop I think its how I'm defining the ifs
David Collins Moore
@3chordme
Jan 08 2016 00:44
@doudeman yeah, you don't need a for loop. also remember that if you use dot notation, it looks for a string with that name as a key. use bracket notation when using a variable to specify a key.
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:44
@doudeman not unless if you are checking if the id matches the collection's id in the for loop. Plus now you used same variable name for your ID, and the incoming value is lost.
pravisti
@pravisti
Jan 08 2016 00:44
@ganeshkmurthy still gives me the same error..
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:45
@pravisti sorry you should be referencing it using arr.
Alexander Køpke
@alexanderkopke
Jan 08 2016 00:45
@doudeman if (value !== "") {
id.prop = value;
} else if (prop == "tracks" && value !== "") { <- your first if says value !== ""... if this true then it never gets to else if
smk319
@smk319
Jan 08 2016 00:45
I'm working on the sizing image waypoint and have successfully shrunk the cat pic down to 100 pixels, but I can't figure out how to successfully insert the class "smaller-image"
pravisti
@pravisti
Jan 08 2016 00:46
@ganeshkmurthy did a quick browser refresh, it worked! Thanks for guiding me through this checkpoint : )
CamperBot
@camperbot
Jan 08 2016 00:46
pravisti sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:warning: pravisti already gave ganeshkmurthy points
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:46
@pravisti no problem!
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:46
@smk319 Post your code
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 00:46
Could someone explain the "stand in line" checkpoint to e
John Irle
@JohnIrle
Jan 08 2016 00:46
@alexanderkopke So I should change it to three ifs?
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:46
@KaanMasters Think of it as two tasks.
Alexander Køpke
@alexanderkopke
Jan 08 2016 00:46
@doudeman you could make another 'if' that would override the first if in case prop is "tracks
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:47
@KaanMasters You already know push and shift
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 00:47
Yea I have that
aaronK
@aaronk73
Jan 08 2016 00:47
hello all
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:47
hello @aaronk73
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:47
That's all there is to it
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 00:47
It wants me to push the item onto the end of the array, that's task #1
aaronK
@aaronk73
Jan 08 2016 00:47
may someone help me with this codemy instruction is to set the value of your placeholder attribute to “cat photo URL” this is my code<input type="text" placeholder="cat photo URL">
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 00:47
so that would be myArray.push(item)
John Irle
@JohnIrle
Jan 08 2016 00:48
 if (id[prop][value] !== "") {
      id[prop] = value;
    }
I'm getting closer with that
aaronK
@aaronk73
Jan 08 2016 00:48
@ganeshkmurthy thank you
CamperBot
@camperbot
Jan 08 2016 00:48
aaronk73 sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:star: 259 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
David Collins Moore
@3chordme
Jan 08 2016 00:48
@KaanMasters you need to use the push method to add an item to the end, then use the shift method to remove the first item, then return the array
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 00:48
And the second task is to remove the first value from the array, which would be myArr.shift()
David Collins Moore
@3chordme
Jan 08 2016 00:48
correct
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:49
Then return it
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 00:49
hmm, i feel like im trying that and it's not working
let me see
David Collins Moore
@3chordme
Jan 08 2016 00:49
oops, not return the array
return the removed element
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:49
Right
David Collins Moore
@3chordme
Jan 08 2016 00:49
so return arr.shift();
should work
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:50
Or if you can't modify that line, result = arr. shift etc
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:50
@aaronk73 what is the waypoint name?
John Irle
@JohnIrle
Jan 08 2016 00:50
It's saying TypeError: Cannot read property "ABBA" of undefined
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:51
Post the code
aaronK
@aaronk73
Jan 08 2016 00:51
add placeholder text to a field
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 00:51
// Setup
var myArr = [1,2,3,4,5];

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

  return myArr.shift;  // Change this line
}

// Display Code
console.log("Before: " + JSON.stringify(myArr));
console.log(queue(myArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(myArr));
John Irle
@JohnIrle
Jan 08 2016 00:51
function update(id, prop, value) {
    if (id[prop][value] !== "") {
      id[prop] = value;
    }

    if (id.prop == "tracks" && value !== "") {
        id.tracks.push(value);
    } 

    if (prop === "") {
        delete prop.value;
    }


  return collection;
}
Matt Fay
@username1001
Jan 08 2016 00:51
Waypoint: Accessing Nested Arrays in JSON.... Anyone on this?
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 00:51
i guess im just not understanding where the arr argument comes into play
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:52
shift once
John Irle
@JohnIrle
Jan 08 2016 00:52
@username1001 Just finished that one
Matt Fay
@username1001
Jan 08 2016 00:53
var myPlants = [
  { 
    type: "flowers",
    list: [
      "rose",
      "tulip",
      "dandelion"
    ]
  },
  {
    type: "trees",
    list: [
      "fir",
      "pine",
      "birch"
    ]
  }  
];

// Only change code below this line

var secondTree = myPlants.trees[1];
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:53
@aaronk73 that looks good to me. what is the error that you are seeing?
Brad940
@Brad940
Jan 08 2016 00:53
Can I please get some help for Waypoint: Return early pattern for functions? I don't understand what it's asking me to do.
David Collins Moore
@3chordme
Jan 08 2016 00:53
@KaanMasters you need to use arr.push and arr.shift
Matt Fay
@username1001
Jan 08 2016 00:53
@doudeman Can you tell my what I'm doing wrong?
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:53
@doudeman Just check the variables. You're trying to build something too early in that first IF
John Irle
@JohnIrle
Jan 08 2016 00:54
@username1001 You have to target "list"
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:54
@KaanMasters myArray is passed to arr. You can operate on arr instead.
aaronK
@aaronk73
Jan 08 2016 00:54
@ganeshkmurthy
Set the value of your placeholder attribute to "cat photo URL"
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 00:54
@3chordme where do i even specify the arr variable?
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:54
You have it
It's the argument
Sean McGuinness
@smmcguinness
Jan 08 2016 00:55
@takumar @wearenotgroot helped me with it. ive got the complete result
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:55
@doudeman you will need to reference the global variable, collection to access the JSON, collection[i][prop] =
Matt Fay
@username1001
Jan 08 2016 00:55
var secondTree = myPlants.list.tree[1];
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 00:55
and how do I know myArr is being passed through it
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:55
The calling code specifies it already
Matt Fay
@username1001
Jan 08 2016 00:55
Like that?
It doesn't work.
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 00:55
huh?
Matt Fay
@username1001
Jan 08 2016 00:55
I tried var secondTree = myPlants.list[1].tree[1]; as well
David Collins Moore
@3chordme
Jan 08 2016 00:56
@KaanMasters the parameter arr acts as a variable that is used within the function. Then you can enter different arrays and run the function multiple times. So instead of specifically modifying myArray, modify arr.
John Irle
@JohnIrle
Jan 08 2016 00:56
@username1001 don't focus on tree. you have type and list to target
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 00:56
@aaronk73 post all of your code.
Kurwyne
@Kurwyne
Jan 08 2016 00:56
Hey guys I am working on this checkpoint record collection and I m having a hard time targeting the array within a json array can someone take a look.
John Irle
@JohnIrle
Jan 08 2016 00:56
@username1001 tree isn't a property
Kurwyne
@Kurwyne
Jan 08 2016 00:56
if (collection[id][prop] === []) {
collection[id][prop].push(value);
return collection;
David Collins Moore
@3chordme
Jan 08 2016 00:56
See how the tests running on the side enter different arguments? The parameters from the function declaration will become equal to the corresponding arguments when the function is called.
Kurwyne
@Kurwyne
Jan 08 2016 00:57
basically trying to say if the property is an array push the following
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 00:57
I am super confused haha
David Collins Moore
@3chordme
Jan 08 2016 00:57
lol i'm sorry! I can try to explain more
Your function will only ever modify myArray, which works when that array needs to be modified, but doesn't work when other arrays are entered.
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:57
@username1001 myPlants is an array without named items, so use an index
aaronK
@aaronk73
Jan 08 2016 00:58
<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;
  }
</style>

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

<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>
<input type="text">
<input type="text"
      placeholder= "#">
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 00:58
Haha it's ok
aaronK
@aaronk73
Jan 08 2016 00:58
@ganeshkmurthy thank you ganeshkmuthy
John Irle
@JohnIrle
Jan 08 2016 00:58
function update(id, prop, value) {
    if (collection.id[prop][value] !== "") {
      collection.id.prop = value;
    }

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

    if (prop === "") {
        delete prop.value;
    }


  return collection;
}
CamperBot
@camperbot
Jan 08 2016 00:58
:warning: aaronk73 already gave ganeshkmurthy points
aaronk73 sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 00:58
So the myArr is going into the arr variable?
Alexander Køpke
@alexanderkopke
Jan 08 2016 00:59
@username1001 myPlants has two entries.. you have to choose the second one before you get to list
John Irle
@JohnIrle
Jan 08 2016 00:59
Now it is saying "TypeError: Cannot read property 'artist' of undefined"
David Collins Moore
@3chordme
Jan 08 2016 00:59
yes!
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 00:59
@KaanMasters Yup, down at the bottom
Sean McGuinness
@smmcguinness
Jan 08 2016 00:59
greg
@wearenotgroot
Jan 08 2016 00:59
@doudeman you only need to test the arguments. that means just
if(value !== "") and if(pop==="tracks")
David Collins Moore
@3chordme
Jan 08 2016 01:00
arr = myArr when you put in the following queue(myArr, 6)
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 01:00
Oook I see that now
David Collins Moore
@3chordme
Jan 08 2016 01:00
item = 6
Andrew Boyle
@CThePants
Jan 08 2016 01:00
How would I take a specific element out of an array (i.e. array[2]) and turn it into a string?
vguria
@vguria
Jan 08 2016 01:00
nevermind, solved it
John Irle
@JohnIrle
Jan 08 2016 01:00
@wearenotgroot What do you mean?
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:00
@aaronk73 in your first comment, you posted the right statement. I don't see it in your new code.
@aaronk73 update the placeholder line.
greg
@wearenotgroot
Jan 08 2016 01:01
@doudeman the function update has some arguments. update(id, prop value) test those
Alexander Køpke
@alexanderkopke
Jan 08 2016 01:01
@username1001 myPlants[0] would address the first object
Kurwyne
@Kurwyne
Jan 08 2016 01:01
anyone?
John Irle
@JohnIrle
Jan 08 2016 01:01
@wearenotgroot Yes
Matt Fay
@username1001
Jan 08 2016 01:01
@KaanMasters You're not the only one! @DevPoetsSociety Alright, I'll give it another go
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 01:02
@Kurwyne What was the question?
Matt Fay
@username1001
Jan 08 2016 01:02
@alexanderkopke Thank you, I think I can solve it now!
CamperBot
@camperbot
Jan 08 2016 01:02
username1001 sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
greg
@wearenotgroot
Jan 08 2016 01:02
@doudeman test those arguments. like if(prop==="tracks")
CamperBot
@camperbot
Jan 08 2016 01:02
:star: 394 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
aaronK
@aaronk73
Jan 08 2016 01:02
@ganeshkmurthy update the place holder line to what?
John Irle
@JohnIrle
Jan 08 2016 01:02
@wearenotgroot I did
Kurwyne
@Kurwyne
Jan 08 2016 01:02
@DevPoetsSociety I am trying push a value into an array of an object with the following function.
if (collection[id][prop] === []) {
collection[id][prop].push(value);
return collection;
That's the code i am using
but instead it's pushing the value as just a string and it's not going into the array =//
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:03
@aaronk73 to what you said previously, "this is my code<input type="text" placeholder="cat photo URL">"
greg
@wearenotgroot
Jan 08 2016 01:03
@doudeman you didnt. what you did is test the value from the collection and not the argument supplied to the function
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 01:03
woops
Okay so here's what I have
// Setup
var myArr = [1,2,3,4,5];

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

  return arr.shift;  // Change this line
}

// Display Code
console.log("Before: " + JSON.stringify(myArr));
console.log(queue(myArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(myArr));
Kurwyne
@Kurwyne
Jan 08 2016 01:03
i guess my question is how would i target the array of an object
Bill
@kirah1314
Jan 08 2016 01:04
@KaanMasters return myArr.shift();
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:04
@aaronk73 after removing the "this is my code" part.
John Irle
@JohnIrle
Jan 08 2016 01:04
@wearenotgroot collection[id][prop][value] isn't targeting the argument?
aaronK
@aaronk73
Jan 08 2016 01:05
@ganeshkmurthy i did that and it still gave me same error
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 01:05
@Kurwyne That's the record collection?
Matt Fay
@username1001
Jan 08 2016 01:05
Well, I solved it! Thanks guys!
Alexander Køpke
@alexanderkopke
Jan 08 2016 01:05
:clap:
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:05
@aaronk73 remove the input line above it.
@aaronk73 and post your code again.
greg
@wearenotgroot
Jan 08 2016 01:06
@doudeman no you have function update(id, prop, value) you need to use those to get the result from collection so,
it will be
if(value =="") for example
Matt Fay
@username1001
Jan 08 2016 01:06
But what exactly is it doing? Is myPlants[1] going to the second object?
Kurwyne
@Kurwyne
Jan 08 2016 01:06
yesss @DevPoetsSociety
Matt Fay
@username1001
Jan 08 2016 01:06
e.g.type: trees
aaronK
@aaronk73
Jan 08 2016 01:06
@ganeshkmurthy thank you , i feel silly
CamperBot
@camperbot
Jan 08 2016 01:06
aaronk73 sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:warning: aaronk73 already gave ganeshkmurthy points
John Irle
@JohnIrle
Jan 08 2016 01:07
@username1001 no the second object holds type trees and the list as properties
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:07
@aaronk73 no problem!
Sean McGuinness
@smmcguinness
Jan 08 2016 01:07
thanks @takumar for the explanations
CamperBot
@camperbot
Jan 08 2016 01:07
smmcguinness sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 1607 | @takumar | http://www.freecodecamp.com/takumar
John Irle
@JohnIrle
Jan 08 2016 01:07
@doudeman myPlants[1] selects the second object and then you need to select the property you want
greg
@wearenotgroot
Jan 08 2016 01:07

@doudeman your first if statement should be:

if (value !== "") {
collection.id.prop = value;
}

not

if (collection.id[prop][value] !== "") {
collection.id.prop = value;
}

John Irle
@JohnIrle
Jan 08 2016 01:08
@wearenotgroot I see
Joel
@TXTechTurtle
Jan 08 2016 01:08
Has anybody else gotten past the Spinal Tap Case bonfire?
I feel like I just cheated to finish it
:(
scottmike0
@scottmike0
Jan 08 2016 01:08
@MarysTurtle what is the code and the instructions
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 01:08
@Kurwyne For starters, you're testing the existing record, and not the value that was passed to you.
Matt Fay
@username1001
Jan 08 2016 01:08

@doudeman yeah, so the second object is

 {
    type: "trees",
    list: [
      "fir",
      "pine",
      "birch"
    ]
  }

and .list[1]; is accessing "pine", correct?

Joel
@TXTechTurtle
Jan 08 2016 01:09
I wouldn't mind someone taking a glance at the code.
John Irle
@JohnIrle
Jan 08 2016 01:09
@wearenotgroot Thanks! I'm closer now
CamperBot
@camperbot
Jan 08 2016 01:09
doudeman sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 274 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
scottmike0
@scottmike0
Jan 08 2016 01:09
@username1001 you cant access and array using objects :P
greg
@wearenotgroot
Jan 08 2016 01:09
@doudeman np GL
Joel
@TXTechTurtle
Jan 08 2016 01:09
@scottmike0 I mean the code satisfies the instructions.
John Irle
@JohnIrle
Jan 08 2016 01:09
@username1001 yes so you need myPlant[1].somepropertyintheobject
Joel
@TXTechTurtle
Jan 08 2016 01:09
function spinalCase(str) {

  str = str.replace(str.charAt(0), str.charAt(0).toLowerCase());
  str = str.replace(/[A-Z]/g, function(match) {
    return "-" + match;
  });
  return str.toLowerCase().replace(/\s\-|\_\-|\s|\_/g, "-");
}
aaronK
@aaronk73
Jan 08 2016 01:10
@ganeshkmurthy thank you for your help , want to finsih my way points
CamperBot
@camperbot
Jan 08 2016 01:10
aaronk73 sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:warning: aaronk73 already gave ganeshkmurthy points
scottmike0
@scottmike0
Jan 08 2016 01:10
@MarysTurtle what @doudeman said :P
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 01:10
so what does this mean when it say queue([2],1)? what is the two in the brackets that goes into the function
Joel
@TXTechTurtle
Jan 08 2016 01:10
@scottmike0 What'd he say?
scottmike0
@scottmike0
Jan 08 2016 01:10
@KaanMasters what is the code :D
David Collins Moore
@3chordme
Jan 08 2016 01:10
@KaanMasters That is another array, but with only one number
Bill
@kirah1314
Jan 08 2016 01:10
@KaanMasters [2] is an array with 1 element
David Collins Moore
@3chordme
Jan 08 2016 01:11
An array can have 0, one, or many elements
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:11
@aaronk73 you are welcome. keep going!
scottmike0
@scottmike0
Jan 08 2016 01:11
@MarysTurtle he said yes so you need myPlant[1].somepropertyintheobjec
Andrew Boyle
@CThePants
Jan 08 2016 01:11
How would I take a specific element out of an array (i.e. array[2]) and turn it into a string?
Matt Fay
@username1001
Jan 08 2016 01:11
@doudeman I figured it out, just trying to get a better understanding haha. @scottmike0 the array* whatever, lol. My weakness is knowing the terms, I can't memorize all this stuff, though I should start trying :smile:
scottmike0
@scottmike0
Jan 08 2016 01:11
@username1001 i was confused as well, there will be alot more practice as well if you keep continuing the way points
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 01:12
This is the code, I have it so it removes the first number and the last, but it wont satisfy the challenge
// Setup
var myArr = [1,2,3,4,5];

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

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

// Display Code
console.log("Before: " + JSON.stringify(myArr));
console.log(queue([], 1)); // Modify this line to test
console.log("After: " + JSON.stringify(myArr));
Andre Parsons
@Andrparsons
Jan 08 2016 01:12
hi guys, can I post my solution for Sorted Union here? it almost works, but in some cases it adds a comma to the end and I can't figure out how to fix it
Bill
@kirah1314
Jan 08 2016 01:12
@CThePants that depends what data type is that specific element you want to take and turn into a string. It might already be a string...
greg
@wearenotgroot
Jan 08 2016 01:12
@KaanMasters use arr instead
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 01:13
where?
Matt Fay
@username1001
Jan 08 2016 01:13
@scottmike0 Indeed, but I'm almost finished with the waypoints.. just have the last checkpoint then I get to finish up the bonfires :smile:
David Collins Moore
@3chordme
Jan 08 2016 01:13
@KaanMasters remember, the way you have it written here is not going to work on any array other than myArr. Use arr for both the push and the shift.
greg
@wearenotgroot
Jan 08 2016 01:13
@KaanMasters arr.push(item)
Andrew Boyle
@CThePants
Jan 08 2016 01:13
@kirah1314 it is already a string but I can't evaluate the length. How can I evaluate the length?
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 01:13
oh
greg
@wearenotgroot
Jan 08 2016 01:13
@KaanMasters it happens
ramireznoe01
@ramireznoe01
Jan 08 2016 01:13
Is a constructor function the prototype object of its instances?
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 01:13
my god it worked
Matt Fay
@username1001
Jan 08 2016 01:13
Nvm, still have two of the new waypoints
Bill
@kirah1314
Jan 08 2016 01:13
@CThePants arr[1].lengthdoesn't work? 1 meaning the [1]th element
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 01:13
but theres no way i could have got that myself
David Collins Moore
@3chordme
Jan 08 2016 01:13
@Andrparsons feel free! Use three backticks before and after code to post with syntax highlighting
Matt Fay
@username1001
Jan 08 2016 01:14
@KaanMasters , greatest feeling ever, eh? :P
greg
@wearenotgroot
Jan 08 2016 01:14
@KaanMasters :)
David Collins Moore
@3chordme
Jan 08 2016 01:14
@KaanMasters lol don't worry it will make more sense as you go
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 01:14
thanks @wearenotgroot @DevPoetsSociety @3chordme
Andrew Boyle
@CThePants
Jan 08 2016 01:14
@kirah1314 It just returns 1. The actual string length is 5.
CamperBot
@camperbot
Jan 08 2016 01:14
kaanmasters sends brownie points to @wearenotgroot and @devpoetssociety and @3chordme :sparkles: :thumbsup: :sparkles:
:star: 318 | @3chordme | http://www.freecodecamp.com/3chordme
:star: 275 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
:star: 291 | @devpoetssociety | http://www.freecodecamp.com/devpoetssociety
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 01:14
It makes me feel stupid haha
Bill
@kirah1314
Jan 08 2016 01:14
@CThePants it's probably a good idea to post codes showing what you're trying to do
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 01:14
I'm just going to look at it for like 15 more minutes and really try to soak up whats going on here
Andre Parsons
@Andrparsons
Jan 08 2016 01:15
function unite(arr1, arr2, arr3) {
  var unitedArray = [arr1, arr2, arr3].reduce(function(a,b){
    return a.concat(b);
  });
  var filterArray = [],
      origLength = unitedArray.length,
      present = false;

  for(var i = 0; i < origLength; i++){
    present = false;
    for (var j = 0; j < filterArray.length; j++){
      if (unitedArray[i] === filterArray[j]){
        present = true;
        break;
      }
    }
    if (present === false) {
      filterArray.push(unitedArray[i]);
    }

  }

  return filterArray;
}

//unite([1, 3, 2], [5, 2, 1, 4], [2, 1]);
unite([1, 2, 3], [5, 2, 1]);
aaronK
@aaronk73
Jan 08 2016 01:15
may i get some help please.
Andre Parsons
@Andrparsons
Jan 08 2016 01:15
the commented out input works, the second does not
Matt Fay
@username1001
Jan 08 2016 01:15
@aaronk73 What do you need help with?
Andrew Boyle
@CThePants
Jan 08 2016 01:15
@kirah1314 Here is my code:

function findLongestWord(str) {
var large = 0;
var word;
var arr = str.split('');
for (var i = 0; i < arr.length; i++){

if (arr[i].length > large){
  large = arr[i].length;
}

}

return large;
}

findLongestWord("The quick brown fox jumped over the lazy dog");

aaronK
@aaronk73
Jan 08 2016 01:16
<form action="/submit-cat-photo"></form>
error is nest tiyr text input element within a form element
@username1001 thank you
scottmike0
@scottmike0
Jan 08 2016 01:16
@username1001 you are that close to being done!!!!
@username1001 damn i must be lazy af, i have not did many lessons today :/
Bill
@kirah1314
Jan 08 2016 01:17
@CThePants your split turned the string into individual characters var arr = str.split('');
zou difan
@zoudifan
Jan 08 2016 01:17

Waypoint: Manipulate Arrays With shift

``` // Example
var ourArray = ["Stimpson", "J", ["cat"]];
removedFromOurArray = ourArray.shift();
// removedFromOurArray now equals "Stimpson" and ourArray now equals ["J", ["cat"]].

// Setup
var myArray = [["John", 23], ["dog", 3]];

// Only change code below this line.
var removedFromMyArray=myArray.shift();
myArray=myArray.shift();
```

I do that like this ,why can't I pass the myArray should now equal [["dog", 3]].

Andrew Boyle
@CThePants
Jan 08 2016 01:17
@kirah1314 Oh duh!! I'm a dope. Thanks for pointing that out!
CamperBot
@camperbot
Jan 08 2016 01:17
cthepants sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
Bill
@kirah1314
Jan 08 2016 01:17
@CThePants if you want to separate a string into words then you add a space between the quotes
CamperBot
@camperbot
Jan 08 2016 01:17
:star: 775 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Matt Fay
@username1001
Jan 08 2016 01:17
@scottmike0 Yeah, haha I've been working on them though for quite awhile. But also codecademy, etc. I never try to memorize the terms, just figure the things out.
Bill
@kirah1314
Jan 08 2016 01:18
@CThePants :thumbsup:
Matt Fay
@username1001
Jan 08 2016 01:18
@aaronk73 Which checkpoint? I don't know what they want you to do
Andrew Boyle
@CThePants
Jan 08 2016 01:18
@kirah1314 Thanks for the help!!!! This community is the best!!!
CamperBot
@camperbot
Jan 08 2016 01:18
cthepants sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: cthepants already gave kirah1314 points
Bill
@kirah1314
Jan 08 2016 01:18
@CThePants you're welcome and GL!
Matt Fay
@username1001
Jan 08 2016 01:18
@scottmike0 I think you helped me on a checkpoint lastnight, no?
zou difan
@zoudifan
Jan 08 2016 01:18
```test
aaronK
@aaronk73
Jan 08 2016 01:19
@username1001
create a form element
David Collins Moore
@3chordme
Jan 08 2016 01:19

@KaanMasters parameters/arguments are a bit tricky to grasp at first. Parameters are the placeholders, they act like variables. Arguments are what the parameters get set to. They are useful, because they make functions versatile. Imagine we want a function that adds ANY two numbers we input. That would look like this:

function add(num1, num2) { //the function is named add, the parameters are num1 and num2
return num1 + num2;
}

Now when we call the function, we can stick in any two numbers as arguments, and they will be added together.

add(3, 5); //3 and 5 are the arguments. This returns 8.
add(1, 9); //1 and 7 are the arguments. This returns 10.

In your example, arr was the parameter, and instead of modifying that, you kept modifying myArr, which was correct when it ran the first test (because myArr was also the argument) but incorrect later (when the argument was [2]).

@zoudifan put three backticks after as well :)
ramireznoe01
@ramireznoe01
Jan 08 2016 01:20
hi! I have a question.
Is a constructor function the prototype object of its instances?
Alexis Reina
@alexisreina
Jan 08 2016 01:20
@ramireznoe01 hi
zou difan
@zoudifan
Jan 08 2016 01:20
test
Jared Abel
@jaredabel
Jan 08 2016 01:21
best way to get this variable to work? $('body').css("background-image", "url:(sunny)");
Alexis Reina
@alexisreina
Jan 08 2016 01:21
@ramireznoe01 wat?
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:21
@zoudifan this will help you out.
wiki format
CamperBot
@camperbot
Jan 08 2016 01:21

: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

aaronK
@aaronk73
Jan 08 2016 01:21
@username1001 «
my error is nest your text input element within a form element
Alexis Reina
@alexisreina
Jan 08 2016 01:21
@ramireznoe01 the prototype object is an Object
GiovannyJean
@GiovannyJean
Jan 08 2016 01:21
// 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");
Help!!! Waypoint: Using Objects for Lookups
zou difan
@zoudifan
Jan 08 2016 01:22
test
aaronK
@aaronk73
Jan 08 2016 01:23
@ganeshkmurthy will you be able to help me with this error
zou difan
@zoudifan
Jan 08 2016 01:23
'''test '''
CamperBot
@camperbot
Jan 08 2016 01:23
:bulb: to format code use backticks! ``` more info
Ian
@IMLaing
Jan 08 2016 01:23
@GiovannyJean try quotes around your properties
zou difan
@zoudifan
Jan 08 2016 01:23

greg
@wearenotgroot
Jan 08 2016 01:23
@GiovannyJean what do you think you should do? wink!
aaronK
@aaronk73
Jan 08 2016 01:23
@ganeshkmurthy nest your text input element within a form element
Matt Fay
@username1001
Jan 08 2016 01:24
@aaronk73 I found your problem, you need your text field nested "between" the form tags. so you need to move this</form> so it's closing off the input type="text"
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:24
@aaronk73 what was your code?
David Collins Moore
@3chordme
Jan 08 2016 01:24
@GiovannyJean you are going to want to use bracket notation to make your result equal to "Chicago"
aaronK
@aaronk73
Jan 08 2016 01:24
<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;
  }
</style>

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

<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>
<input type="text" placeholder="cat photo URL">

<form action="/submit-cat-photo"></form>
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:25
you will need to nest the input box inside the form like this, <form ...> <input> </form>
Matt Fay
@username1001
Jan 08 2016 01:25
@aaronk73 Not remove, but move it. It's like closing off a photo with a link i.e. <a href="#"><img src="#"></a>
Bill
@kirah1314
Jan 08 2016 01:25
@aaronk73 <form action="/submit-cat-photo"><input type="text" placeholder="cat photo URL"></form>
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:25
@aaronk73 in separate lines.
John Irle
@JohnIrle
Jan 08 2016 01:26
After update(2548, "artist", ""), artist should not be set
After update(2548, "artist", ""), artist should not be set
function update(id, prop, value) {
    if (value !== "") {
      collection[id][prop] = value;
    }

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




  return collection;
}
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:26
@doudeman there are 3 parts on that solution. you have coded only 2.
John Irle
@JohnIrle
Jan 08 2016 01:27
@ganeshkmurthy The third part is for a different part of the solution
zou difan
@zoudifan
Jan 08 2016 01:27
// Example
var ourArray = ["Stimpson", "J", ["cat"]];
removedFromOurArray = ourArray.shift();
// removedFromOurArray now equals "Stimpson" and ourArray now equals ["J", ["cat"]].

// Setup
var myArray = [["John", 23], ["dog", 3]];

// Only change code below this line.
var removedFromMyArray=myArray.shift();
myArray=myArray.shift();

I do that like this ,but Ican't pass the myArray should now equal [["dog", 3]].

why ?

Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:27
@doudeman you can include the 3rd part (delete property) in the same update function.
John Irle
@JohnIrle
Jan 08 2016 01:28
@ganeshkmurthy That isn't the problem I'm having
greg
@wearenotgroot
Jan 08 2016 01:28
@doudeman you need the last if statement and delete the property just like @ganeshkmurthy said
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:28
@doudeman that is what the error is point to.
aaronK
@aaronk73
Jan 08 2016 01:28
@kirah1314 @ganeshkmurthy @username1001 thank you all for your help
CamperBot
@camperbot
Jan 08 2016 01:28
aaronk73 sends brownie points to @kirah1314 and @ganeshkmurthy and @username1001 :sparkles: :thumbsup: :sparkles:
:warning: aaronk73 already gave ganeshkmurthy points
:star: 776 | @kirah1314 | http://www.freecodecamp.com/kirah1314
:star: 322 | @username1001 | http://www.freecodecamp.com/username1001
zou difan
@zoudifan
Jan 08 2016 01:28
somebody help me
David Collins Moore
@3chordme
Jan 08 2016 01:28
@zoudifan try myArray[0] = myArray.shift();
You'll notice the double square brackets, that means it is an array inside of an array
greg
@wearenotgroot
Jan 08 2016 01:29
@doudeman also switch the two if posistion. test the second one first
zou difan
@zoudifan
Jan 08 2016 01:29
@3chordme I will try .
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:29
@doudeman ok, one more thing. your first if condition will get processed even for tracks which is an array.
Thomas Headle
@TGHeadle1371
Jan 08 2016 01:30
Hello everyone, I am stuck on the word blanks waypoint
John Irle
@JohnIrle
Jan 08 2016 01:30
@wearenotgroot My bad I didn't understand that it was updating to blank. I thought I had to just not touch the value if one wasn't passed
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:30
@doudeman you cannot assign a value directly to an array, you should use push function.
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 01:30
@TGHeadle1371 Make sure you're adding space b/t words
evanday17
@evanday17
Jan 08 2016 01:30
can anyone help me with aligning my image?
zou difan
@zoudifan
Jan 08 2016 01:30
@3chordme use 'myArray[0] = myArray.shift();' I passed , thanks!
CamperBot
@camperbot
Jan 08 2016 01:30
zoudifan sends brownie points to @3chordme :sparkles: :thumbsup: :sparkles:
evanday17
@evanday17
Jan 08 2016 01:30
i want to move it a little to the right and then up a little bit as well
CamperBot
@camperbot
Jan 08 2016 01:30
:star: 319 | @3chordme | http://www.freecodecamp.com/3chordme
John Irle
@JohnIrle
Jan 08 2016 01:30
@ganeshkmurthy I used push
Thomas Headle
@TGHeadle1371
Jan 08 2016 01:30
@DevPoetsSociety I'm gonna do that and see what I come back with
smk319
@smk319
Jan 08 2016 01:31
I'm working on the nesting a dead image in an a element waypoint and I'm stuck, but I can't find what's wrong with it. I had just nested a pic a second ago and it went through fine.
Here is the code I'm working with: <a href="#"><img src="http://bit.ly/fcc-running-cats"/></a>
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:31
@doudeman your first if will get executed even when the prop is tracks. That will fail.
David Collins Moore
@3chordme
Jan 08 2016 01:31
@zoudifan yay!
zou difan
@zoudifan
Jan 08 2016 01:32
@3chordme but I don't know why an array can't equal another array .
evanday17
@evanday17
Jan 08 2016 01:32
can anyone help me align my img? i just want to move it to the right and then up a little bit....i tried floating and padding but neither is working
John Irle
@JohnIrle
Jan 08 2016 01:32
@ganeshkmurthy Thank you I'm working on it right now
CamperBot
@camperbot
Jan 08 2016 01:32
doudeman sends brownie points to @ganeshkmurthy :sparkles: :thumbsup: :sparkles:
:star: 260 | @ganeshkmurthy | http://www.freecodecamp.com/ganeshkmurthy
Michael Lefkowitz
@lfkwtz
Jan 08 2016 01:32
Hi, I have created a page for the FCC Wiki, but I don't quite understand how to push that change to them on git. Has anyone done this before and can walk me through it?
Thomas Headle
@TGHeadle1371
Jan 08 2016 01:34
I'm unsure how to start the string @DevPoetsSociety
Matt Fay
@username1001
Jan 08 2016 01:34
Checkpoint: Record Collection Is there like a "helpful articles" for this one?
Bill
@kirah1314
Jan 08 2016 01:34
@evanday17 have you tried margin-top, margin-left, margin-bottom, margin-right?
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 01:34
@TGHeadle1371 Post your code?
Thomas Headle
@TGHeadle1371
Jan 08 2016 01:34

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

John Irle
@JohnIrle
Jan 08 2016 01:34
@username1001 No lol I Checked
evanday17
@evanday17
Jan 08 2016 01:34
@kirah1314 i feel like i have tried everything lol
<img  src="https://dl.dropbox.com/s/yubrq474hemmep6/crossfittpic.jpg" alt="crossfit" style="width300px;height:350px;">
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 01:35
@TGHeadle1371 OK, they started for you with result = ""
Bill
@kirah1314
Jan 08 2016 01:35
@evanday17 ok, do you have this on codepen? post the link?
Matt Fay
@username1001
Jan 08 2016 01:35
@doudeman Damn haha think I'll just save that one for tomorrow :P
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:36
@username1001 funny, it is one of the few that does not have a help page, https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Map
Matt Fay
@username1001
Jan 08 2016 01:37
@ganeshkmurthy have you figured it out?
matthew3454
@matthew3454
Jan 08 2016 01:37
Can someone please answer a simple question on the Waypoint: Set the ID of an Element exercise?
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:37
@username1001 yes
Matt Fay
@username1001
Jan 08 2016 01:37
@matthew3454 Sure
Ian
@IMLaing
Jan 08 2016 01:37
@matthew3454 What is your question?
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 01:37
@matthew3454 Shoot
Ian
@IMLaing
Jan 08 2016 01:37
Good job team.
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 01:37
lol
Matt Fay
@username1001
Jan 08 2016 01:38
@ganeshkmurthy You should make the wiki :smile:
matthew3454
@matthew3454
Jan 08 2016 01:38
Okay Thanks
Matt Fay
@username1001
Jan 08 2016 01:38
haha
matthew3454
@matthew3454
Jan 08 2016 01:38

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

<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 class="gray-background">
<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 id="cat-photo-app" action="/submit-cat-photo">
<label><input type="ratio" 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>

DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 01:38
wiki format
CamperBot
@camperbot
Jan 08 2016 01:38

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:38
@username1001 lol. have not figured out the wiki submissions yet.
Brian
@sludge256
Jan 08 2016 01:38
@ganeshkmurthy It's because that exercise is new
Matt Fay
@username1001
Jan 08 2016 01:38
@matthew3454 What was the question ?
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:38
@sludge256 i see
Brian
@sludge256
Jan 08 2016 01:39
Someone could probably PR their own wiki write up
matthew3454
@matthew3454
Jan 08 2016 01:39
I just don't know why the id is not working
Matt Fay
@username1001
Jan 08 2016 01:39
@ganeshkmurthy @sludge256 That's what I was thinking haha
matthew3454
@matthew3454
Jan 08 2016 01:39
I placed it after the form element but it won' t go through
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:40
@sludge256 i wish FCC does not post solutions on user profile pages, kind of defeats of the whole figuring out the logic part. I have hidden my solutions for the same reason. your thoughts?
Bill
@kirah1314
Jan 08 2016 01:40
@evanday17 add this to your CSS and play around with the numbers until you get it to where you want:
.row img {
  margin-left: 250px;
  margin-top: -150px;
}
Brian
@sludge256
Jan 08 2016 01:40
@ganeshkmurthy I hid mine too. I don't think most people realize that feature right away anyways.
Ganesh Krishnamurthy
@ganeshkmurthy
Jan 08 2016 01:41
@sludge256 that's true.
Matt Fay
@username1001
Jan 08 2016 01:41
Ohh wait
Ian
@IMLaing
Jan 08 2016 01:41
@matthew3454 What do the instructions say specifically to do?
Matt Fay
@username1001
Jan 08 2016 01:41
You have it in the wrong place
Brian
@sludge256
Jan 08 2016 01:41
I'm a bit stubborn and want to avoid looking for too much help.
matthew3454
@matthew3454
Jan 08 2016 01:41

In addition to classes, each HTML element can also have an id attribute.

There are several benefits to using id attributes, and you'll learn more about them once you start using jQuery.

id attributes should be unique. Browsers won't enforce this, but it is a widely agreed upon best practice. So please don't give more than one element the same id attribute.

Here's an example of how you give your h2 element the id of cat-photo-app:

<h2 id="cat-photo-app">

Give your form element the id cat-photo-form.

Matt Fay
@username1001
Jan 08 2016 01:41
You should have it above the one with type="text"
evanday17
@evanday17
Jan 08 2016 01:42
@kirah1314 you are a live safer...thanks
CamperBot
@camperbot
Jan 08 2016 01:42
evanday17 sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 777 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Ian
@IMLaing
Jan 08 2016 01:43
@matthew3454 check the spelling
Matt Fay
@username1001
Jan 08 2016 01:43
so <form id="#"><input type="text"></form>
matthew3454
@matthew3454
Jan 08 2016 01:43
okay I'll try it
Ian
@IMLaing
Jan 08 2016 01:43
@matthew3454 Do you see what I mean?
you have app not form at the end of the id, it isn't looking for app.
Bill
@kirah1314
Jan 08 2016 01:44
@evanday17 :thumbsup:
matthew3454
@matthew3454
Jan 08 2016 01:44
What is the app?
Ian
@IMLaing
Jan 08 2016 01:45
@matthew3454 your id is not the right id, the instructions say cat-photo-form, not app
matthew3454
@matthew3454
Jan 08 2016 01:45
okay sorry I'm slowww
John Irle
@JohnIrle
Jan 08 2016 01:45
Turns out most of my problems came from not using bracket notation to select properties
Matt Fay
@username1001
Jan 08 2016 01:45
Oh, he's declaring an id haha, thought he was on a different waypoint
Ian
@IMLaing
Jan 08 2016 01:46
@username1001 @matthew3454 no worries we got this reading thing down.
@doudeman did you complete record collection?
Abhishek
@AbhiChachan
Jan 08 2016 01:54
hey, i am in the exercise 90 of front end development and am stuck on something
the task is to "Give your form's text input field a class of form-control."
where do i add the form-control?
in the form element or in the every input element of the labels??
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 01:56
@AbhiChachan In the text input element?
Abhishek
@AbhiChachan
Jan 08 2016 01:59
Screen Shot 2016-01-08 at 7.28.19 am.png
did that but still the exercise is not moving ahead.
Ian
@IMLaing
Jan 08 2016 01:59
@AbhiChachan Those are checkbox and radio buttons though
Ian
@IMLaing
Jan 08 2016 02:00
@DevPoetsSociety Have you finished Record Collection?
Abhishek
@AbhiChachan
Jan 08 2016 02:01
@DevPoetsSociety @IMLaing i figured out. thanks for you help
CamperBot
@camperbot
Jan 08 2016 02:01
abhichachan sends brownie points to @devpoetssociety and @imlaing :sparkles: :thumbsup: :sparkles:
:star: 292 | @devpoetssociety | http://www.freecodecamp.com/devpoetssociety
:star: 218 | @imlaing | http://www.freecodecamp.com/imlaing
Tony Miri
@TonyMiri
Jan 08 2016 02:02
Oh wait. the parameter is being input as a string. right?
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 02:02
@IMLaing Yup
Ian
@IMLaing
Jan 08 2016 02:03
@DevPoetsSociety Is it really foolish to thing it is 3 if statements?
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 02:03
Nope
Ian
@IMLaing
Jan 08 2016 02:03
@FatTone225 you shouldn't need a string
Tony Miri
@TonyMiri
Jan 08 2016 02:03
Right
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 02:03
@IMLaing Well, one if/else with a nested if IIRC
Tony Miri
@TonyMiri
Jan 08 2016 02:03
So I have to store the value of that property in another variable?
Ian
@IMLaing
Jan 08 2016 02:04
No you should be checking to see if the property exists if it does you should return it
if it doesn't exist you should return not found
@DevPoetsSociety OK I might bug you on that one. I'm a bit stuck
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 02:05
NP
Tony Miri
@TonyMiri
Jan 08 2016 02:05
Right. The test cases are input as a string though. How can I make them not a string?
If I just do
Ian
@IMLaing
Jan 08 2016 02:06
@FatTone225 I'm not sure how to answer that. You want to change the argument to something else?
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 02:06
@IMLaing There's three things to test for, two of which are very similar. Manage that last part and it falls into place.
Ian
@IMLaing
Jan 08 2016 02:07
@DevPoetsSociety K
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 02:07
Then it's just getting your notation right
Ian
@IMLaing
Jan 08 2016 02:07
@DevPoetsSociety kk
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:08
@FatTone225 what does your code look like?
Tony Miri
@TonyMiri
Jan 08 2016 02:08
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here
  if (myObj.hasOwnProperty(checkProp)) {
  return myObj.checkProp;
} else {
  return "Not Found";
  }
}
// Test your code by modifying these values
checkObj("gift");
The problem is that first return statement
but I don't get how I'm supposed to return the value if I'm supposed to be testing parameter and the parameter is always a string
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:09
@FatTone225 ah return myObj[checkProp]; instead of dot.. I think dot only works if the name is known
Tony Miri
@TonyMiri
Jan 08 2016 02:10
@alexanderkopke ahhhhh. Gets me every time.
lol @alexanderkopke thanks
CamperBot
@camperbot
Jan 08 2016 02:10
fattone225 sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 395 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:10
:smile:
Ashley
@Ashtheyogi
Jan 08 2016 02:11

hey everyone. I need a little help! I am doing this puzzle and I dont understand how I am supposed to order it: Font size is controlled by the font-size CSS property, like this:

h1 {

font-size: 30px;

}

Create a second p element with the following kitty ipsum text: Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

Inside the same <style> tag that we created for your red-text class, set the font-size of all p elements to 16 pixels (16px).

greg
@wearenotgroot
Jan 08 2016 02:11
@FatTone225 use brackets intead of dot
Ashley
@Ashtheyogi
Jan 08 2016 02:11
when adding new classes//
?
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:12
@Ashtheyogi you select the p elements like h1 was selected in the code you posted
micahwood50
@micahwood50
Jan 08 2016 02:13
I am on Waypoint: Global Scope and Functions, so when I declare global variable, there is no point in using var?
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:14
p{
font-size: 16px;
}
this selects all p elements and sets font-size to 16px;... remember to put it inside the style tags
Ashley
@Ashtheyogi
Jan 08 2016 02:14
hey @alexanderkopke so do I ignore the color class that I originally put? Or how do I add more than one
class?
oh so I don't have to add the font size to the style bracket?
Ian
@IMLaing
Jan 08 2016 02:15
@DevPoetsSociety Ok I can .push() tracks on correctly but I can't seem to figure out how to have property be replaced by the value
Brian
@sludge256
Jan 08 2016 02:15
<p class="class1 class2">Hello</p>
Julian Herrmann
@jrherrm
Jan 08 2016 02:15

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

do you use an if statement for this?
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 02:16
@IMLaing That's more like assigning a value to a variable.
Ian
@IMLaing
Jan 08 2016 02:17
@DevPoetsSociety Ok actually I can do both.. I just need to figure the nesting out I think.
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:17
@Ashtheyogi what is the name of the challenge called?
Cooper Higgins
@CooperHiggins
Jan 08 2016 02:18
Having trouble converting fahrenheit to celsius
Ashley
@Ashtheyogi
Jan 08 2016 02:18
@alexanderkopke its one of the first few front end dev challenges; I'm learning about html font size changes and whatnot
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 02:18
@IMLaing Good luck. I've got to switch locations.
Ian
@IMLaing
Jan 08 2016 02:19
@DevPoetsSociety Ok I will try!
Ashley
@Ashtheyogi
Jan 08 2016 02:19
@alexanderkopke I'm just a little confused because I put the class for the text color, now it's asking me to change the font-size
mimi schirm
@mimischirm
Jan 08 2016 02:19
@micahwood50 did you pass global scope?
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:20
@Ashtheyogi ah ok. Yes that is normal. You can style as many elements as you like in different ways.
Cooper Higgins
@CooperHiggins
Jan 08 2016 02:20
how do i create a variable for celsius (9/5) + 32 and assign that to it
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:21
@Ashtheyogi maybe you want one p element to be red but all other p elements to be normal..
Ashley
@Ashtheyogi
Jan 08 2016 02:21
I still dont understand what to do though.
yeah the p element is for the <p> paragraph right?
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:21
<style>
  .red-text {
    color: red;
  }
  p{
    font-size: 16px;
  }
</style>
Cooper Higgins
@CooperHiggins
Jan 08 2016 02:21
Checkpoint: Convert Celsius to Fahrenheit
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:21
this is how your style should look like
yes p is for paragraph
Joe P
@JP50515
Jan 08 2016 02:22
@alexanderkopke how do you share the workspace like that?
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:22
the p in style "reacts" to the <p> elements below
help wiki
CamperBot
@camperbot
Jan 08 2016 02:22

:point_right: bonfire wiki template [wiki]

Foundational Agile Principles:

Individuals and interactions over processes and tools

Working software over comprehensive

Customer collaboration over contract negotiation

Responding to change over following a plan

:pencil: read more about bonfire wiki template on the FCC Wiki

Alexander Køpke
@alexanderkopke
Jan 08 2016 02:23
you make three backticks and press shift+enter.. then enter code and press ctrl+enter
these are backticks ```
Joe P
@JP50515
Jan 08 2016 02:23
cool thank @alexanderkopke
CamperBot
@camperbot
Jan 08 2016 02:23
jp50515 sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 396 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Ashley
@Ashtheyogi
Jan 08 2016 02:23
oh
Cooper Higgins
@CooperHiggins
Jan 08 2016 02:23

```function convert(celsius) {
// Only change code below this line
var fahrenheit = ((9/5) + 32);

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

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

Ashley
@Ashtheyogi
Jan 08 2016 02:24
@alexanderkopke so we put the p in front of the wavy brackets to represent the <p> okay I understand now. Thank you
CamperBot
@camperbot
Jan 08 2016 02:24
ashtheyogi sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 397 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Pawan
@pawan92
Jan 08 2016 02:24
@CooperHiggins multiply by celsius
Joe P
@JP50515
Jan 08 2016 02:24
myFunction should be a function myFunction should output "Hi World" to the dev console
*Call myFunction after you define it
// Example
function ourFunction() {
  console.log("Heyya, World");
}

ourFunction();

// Only change code below this line

function myFunction() {
    console.log("Hi World");
}

myFunction ();
tjstinso
@tjstinso
Jan 08 2016 02:24
i am working on the URL shortener api project. Should i be implementing a hash function here? converting urls to base 64?
Joe P
@JP50515
Jan 08 2016 02:24
whoops fail
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:25
@JP50515 myFunction(); <-- no space between myFunction and ()
Julian Herrmann
@jrherrm
Jan 08 2016 02:25
@CooperHiggins you have to multiply by celsius
Cooper Higgins
@CooperHiggins
Jan 08 2016 02:25

function convert(celsius) {
// Only change code below this line
var fahrenheit = celsius(9/5) + 32);

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

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

Joe P
@JP50515
Jan 08 2016 02:25
bingo. thanks again @alexanderkopke You got my question before I even asked it
CamperBot
@camperbot
Jan 08 2016 02:25
jp50515 sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:warning: jp50515 already gave alexanderkopke points
Julian Herrmann
@jrherrm
Jan 08 2016 02:26
use * @CooperHiggins
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:26
@CooperHiggins celsius *(9/5) + 32
NormalWare
@Centuriom
Jan 08 2016 02:26
Hello everyone i need some help
var Bike = function(setGear) {

  var gear = 0;

  this.SetGear = function(changeGear) {
    gear += changeGear;
  };

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

  // Only change code below this line.

};
Cooper Higgins
@CooperHiggins
Jan 08 2016 02:26
@alexanderkopke Thanks
CamperBot
@camperbot
Jan 08 2016 02:26
cooperhiggins sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 398 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:27
np :)
Ashley
@Ashtheyogi
Jan 08 2016 02:27
okay @camperbot. How do you send brownie points?
NormalWare
@Centuriom
Jan 08 2016 02:27
Mmm the method setGear of myBike should be accessible outside the object.
Matt Leonard
@matty22
Jan 08 2016 02:27
@Ashtheyogi just say @name and
thanks
NormalWare
@Centuriom
Jan 08 2016 02:27
But i tried it and it didn't work
Matt Leonard
@matty22
Jan 08 2016 02:27
together
Ashley
@Ashtheyogi
Jan 08 2016 02:27
@alexanderkopke I'd like toys end you brownie points
omg to send you
jeez
@alexanderkopke thanks
CamperBot
@camperbot
Jan 08 2016 02:28
ashtheyogi sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:warning: ashtheyogi already gave alexanderkopke points
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:28
@Ashtheyogi thanks :)
CamperBot
@camperbot
Jan 08 2016 02:28
alexanderkopke sends brownie points to @ashtheyogi :sparkles: :thumbsup: :sparkles:
:star: 19 | @ashtheyogi | http://www.freecodecamp.com/ashtheyogi
Jess Cheda
@jesscheda
Jan 08 2016 02:30
heyo - I'm getting stuck with adding a background color to a div element
Ian
@IMLaing
Jan 08 2016 02:31
@jesscheda What is the code you have so far?
Jess Cheda
@jesscheda
Jan 08 2016 02:32

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

.gray-background {
background-color: gray;
}

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

div {
.gray-background;
}

Alexander Køpke
@alexanderkopke
Jan 08 2016 02:32
@Centuriom what is the waypoint called?
Jess Cheda
@jesscheda
Jan 08 2016 02:32
@IMLaing sorry I don't know how to do a snippet yet in chat..
NormalWare
@Centuriom
Jan 08 2016 02:32
@alexanderkopke It's called Waypoint: Make Object Properties Private
Ian
@IMLaing
Jan 08 2016 02:32
@jesscheda You cannot use your CSS class as a attribute there
You need to actually write it out again like you have in .gray-background
Or you can add the class to your div
and I think I can get you the wiki format bot?
wiki format
CamperBot
@camperbot
Jan 08 2016 02:33

: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

Jess Cheda
@jesscheda
Jan 08 2016 02:34
@IMLaing for the 2nd option, do you mean put the class into the HTML below the style element?
Ian
@IMLaing
Jan 08 2016 02:34
@jesscheda you would want to put the class in the HTML element
That you want to have the grey background
Nicole F.
@gitasong
Jan 08 2016 02:35
Hey, I think I'm missing something with the new JS Checkpoint: Counting Cards. We're only running one card at a time, correct?
Jnfr
@jnfr
Jan 08 2016 02:35
hey everyone, I am stumped on the "Stand in Line" checkpoint about queues. Here is the code I am using...
Ian
@IMLaing
Jan 08 2016 02:35
@gitasong I think it runs a couple what is the problem you are encountering
NormalWare
@Centuriom
Jan 08 2016 02:35
@gitasong That's correct
Jnfr
@jnfr
Jan 08 2016 02:35

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

function queue(arr, item) {
// Your code here
arr.push(item);
arr.splice(0,1);
}'

marcgetter
@marcgetter
Jan 08 2016 02:36
@jnfr what's the goal again?
Ian
@IMLaing
Jan 08 2016 02:36
I think you need to shift the array around or something on that one
Like reverse them?
marcgetter
@marcgetter
Jan 08 2016 02:36
@jnfr looks like you need to add a return too.
Jess Cheda
@jesscheda
Jan 08 2016 02:37
@IMLaing so like this?
```html
<div .gray-background>
Nicole F.
@gitasong
Jan 08 2016 02:37
@IMLaing My code runs a single card at a time via a switch statement. All the test cases check out except for the first one, but each of the test cases runs a sequence of cards. I don't get how that works. Is there an invisible array in there that I'm not seeing?
Jnfr
@jnfr
Jan 08 2016 02:37
@marcgetter its to add the item on the end, then remove the first element, and return the first element which was removed
Ian
@IMLaing
Jan 08 2016 02:37
@jesscheda not exactly you want to actually include the class in the <div> you are really close
Jess Cheda
@jesscheda
Jan 08 2016 02:38
my brain hurts! :)
Nicole F.
@gitasong
Jan 08 2016 02:38
@IMLaing Look at the instructions and the sample code given. It's running single cards, as far as I can tell. So I don't get how it can run single cards, but then ask for sequences?
Jnfr
@jnfr
Jan 08 2016 02:38
@marcgetter yeah the return part was confusing me. the problem says the function should return the element that was removed, so I can't have it return either the new array or the item.
marcgetter
@marcgetter
Jan 08 2016 02:38
@jnfr the function you need to use to remove the first item is in the notes.
Ian
@IMLaing
Jan 08 2016 02:38
@gitasong Let me take a quick look at that and could you paste your code
Nicole F.
@gitasong
Jan 08 2016 02:38
Okay.
Ian
@IMLaing
Jan 08 2016 02:38
please
thanks
Jason
@gitPhunky
Jan 08 2016 02:38
if your brain hurts that means its growing.
Nicole F.
@gitasong
Jan 08 2016 02:38
var count = 0;

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

  if (count > 0) {
        return count + " Bet";
      }
  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');


//Cards Sequence 2, 3, 4, 5, 6 should return "5 Bet"
//Cards Sequence 7, 8, 9 should return "0 Hold"
//Cards Sequence 10, J, Q, K, A should return "-5 Hold"
//Cards Sequence 3, 2, A, 10, K should return "-1 Hold"
Jason
@gitPhunky
Jan 08 2016 02:39
ahhh jumpscare
Daniel Herring Jr.
@HorrorNerd
Jan 08 2016 02:39

I'm stuck on the javascript escape sequences in strings. heres my code

var myStr= '"\""\t\""\t""\r""\n"'; // Change this line

marcgetter
@marcgetter
Jan 08 2016 02:39
@jnfr so, add the item to the end, then return the removed first item.
Jess Cheda
@jesscheda
Jan 08 2016 02:39
@gitPhunky totally
Ian
@IMLaing
Jan 08 2016 02:40
@jesscheda Did that work for you?
Jnfr
@jnfr
Jan 08 2016 02:40
yeah, exactly. I'm using splice which should do that, but it isn't working for everything
Jess Cheda
@jesscheda
Jan 08 2016 02:40
@IMLaing it seems weird to put the class into the <div> - I thought the whole point was to keep classes in the <style> elements?
Lyman Wong
@lymanwong
Jan 08 2016 02:40
@HorrorNerd I used a single set of quotes for the entire line. Delete the quotes in between and leave a space between each item.
Ian
@IMLaing
Jan 08 2016 02:40
@gitasong I think you need something for you 7 8 9 cards
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:40
@Centuriom sorry it took so long.. I had to wrap my head around it.
Ian
@IMLaing
Jan 08 2016 02:41
So your CSS or style section is there to be applied via classes to the HTML
so
NormalWare
@Centuriom
Jan 08 2016 02:41
@alexanderkopke Cool man =)
marcgetter
@marcgetter
Jan 08 2016 02:41
@jnfr splice returns the array minus the item removed.
Nicole F.
@gitasong
Jan 08 2016 02:41
@IMLaing 7, 8, and 9 don't add or subtract anything to the count, so I didn't do anything.
Ian
@IMLaing
Jan 08 2016 02:41
well you are doing something
@gitasong You are adding nothing
marcgetter
@marcgetter
Jan 08 2016 02:41
@jnfr what else is listed for functions to use?
Jason
@gitPhunky
Jan 08 2016 02:42
@jesscheda you declare your classes in the style section, you call them in the body of your html
Daniel Herring Jr.
@HorrorNerd
Jan 08 2016 02:42
@lymanwong thank you so much been trying to figure out my problem
CamperBot
@camperbot
Jan 08 2016 02:42
horrornerd sends brownie points to @lymanwong :sparkles: :thumbsup: :sparkles:
:star: 182 | @lymanwong | http://www.freecodecamp.com/lymanwong
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:42
this.setGear = function(changeGear) {
    gear= changeGear;
  };
setGear <- notice small s. and gear should simply be set to changeGear. It should work with these changes I think
Ian
@IMLaing
Jan 08 2016 02:42
@jesscheda if you have a .gray-background in the css you are making any HTML element with the class="gray-background" have the attributes you assigned
Nicole F.
@gitasong
Jan 08 2016 02:42
@IMLaing That seems trivial. At any rate, the test case that's failing doesn't involve those numbers. The one involving those numbers passed.
Jnfr
@jnfr
Jan 08 2016 02:42
@marc queue([], 1) should return 1
queue([2], 1) should return 2
NormalWare
@Centuriom
Jan 08 2016 02:43
@alexanderkopke Thanks dude !!
Jnfr
@jnfr
Jan 08 2016 02:43
After queue(myArr, 10), myArr[4] should be 10 is working for me
Ian
@IMLaing
Jan 08 2016 02:43
@gitasong which is failing?
NormalWare
@Centuriom
Jan 08 2016 02:43
It really solve my problem, whiout your help i'd never see it
Lyman Wong
@lymanwong
Jan 08 2016 02:43
@jnfr I'm stuck there too
CamperBot
@camperbot
Jan 08 2016 02:43
centuriom sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 399 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
marcgetter
@marcgetter
Jan 08 2016 02:44
@jnfr pop and push remove and add items to the end of an array. Shift and unshift remove and add from the beginning.
Alexander Køpke
@alexanderkopke
Jan 08 2016 02:44
@Centuriom good job! :)
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 02:44
@IMLaing Any luck?
Nicole F.
@gitasong
Jan 08 2016 02:44
@IMLaing The first test case, Cards Sequence 2, 3, 4, 5, 6 should return "5 Bet"
Jnfr
@jnfr
Jan 08 2016 02:45
@marc @lymanwong I guess the part that I am stumped on is how do I return something that has already been removed? I have read that splice is supposed to do so, but it apparently doesn't?
Jason
@gitPhunky
Jan 08 2016 02:45
@jesscheda some reading material if still confoozled http://www.w3schools.com/tags/att_global_class.asp
marcgetter
@marcgetter
Jan 08 2016 02:45
@jnfr don't use splice
Lyman Wong
@lymanwong
Jan 08 2016 02:45
@marcgetter I get a RangeError with arr.push(item); return arr.shift();
Ian
@IMLaing
Jan 08 2016 02:45
@gitasong I think I see the issue, what is the program returning when you run it?
Nicole F.
@gitasong
Jan 08 2016 02:46
@IMLaing That's the part I'm pretty sure I've coded correctly. :)
@IMLaing When I run it on the case that's failing?
Jnfr
@jnfr
Jan 08 2016 02:46
@marcgetter @lymanwong maybe if I use shift() and create a second array?
marcgetter
@marcgetter
Jan 08 2016 02:46
@lymanwong hmm. That should work.
Brian
@sludge256
Jan 08 2016 02:47
@lymanwong does it persist on page refresh or browser restart?
Jess Cheda
@jesscheda
Jan 08 2016 02:47
@IMLaing and @gitPhunky thank you! I got it :D
Brian
@sludge256
Jan 08 2016 02:47
@jnfr the problem with splice is that it returns an array
when the code test expects a single value
Jess Cheda
@jesscheda
Jan 08 2016 02:47
@gitPhunky thanks for the link, I'll definitely check that out
Brian
@sludge256
Jan 08 2016 02:48
shift will work
DevPoetsSociety
@DevPoetsSociety
Jan 08 2016 02:48
@jnfr You shift onto something, then return that.
CamperBot
@camperbot
Jan 08 2016 02:48
:star: 219 | @imlaing | http://www.freecodecamp.com/imlaing
jesscheda sends brownie points to @gitphunky :sparkles: :thumbsup: :sparkles:
marcgetter
@marcgetter
Jan 08 2016 02:48
@jnfr no need for a new array. @lymanwong had it right.
CamperBot
@camperbot
Jan 08 2016 02:48
jesscheda sends brownie points to @imlaing and @gitphunky :sparkles: :thumbsup: :sparkles:
:star: 206 | @gitphunky | http://www.freecodecamp.com/gitphunky
:warning: jesscheda already gave gitphunky points
Lyman Wong
@lymanwong
Jan 08 2016 02:48
@sludge256 Thanks! The refresh worked. That's the first time I had to refresh the page.
CamperBot
@camperbot
Jan 08 2016 02:48
lymanwong sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 613 | @sludge256 | http://www.freecodecamp.com/sludge256
Ian
@IMLaing
Jan 08 2016 02:48
@gitasong yes please
Jnfr
@jnfr
Jan 08 2016 02:48
OMG I got it. Shift worked! Thanks @sludge256, @marcgetter, @lymanwong
CamperBot
@camperbot
Jan 08 2016 02:49
jnfr sends brownie points to @sludge256 and @marcgetter and @lymanwong :sparkles: :thumbsup: :sparkles:
:star: 259 | @marcgetter | http://www.freecodecamp.com/marcgetter
:star: 614 | @sludge256 | http://www.freecodecamp.com/sludge256
:star: 184 | @lymanwong | http://www.freecodecamp.com/lymanwong
marcgetter
@marcgetter
Jan 08 2016 02:49
@jnfr great!
How do you give brownie points?
Brian
@sludge256
Jan 08 2016 02:49
@lymanwong you might encounter a max call stack error too that can be resolved the same way
Nicole F.
@gitasong
Jan 08 2016 02:50
@IMLaing Well, that's the problem. I can't figure out how to test a sequence, because the code tests one card at a time. Do I just run cc(2); cc(3); cc(4); cc(5); cc(6); like in the example given?
@marcgetter You say "Thanks" or "Thank you" + the person's alias. :)
CamperBot
@camperbot
Jan 08 2016 02:51
gitasong sends brownie points to @marcgetter :sparkles: :thumbsup: :sparkles:
:star: 260 | @marcgetter | http://www.freecodecamp.com/marcgetter
Jnfr
@jnfr
Jan 08 2016 02:51
@marcgetter just by typing thanks and username
Nicole F.
@gitasong
Jan 08 2016 02:51
Like that. ;)
CamperBot
@camperbot
Jan 08 2016 02:51
:warning: jnfr already gave marcgetter points
jnfr sends brownie points to @marcgetter :sparkles: :thumbsup: :sparkles:
aaronK
@aaronk73
Jan 08 2016 02:51
need help with give a background color to a div element
marcgetter
@marcgetter
Jan 08 2016 02:51
@gitasong Thanks!
CamperBot
@camperbot
Jan 08 2016 02:51
marcgetter sends brownie points to @gitasong :sparkles: :thumbsup: :sparkles:
:star: 294 | @gitasong | http://www.freecodecamp.com/gitasong
Nicole F.
@gitasong
Jan 08 2016 02:51
:)
Ian
@IMLaing
Jan 08 2016 02:51
@gitasong The cc is a function
so it runs each time
splucena
@splucena
Jan 08 2016 02:52
help rooms
CamperBot
@camperbot
Jan 08 2016 02:52

:point_right: help rooms [wiki]

There are official help rooms for each major section of FCC content:

Chat Room Description
Help get help with our Waypoint challenges from your fellow campers
HelpBonfires get help with our Bonfire challenges from your fellow campers
HelpZiplines get help with our Zipline challenges from your fellow campers
HelpBasejumps get help with our Basejump challenges from your fellow campers
NonprofitProjects get help with your Nonprofit Projects from your fellow campers
CodeReview get constructive criticism and advice on finished code from your fellow campers
YouCanDoThis learning to code is hard - share your feelings and get moral support here

Choose the right room for your question!
:pencil: read more about help rooms on the FCC Wiki

Nicole F.
@gitasong
Jan 08 2016 02:52
Right, @IMLaing , but I thought each run was independent.
Ian
@IMLaing
Jan 08 2016 02:52
correct
But I think you problem is actually in your if statments below
Nicole F.
@gitasong
Jan 08 2016 02:53
So, then, how do I run a "sequence"? @IMLaing
Okay. So what is it, @IMLaing ?
aaronK
@aaronk73
Jan 08 2016 02:53
<div> .gray-backgound {background-color: gray;} >
<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>
Ian
@IMLaing
Jan 08 2016 02:53
cc(2); cc(3) cc(4); would run your function cc with the argument 2 3 and 4
@gitasong .
aaronK
@aaronk73
Jan 08 2016 02:54
then put statement in style
Kaan Erermis, PPE (Professional Pizza Eater)
@KaanMasters
Jan 08 2016 02:54
So I'm working on the Gold Code Checkpoint and my golfScore for (4,1) yeilds "Hole-in-One!" but the website says it doesnt...
function golfScore(par, strokes) {
  // Only change code below this line
  var golfScore = par - strokes; 

  if (strokes == 1){
    return "Hole-in-One!";
  }
  else if (golfScore == 2 || golfScore == 3){
    return "Eagle";
  }
  else if (golfScore == 1){
    return "Birdie";
  }
  else if (golfScore === 0){
    return 'Par';
  }
  else if (golfScore == -1){
    return 'Bogey';
  }
  else if (golfScore == -2){
    return 'Double Bogey';
  }
  else {
      return "Go Home!";
    }
  }

 // return golfScore;
  // Only change code above this line


// Change these values to test
golfScore(4, 1);
aaronK
@aaronk73
Jan 08 2016 02:54
.gray-backgound {background-color: gray;}
</style>
CompGeekGirl
@LisaRamos
Jan 08 2016 02:54

I'm confused with Waypoint: Passing Values to Functions with Arguments. http://www.freecodecamp.com/challenges/waypoint-passing-values-to-functions-with-arguments#?solution=%2F%2F%20Example%0Afunction%20ourFunction(a%2C%20b)%20%7B%0A%20%20console.log(a%20-%20b)%3B%0A%7D%0AourFunction(10%2C%205)%3B%20%2F%2F%20Outputs%205%0A%0A%2F%2F%20Only%20change%20code%20below%20this%20line.%0Afunction%20myFunction()%20%7B%0A%20%20console.log(1%20%2B%202)%3B%0A%7D%0Areturn%207%20%2B%209%3B%0A

I'm trying to follow what is written and it won't go through. This is what I have for my code.

// Example
function ourFunction(a, b) {
console.log(a - b);
}
ourFunction(10, 5); // Outputs 5

// Only change code below this line.
function myFunction() {
console.log(1 + 2);
}
return 7 + 9;

How can I fix this?

Nicole F.
@gitasong
Jan 08 2016 02:54
Okay @IMLaing , so then I do simply run 5 independent tests in sequence, per the example given.
aaronK
@aaronk73
Jan 08 2016 02:55
<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-backgound {background-color: gray;}
</style>

<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-backgound {background-color: gray;} >
  <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>
Ian
@IMLaing
Jan 08 2016 02:55
Whoa nelly
aaronK
@aaronk73
Jan 08 2016 02:55
adding gray background
Ian
@IMLaing
Jan 08 2016 02:56
There are css classes and attributes next to the <div> that do not belong
Ashley
@Ashtheyogi
Jan 08 2016 02:56
hey there everyone. I'm trying to put an image in my text editor. it's saying that my image should have a src attribute that points to the kitten image. I went to the link and got the image address ? What am I doing wrong?
Nicole F.
@gitasong
Jan 08 2016 02:57
@Ashtheyogi Have you put the address in quotes?
Ian
@IMLaing
Jan 08 2016 02:57
@gitasong, you can change the test how ever you want to
Nicole F.
@gitasong
Jan 08 2016 02:57
(Most common mistake.)
Ashley
@Ashtheyogi
Jan 08 2016 02:57
@gitasong yes here I will show you what I wrote
Nicole F.
@gitasong
Jan 08 2016 02:57
What I mean is, @IMLaing , if I run a bunch of independent tests one after the other, will it register them as a "sequence"?
Ashley
@Ashtheyogi
Jan 08 2016 02:58
@gitasong <img src="https://s3.amazonaws.com/freecodecamp/relaxing-cat.jpg">
Holly Williford
@hollyhascode
Jan 08 2016 02:58
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here
  checkObj = myObj.hasOwnProperty("checkProp");

// Test your code by modifying these values
checkObj("gift");
I'm stuck on testing object for properties
Ian
@IMLaing
Jan 08 2016 02:58
@gitasong yes, but the website will automatically try all the required objectives for you, the option to run the test at the bottom is just for your benefit
Ashley
@Ashtheyogi
Jan 08 2016 02:58
and the image is showing up on the worksheet but it won't let me pass
Nicole F.
@gitasong
Jan 08 2016 02:59
Assuming that's the correct URL for the image, @Ashtheyogi , that should work—although you might want to self-close the <img> tag.
Ian
@IMLaing
Jan 08 2016 02:59
@gitasong if you haven't change the code from the first time you posted the if statement is incorrect
Nicole F.
@gitasong
Jan 08 2016 02:59
Okay; how is it incorrect, @IMLaing ?
Ashley
@Ashtheyogi
Jan 08 2016 03:00
@gitasong like </img> ?
Ian
@IMLaing
Jan 08 2016 03:00
You have a return statement that isn't applied to anything
@gitasong
Nicole F.
@gitasong
Jan 08 2016 03:00
Isn't that essentially the default case if the "if" statement isn't executed?
@IMLaing ^^
Herman Fassett
@HermanFassett
Jan 08 2016 03:01
@Ashtheyogi img doesn't need a closing tag like that...
Ian
@IMLaing
Jan 08 2016 03:01
@gitasong I wouldn't know enough to tell you yes or no to that, but as I understand it that would just run return everytime
after you run the if statment it keeps running
and then runs the return statement
Nicole F.
@gitasong
Jan 08 2016 03:02
I've walked through this logic with at least two more senior people than me, including @SaintPeter , who said he wanted to "break people's slavish adherence to adding elseto every if statement" or something like that.
Ashley
@Ashtheyogi
Jan 08 2016 03:02
it's saying "Your image should have a src attribute that points to the kitten image." what does that mean?
Nicole F.
@gitasong
Jan 08 2016 03:02
Let me see.
Ashley
@Ashtheyogi
Jan 08 2016 03:02
My image is showing up
@HermanFassett
Holly Williford
@hollyhascode
Jan 08 2016 03:02
did you mix up links?
there are multiple images of cats in those lessons
Arthur Moisés
@arthurmoises
Jan 08 2016 03:03
almost three days trying to make "seek and destroy" works... can you help me?
Nicole F.
@gitasong
Jan 08 2016 03:03
All right, @IMLaing ; let me try it with else. <sigh>
Ian
@IMLaing
Jan 08 2016 03:04
@gitasong Not sure what to tell you
@jesscheda Did that background color ever work out?
Arthur Moisés
@arthurmoises
Jan 08 2016 03:04
function destroyer(arr) {
  // Remove all the values
  var compareArray = [];
  for (var i = 1; i < arguments.length; i++) {
    compareArray.push(arguments[i]);
  }
  function compare(element) {
    i = 0;
    while(element !== compareArray[i]) {
      i++;
      return element !== compareArray[i];
    }

  }
  return arguments[0].filter(compare); 
}



destroyer([1, 2, 3, 1, 2, 3], 2, 3);
//destroyer([3, 5, 1, 2, 2], 2, 3, 5);
4 from 5 tests pass, but not 3r
aaronK
@aaronk73
Jan 08 2016 03: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;
  }

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

<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>
  <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> class= gray-background 
<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>
</div>
Arthur Moisés
@arthurmoises
Jan 08 2016 03:05
3rd*
Ian
@IMLaing
Jan 08 2016 03:05
@aaronk73 Almost! that class is missing some "" and it needs to be inside a HTML element
@gitasong Whats good we counting cards or what?
CompGeekGirl
@LisaRamos
Jan 08 2016 03:05

I'm having an issue with http://www.freecodecamp.com/challenges/waypoint-global-scope-and-functions#?solution=%2F%2F%20Declare%20your%20variable%20here%0A%0Afunction%20fun1()%20%7B%0A%20%20%2F%2F%20Assign%205%20to%20oopsGlobal%20Here%0A%20%20var%20myGlobal%20%3D%2010%3B%0A%20%20oopsGlobal%20%3D%205%3B%0A%7D%0A%0A%2F%2F%20Only%20change%20code%20above%20this%20line%0Afunction%20fun2()%20%7B%0A%20%20var%20output%20%3D%20%22%22%3B%0A%20%20if(typeof%20myGlobal%20!%3D%20%22undefined%22)%20%7B%0A%20%20%20%20output%20%2B%3D%20%22myGlobal%3A%20%22%20%2B%20myGlobal%3B%0A%20%20%7D%0A%20%20if(typeof%20oopsGlobal%20!%3D%20%22undefined%22)%20%7B%0A%20%20%20%20output%20%2B%3D%20%22%20oopsGlobal%3A%20%22%20%2B%20oopsGlobal%3B%0A%20%20%7D%0A%20%20console.log(output)%3B%0A%7D%0A

It says that myGlobal should be declared using the var keyword. I did that and it didn't go through. Do you see anything wrong with this code here?

// Declare your variable here

function fun1() {
// Assign 5 to oopsGlobal Here
var myGlobal = 10;
oopsGlobal = 5;
}

// 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);
}

How can I solve this?

Ashley
@Ashtheyogi
Jan 08 2016 03:06
thanks @gitasong
CamperBot
@camperbot
Jan 08 2016 03:06
ashtheyogi sends brownie points to @gitasong :sparkles: :thumbsup: :sparkles:
:star: 295 | @gitasong | http://www.freecodecamp.com/gitasong
Ashley
@Ashtheyogi
Jan 08 2016 03:06
thanks @hollyhascode
CamperBot
@camperbot
Jan 08 2016 03:06
ashtheyogi sends brownie points to @hollyhascode :sparkles: :thumbsup: :sparkles:
:star: 237 | @hollyhascode | http://www.freecodecamp.com/hollyhascode
Ashley
@Ashtheyogi
Jan 08 2016 03:06
thanks @HermanFassett
CamperBot
@camperbot
Jan 08 2016 03:06
ashtheyogi sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 1314 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Nicole F.
@gitasong
Jan 08 2016 03:07
@IMLaing Nope; still failes.
*fails
aaronK
@aaronk73
Jan 08 2016 03:07
@IMLaing on the <div> line?
Ian
@IMLaing
Jan 08 2016 03:07
Inside it, @aaronk73
yes
@gitasong Do you want to see what I have or post it again?
Nicole F.
@gitasong
Jan 08 2016 03:08
Either way.
Ian
@IMLaing
Jan 08 2016 03:08
'''
CamperBot
@camperbot
Jan 08 2016 03:08
:bulb: to format code use backticks! ``` more info
Ian
@IMLaing
Jan 08 2016 03:08
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 7:
       case 8:
       case 9:
       break;

       case 10:
       case "J":
       case "Q":
       case "K":
       case "A":
       count--;

 }
  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');
aaronK
@aaronk73
Jan 08 2016 03:09
<div> class= "gray-background"
Nicole F.
@gitasong
Jan 08 2016 03:10
Thing is, @IMLaing , count <= 0 is basically implicit. That's the only other thing(s) it could be. Hence, one doesn't need an else if case, per @SaintPeter .
Ian
@IMLaing
Jan 08 2016 03:10
@gitasong then just do else
Nicole F.
@gitasong
Jan 08 2016 03:11
I did. It failed.
Ian
@IMLaing
Jan 08 2016 03:11
Well the pasted code works.
Nicole F.
@gitasong
Jan 08 2016 03:11
<sigh> I'll try this.
Then I'll submit a bug report. :p
Ian
@IMLaing
Jan 08 2016 03:11
@gitasong Hey bro, were trying to help out and giving you the best we can
Nicole F.
@gitasong
Jan 08 2016 03:12
@IMLaing I'm not frustrated with you; it's the inconsistency of FCC's teaching that's bugging me.
(And don't assume everyone here is a "bro." :) )
Ian
@IMLaing
Jan 08 2016 03:13
Everyone is my bro
My turn though anyone know some JSON? I am still stuck on Record Collection
Nicole F.
@gitasong
Jan 08 2016 03:13
LOL. I'd be your sis, then; thanks.
aaronK
@aaronk73
Jan 08 2016 03:14

@IMLaing

<div> class="gray-background"

Nicole F.
@gitasong
Jan 08 2016 03:14
Anyhoo, the updated code still fails, @IMLaing . I'm gonna try refreshing and dumping my cache.
Ian
@IMLaing
Jan 08 2016 03:14
@aaronk73 almost
You want it to go inside the element
Think of the < > as holding in all the stuck that will be specific to that element
all the stuff*
Manish Giri
@Manish-Giri
Jan 08 2016 03:15
@gitasong what’s your code
aaronK
@aaronk73
Jan 08 2016 03:15
<div> class="gray-background" 
<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>
</div>
Ian
@IMLaing
Jan 08 2016 03:16
<div class="gray-background">
inside
aaronK
@aaronk73
Jan 08 2016 03:16
oh ok
Ian
@IMLaing
Jan 08 2016 03:16
That is how you can add id's and classes to any element
Alexander Køpke
@alexanderkopke
Jan 08 2016 03:17
one way to do it anyways ;)
aaronK
@aaronk73
Jan 08 2016 03:17
@IMLaing your my hero
so silly of me
Ian
@IMLaing
Jan 08 2016 03:17
@aaronk73 aww shucks thanks @aaronk73
CamperBot
@camperbot
Jan 08 2016 03:17
imlaing sends brownie points to @aaronk73 and @aaronk73 :sparkles: :thumbsup: :sparkles:
:star: 48 | @aaronk73 | http://www.freecodecamp.com/aaronk73
:star: 48 | @aaronk73 | http://www.freecodecamp.com/aaronk73
aaronK
@aaronk73
Jan 08 2016 03:18
@IMLaing thank you
CamperBot
@camperbot
Jan 08 2016 03:18
aaronk73 sends brownie points to @imlaing :sparkles: :thumbsup: :sparkles:
:star: 220 | @imlaing | http://www.freecodecamp.com/imlaing
Ian
@IMLaing
Jan 08 2016 03:18
Anyone know how to do JSON, Record Collection I cannot figure out how to add an additonal track
aaronK
@aaronk73
Jan 08 2016 03:18
still making those errors
Ian
@IMLaing
Jan 08 2016 03:19
we all make errors all day everyday, i've only been here for 8 days too so you will learn a ton really fast just sticking around
Nicole F.
@gitasong
Jan 08 2016 03:19
@Manish-Giri
var count = 0;

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

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


//Cards Sequence 2, 3, 4, 5, 6 should return "5 Bet"
//Cards Sequence 7, 8, 9 should return "0 Hold"
//Cards Sequence 10, J, Q, K, A should return "-5 Hold"
//Cards Sequence 3, 2, A, 10, K should return "-1 Hold"
aaronK
@aaronk73
Jan 08 2016 03:19
@IMLaing do you feel that you can do this from scratch if someone asked you to make a page like this?
Alexander Køpke
@alexanderkopke
Jan 08 2016 03:20
@IMLaing what code you've got so far if any?
Ian
@IMLaing
Jan 08 2016 03:20
@aaronk73 Yes I actually have one up
@alexanderkopke ```
// 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 (prop === "tracks" && value !== ""){
  collection[id].tracks.push(value);
  } 

   if (value !== ""){
    collection[id][prop] = value;
}
    if (value === ""){
    delete collection[id][prop];
  }

  return collection;
}

// Alter values below to test your code
update(1245, "tracks", "Addicted to Love");
Nicole F.
@gitasong
Jan 08 2016 03:21
@Manish-Giri Originally the else if statement was a simple return count + " Hold", per a conversation with @SaintPeter about "slavish adherence to if-else," but the person who was helping me didn't like that, so I changed it.
Still didn't pass.
Alexander Køpke
@alexanderkopke
Jan 08 2016 03:21
ah the second if should be first
Ian
@IMLaing
Jan 08 2016 03:22
@alexanderkopke Yeah I tried that too but then it gives me
collection[id].tracks.push is not a function
Ashley
@atan77
Jan 08 2016 03:22
@IMLaing those two ifs will conflict, you need to find a way to achieve both outcomes without using both
Nicole F.
@gitasong
Jan 08 2016 03:23
@Manish-Giri I think this might be a case of needing to refresh FCC? But I don't know how to do that.
Ian
@IMLaing
Jan 08 2016 03:23
@atan77 Word.
Manish Giri
@Manish-Giri
Jan 08 2016 03:23
@gitasong what waypoint was it again
Nicole F.
@gitasong
Jan 08 2016 03:23
Ummm.. Let me get the name.
Ian
@IMLaing
Jan 08 2016 03:23
@atan77 !!!!!!!!!!!!!! THANK YOU THANK YOU!
CamperBot
@camperbot
Jan 08 2016 03:23
imlaing sends brownie points to @atan77 :sparkles: :thumbsup: :sparkles:
:star: 405 | @atan77 | http://www.freecodecamp.com/atan77
Nicole F.
@gitasong
Jan 08 2016 03:24
@Manish-Giri Checkpoint: Counting Cards
Ian
@IMLaing
Jan 08 2016 03:24
@atan77 I can't believe how derp that was!
Alexander Køpke
@alexanderkopke
Jan 08 2016 03:24
@IMLaing ok but then you could make it an else if so that one doesn't cancel out the other
  if (prop === "tracks" && value !== ""){
  collection[id].tracks.push(value);
  } 

   else if (value !== ""){
    collection[id][prop] = value;
Ashley
@atan77
Jan 08 2016 03:25
@IMLaing it's ok, I think it'd rate as one of the highest help requests
Manish Giri
@Manish-Giri
Jan 08 2016 03:26
@gitasong first reset the code, then try and run this code, while I look if anything is wrong with the current code
  if(card === 10 || card === 'J'|| card === 'Q'|| card === 'K'|| card === 'A')
    count--;
  else if(card === 2 || card === 3 || card === 4 || card === 5 || card === 6) 
    count++;


  if(count > 0){
    return count + " Bet";
  }
  else if(count <= 0) {
    return count + " Hold";
  }
Pawan
@pawan92
Jan 08 2016 03:26
everytime i come on this chat someone needs help with that tracks waypoint haha
Emma Clark
@sapphirestone
Jan 08 2016 03:27
Hey, I'm having trouble with Waypoint: Make Object Properties Private, can anyone see the errors in my code?
Nicole F.
@gitasong
Jan 08 2016 03:27
@Manish-Giri Okay.
Emma Clark
@sapphirestone
Jan 08 2016 03:27

var Bike = function() {

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

this.getGear = function(change){
gear ++;
};
this.setGear = function(4){
return ;
};

aaronK
@aaronk73
Jan 08 2016 03:27
@IMLaing cool. iam still on my waypoints learning
Ashley
@atan77
Jan 08 2016 03:27
@gitasong you're missing case 6 and break at end of count--
Manish Giri
@Manish-Giri
Jan 08 2016 03:27
@sapphirestone your getGear should just return gear;
aaronK
@aaronk73
Jan 08 2016 03:28
@IMLaing canyou help me with this one <h2 id="cat-photo-app"> within form
Jose Contreras
@LosPonies
Jan 08 2016 03:28
Help. Stuck at step where I Create a Set of Checkboxes.
CamperBot
@camperbot
Jan 08 2016 03:28
no wiki entry for: stuck at step where i create a set of checkboxes
Ian
@IMLaing
Jan 08 2016 03:28
@aaronk73 Of course, What are you trying to do? That has a h2 element with an id
Jose Contreras
@LosPonies
Jan 08 2016 03:29

Help Stuck at step where i create a Set of checkboxes. This is my code: <label><input type="checkbox" name="personality"> Angry</label>

<label><input type="checkbox" name="personality"> Mad</label>
<label><input type="checkbox" name="personlaity"> Lazy</label>

CamperBot
@camperbot
Jan 08 2016 03:29
no wiki entry for: stuck at step where i create a set of checkboxes this is my code labelinput typecheckbox namepersonality angrylabellabelinput typecheckbox namepersonality madlabellabelinput typecheckbox namepersonlaity lazylabel
aaronK
@aaronk73
Jan 08 2016 03:29
set id of an element
“give your form element the id of cat-photo-form
@IMLaing thank you
CamperBot
@camperbot
Jan 08 2016 03:30
aaronk73 sends brownie points to @imlaing :sparkles: :thumbsup: :sparkles:
:warning: aaronk73 already gave imlaing points
Nicole F.
@gitasong
Jan 08 2016 03:30
Oh, geez, @atan77 . Proof I can't count. It looked perfect to me, LOL! :p
aaronK
@aaronk73
Jan 08 2016 03:30
```<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>
<h2 id="cat-photo-app"</h2>
</form>
Nicole F.
@gitasong
Jan 08 2016 03:31
Let me go back to my original code with that correction, @Manish-Giri , @atan77 , @IMLaing .
Emma Clark
@sapphirestone
Jan 08 2016 03:31
@Manish-Giri Changed that, still having a few issues
aaronK
@aaronk73
Jan 08 2016 03:31
<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>
   <h2 id="cat-photo-app"</h2> 
</form>
Jelani Thompson
@JelaniThompson
Jan 08 2016 03:31
Hey does anyone know why this isn't logging to the console? I think it might be a syntax error haha
$(".workMinus").on('click', _ => {
    //time.setMinutes(minutes -= 1);
    console.log("test");
});
Jose Contreras
@LosPonies
Jan 08 2016 03:32
I found my mistake, i misspelled personality
Kyle Kinzalow
@KyleKinz
Jan 08 2016 03:32
Does anyone have five minutes to look at my first bootstrap site and tell me how bad the code is?
Manish Giri
@Manish-Giri
Jan 08 2016 03:32
@sapphirestone I don’t remember that waypoint very well, but here’s the general pattern:
this.getGear = function(){
return gear;
};
this.setGear = function(change){
gear = change; //if question asks to set gear to change
};
Kyle Kinzalow
@KyleKinz
Jan 08 2016 03:32
It's a single page site so nothing huge
Herman Fassett
@HermanFassett
Jan 08 2016 03:32
@KyleKinz post away, most likely someone will
Alexander Køpke
@alexanderkopke
Jan 08 2016 03:34
@JelaniThompson I'm not sure what _ => means but a ) is missing
Kyle Kinzalow
@KyleKinz
Jan 08 2016 03:34

http://codepen.io/parzuval/pen/QyvyaN

Was trying to design the mobile view first. The buttons don't do anything at the moment and my quotes aren't formatted properly and that's fine - I'll get to that. I'm mainly wanting to know how ratchet my code is and why the buttons move all over the place when I start making the window larger. Please drag the preview window to a phone-size width to see the design I'm trying for

Ian
@IMLaing
Jan 08 2016 03:34
@aaronk73 do you need the id on both the h2 and the form element?
aaronK
@aaronk73
Jan 08 2016 03:35
@IMLaing does not mention any thing other than that
Kyle Kinzalow
@KyleKinz
Jan 08 2016 03:35
wow it really looks bad in the preview window. open it in a new tab if you check it out
Ian
@IMLaing
Jan 08 2016 03:35
Remember things in < > are the elements and the id or class information goes inside them
@aaronk73 Just on the <h2> or just on the <form> element?
Ashley
@Ashtheyogi
Jan 08 2016 03:35
how do you create a class in the <style> bracket? I tried creating a smaller-image class and it is not letting me pass to the next challenge, though my image changed size
Elliott McNary
@bighitbiker3
Jan 08 2016 03:35

Hey guys…been super absent the past few weeks. This is why https://medium.com/@ElliottMcNary/building-an-app-outside-of-your-curriculum-7b76aa881d52#.woscqmszy

hope you like it :). Excited to start working on the backend!!

Emma Clark
@sapphirestone
Jan 08 2016 03:35

@Manish-Giri I'm close var Bike = function() {

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

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

// Only change code above this line.
};

Nicole F.
@gitasong
Jan 08 2016 03:36
That did it! Thanks @atan77 , @Manish-Giri . @IMLaing —so apparently an "else" statement is NOT necessary. My code passed with the addition of the 6 case (duh ;) ) and only an "if" statement for count > 0.