These are chat archives for FreeCodeCamp/Help

18th
Jan 2016
AndreLR
@AndreLR
Jan 18 2016 00:01
@emorejon thanks!
CamperBot
@camperbot
Jan 18 2016 00:01
andrelr sends brownie points to @emorejon :sparkles: :thumbsup: :sparkles:
:star: 116 | @emorejon | http://www.freecodecamp.com/emorejon
Luke Kearney
@lukekearney
Jan 18 2016 00:01
@julianbetancourt Pretty sure you can check if it has the active attribute http://stackoverflow.com/questions/17614844/javascript-detect-if-input-is-focused
Although to be honest, if I was asked to do that I'd just stumble through with a load of console logging and random test code
Julian Betancourt
@julianbetancourt
Jan 18 2016 00:02
@lukekearney document.activeElement this will return a boolean?
Luke Kearney
@lukekearney
Jan 18 2016 00:03
@julianbetancourt I think so. Let me actually test the code. Give me 5 minutes max
terra43110
@terra43110
Jan 18 2016 00:04

#17 has instructions:

"Give elements with the p tag a font-size of 16px."
It seems to be working, but the tests are labeling the following incorrect. Did I overlook something

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

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

<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>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

"""

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

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

<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>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

emorejon
@emorejon
Jan 18 2016 00:06
How do I send brownie points to ppl?
terra43110
@terra43110
Jan 18 2016 00:06

"""

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

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

<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>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
"""

"""

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

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

<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>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
"""

'test'
'test'
Brian
@sludge256
Jan 18 2016 00:08
` is the same key as ~
not '
Luke Kearney
@lukekearney
Jan 18 2016 00:09

@julianbetancourt I checked the JavaScript code and it returns true or false. Anything that uses an equality operator such as "==" or "===" in a comparison will return a boolean.

As a point of interest, document.activeElement gives the actual html element. In my test, it's this <input type="text" id="test-element">

The this keyword, when used in an event listener refers to the element that triggered the event (in this case a click)

terra43110
@terra43110
Jan 18 2016 00:09
@sludge256 :) thx
CamperBot
@camperbot
Jan 18 2016 00:09
terra43110 sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 879 | @sludge256 | http://www.freecodecamp.com/sludge256
terra43110
@terra43110
Jan 18 2016 00:10
test
Julian Betancourt
@julianbetancourt
Jan 18 2016 00:10
thanks @lukekearney
CamperBot
@camperbot
Jan 18 2016 00:10
julianbetancourt sends brownie points to @lukekearney :sparkles: :thumbsup: :sparkles:
:star: 39 | @lukekearney | http://www.freecodecamp.com/lukekearney
terra43110
@terra43110
Jan 18 2016 00:12

#17 has instructions:

"Give elements with the p tag a font-size of 16px."
It seems to be working, but the tests are labeling the following incorrect. Did I overlook something

<style>
.red-text {
color: red;
}
p {
font-size: 16px;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<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>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
test is failing. maybe it's a bug?
Sam Strawbridge
@SamStrawbridge
Jan 18 2016 00:13
.
Luke Kearney
@lukekearney
Jan 18 2016 00:15
It looks fine to me @terra43110 The only difference that I can can see between the one I handed in and your one is that mine has a class of “red-text” on the second paragraph element as well as the first. Mine passed about 30 minutes ago, so it could be that?
terra43110
@terra43110
Jan 18 2016 00:16
still failing
E
@1Emre-K
Jan 18 2016 00:16
@terra43110 try adding the font-size class to the p tag, like so; <p class="font-size">
the second p tag
terra43110
@terra43110
Jan 18 2016 00:17
i switched browsers and it worked
Luke Kearney
@lukekearney
Jan 18 2016 00:17
What browser were you using, just out of interest?
terra43110
@terra43110
Jan 18 2016 00:18
was using firefox, with my many extensions
used chrome
worked on chrome
Luke Kearney
@lukekearney
Jan 18 2016 00:18
Welcome to web dev…where we’re still dealing with browser inconsistencies :P
terra43110
@terra43110
Jan 18 2016 00:19
@1Emre-K
tried your suggestion, didn't work
oh well, moving on
Luke Kearney
@lukekearney
Jan 18 2016 00:21
Does anyone else find the editor on FCC really buggy though? Like the cursor not being where you’d expect and things like that. Honestly, the amount of times I’ve ended up typing stuff wrong because of it
Chris
@Aoxom
Jan 18 2016 00:23
@lukekearney i dont think ive noticed that problem
Luke Kearney
@lukekearney
Jan 18 2016 00:23
Hm must be just me then. Will try a different browser I guess
Chris
@Aoxom
Jan 18 2016 00:23
using chrome here
Luke Kearney
@lukekearney
Jan 18 2016 00:24
So was I. It was weird. The flashing cursor is showing as a line above where, if I start typing, the characters appear
Haroon Ghawsi
@HaroonGhawsi
Jan 18 2016 00:28

Hi guys, How to remove array elements as per the below challenge.

Use filter to remove all elements from oldArray that are greater than 5.

I have tried the below code till now.

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


});
Jorge Blanco
@jorgblanc
Jan 18 2016 00:30
Thanks @esaldivar
CamperBot
@camperbot
Jan 18 2016 00:30
jorgblanc sends brownie points to @esaldivar :sparkles: :thumbsup: :sparkles:
:star: 110 | @esaldivar | http://www.freecodecamp.com/esaldivar
Abdul Awali
@awalthefirst
Jan 18 2016 00:31
@HaroonGhawsi check if the val is greater than 5
@HaroonGhawsi and just return true or false
Haroon Ghawsi
@HaroonGhawsi
Jan 18 2016 00:32
@awalthefirst the below code is also not working, I have tried.
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;

});
@awalthefirst alright. let me put it in a if statement.
Abdul Awali
@awalthefirst
Jan 18 2016 00:33

@HaroonGhawsi

@awalthefirst the below code is also not working, I have tried.

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;

});

weird that should work?

@HaroonGhawsi which challenge is that
Haroon Ghawsi
@HaroonGhawsi
Jan 18 2016 00:34

@awalthefirst The below code is also not working. ```
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){

if(val > 5){
return val;
}

});
```

Brian
@sludge256
Jan 18 2016 00:34
The challenge is to remove everything greater than 5
and return everything else
Haroon Ghawsi
@HaroonGhawsi
Jan 18 2016 00:35
@awalthefirst 236 Filter Arrays with filter
Rory McGuire Krueger
@Rorshaqz
Jan 18 2016 00:35
Anyone have a shot of "Waypoint: Change Text inside an Element Using jQuery"? I cant figure out what it wants from me, or where.
Haroon Ghawsi
@HaroonGhawsi
Jan 18 2016 00:36
@sludge256 Yes, I tried below code also
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){

  if(val < 5){
    return val;
  }

});
Brian
@sludge256
Jan 18 2016 00:37
you should be returning 5 also
Abdul Awali
@awalthefirst
Jan 18 2016 00:38
@HaroonGhawsi return val > 5 ? false : true;
Manish Giri
@Manish-Giri
Jan 18 2016 00:39
@HaroonGhawsi you just need return val <= 5; inside
Haroon Ghawsi
@HaroonGhawsi
Jan 18 2016 00:39

@sludge256 This one worked.

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

  if(val <= 5){
    return newArray;
  }

});

Thank you guys for your help.

CamperBot
@camperbot
Jan 18 2016 00:39
haroonghawsi sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 880 | @sludge256 | http://www.freecodecamp.com/sludge256
Smrawls
@Smrawls
Jan 18 2016 00:39
@Rorshaqz If you scroll down under 'Run tests' it gives you 3 things to do. You have to italicize the text in your target4 button by adding HTML tags and the other two things are to make sure you don't change anything else
Go to Line 4 and change #target4 by surrounding it with <i></i>
Rory McGuire Krueger
@Rorshaqz
Jan 18 2016 00:51
@Smrawls Thanks for the help, I have a hard time understanding what the directions want specifically, where to put things, and exactly what needs to be written.
CamperBot
@camperbot
Jan 18 2016 00:51
rorshaqz sends brownie points to @smrawls :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for smrawls
Smrawls
@Smrawls
Jan 18 2016 00:52
No problem!
Cole Perkins
@coleperkins
Jan 18 2016 00:59
// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function update(id, prop, value) {
  if (collection[id][prop] !== "" && prop !== "tracks") {
    collection[id][prop] = value;
  }  
  else if (prop === "tracks" && collection[id][prop] !== "") {
    collection[id][prop].push(value);
  }
  else if (collection[id][prop] === "") {
    delete collection[id][prop];
  }


  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");
Ideas where I'm going wrong?
Waypoint: Record Colleciton
*Collection
Maciej Bembenista
@macbem
Jan 18 2016 01:00
@coleperkins weren't you supposed to check if the value isn't empty instead of checking if collection[id][prop] is?
Kyle Roach
@iRoachie
Jan 18 2016 01:00
@coleperkins you’re checking the wrong valyes in your if statements
Cole Perkins
@coleperkins
Jan 18 2016 01:01
@noczesc I suppose so. I thought it was referencing the value of the prop of the id.
@iRoachie How so?
The instructions say "For the given id in collection:"
Kyle Roach
@iRoachie
Jan 18 2016 01:02
@coleperkins You’re suppose to check the prop and val variables
if (value !== "" && prop !== "tracks") {
    collectionCopy[id][prop] = value;
  } else if(prop === "tracks" && value !== "") {
    collectionCopy[id].tracks.push(value);
  } else {
    delete collectionCopy[id][prop];
  }
Maciej Bembenista
@macbem
Jan 18 2016 01:02
@coleperkins try to change your if statements to check if value !== "". Also, nest all of those statements in an if checking if value is correct. Pseudocode
if val exists
{
if
elseif
else
}
else
{
delete
}
Cole Perkins
@coleperkins
Jan 18 2016 01:03
@iRoachie I see what you're saying now. Thanks!
CamperBot
@camperbot
Jan 18 2016 01:03
coleperkins sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 242 | @iroachie | http://www.freecodecamp.com/iroachie
Elifaz Filho
@Elifaz
Jan 18 2016 01:25
Does anyone have an idea on how to approach Roman Numeral Converter Bonfire?
Jordan
@Nadr0j
Jan 18 2016 01:29
Yes
Can you post a link to the bonfire?
Elifaz Filho
@Elifaz
Jan 18 2016 01:29
bot Roman Numeral Converter
CamperBot
@camperbot
Jan 18 2016 01:29

:point_right: bonfire roman numeral converter [wiki]

Problem Explanation:

  • You will create a program that converts an integer to a roman numeral.
:pencil: read more about bonfire roman numeral converter on the FCC Wiki
Elifaz Filho
@Elifaz
Jan 18 2016 01:30
@Nadr0j this is the one
Jordan
@Nadr0j
Jan 18 2016 01:30
@Elifaz oh my mistake. I thought that was a different bonfire. I haven't gotten there yet.
Elifaz Filho
@Elifaz
Jan 18 2016 01:30
ah ok.. @Nadr0j
What I’m thinking is to split the argument and count how many characters is in, then based on that amount I will decided if the number requires below or above L, or C, or M then do the same with the smaller numbers..Not sure it will work though..
Haroon Ghawsi
@HaroonGhawsi
Jan 18 2016 01:31
How to reverse a string?
Elifaz Filho
@Elifaz
Jan 18 2016 01:32
@HaroonGhawsi check out on the MDN website for string.prototype.reverse()
Haroon Ghawsi
@HaroonGhawsi
Jan 18 2016 01:32
@Elifaz alright. thanks
CamperBot
@camperbot
Jan 18 2016 01:32
haroonghawsi sends brownie points to @elifaz :sparkles: :thumbsup: :sparkles:
:star: 333 | @elifaz | http://www.freecodecamp.com/elifaz
Haroon Ghawsi
@HaroonGhawsi
Jan 18 2016 01:33
@Elifaz ok
Smrawls
@Smrawls
Jan 18 2016 01:39
Can someone help me on Checkpoint: Stand in Line? This is what I have so far:
blob
This message was deleted
Colton Ehrman
@coltonehrman
Jan 18 2016 01:40
@Smrawls why are u pushing an empty array in?
Kyle Roach
@iRoachie
Jan 18 2016 01:41
@Smrawls Yea i’ll help
arr.push(item);
var removed = arr[0];
arr.shift();
return removed;
Colton Ehrman
@coltonehrman
Jan 18 2016 01:42
u could also do
arr.push(item);
return arr.shift();
Smrawls
@Smrawls
Jan 18 2016 01:42
@coltonehrman I thought I needed a placeholder
Colton Ehrman
@coltonehrman
Jan 18 2016 01:42
a placeholder? what do u mean?
and also why do u push in the number 6?
Smrawls
@Smrawls
Jan 18 2016 01:44
I thought I needed something in place for array. I pushed the 6, because I thought it was the new item that was being added into the queue. Basically, I was confused
Colton Ehrman
@coltonehrman
Jan 18 2016 01:44
lol well arr is already an array
and u want to push in the item thats passed into the function
Munish Tayal
@munishtayal
Jan 18 2016 01:46
This message was deleted
Colton Ehrman
@coltonehrman
Jan 18 2016 01:46
and item is not an array so u cant say item.unshift() also unshift() adds an item at the beginning of an array so u would of wanted to pass something in
Kyle Roach
@iRoachie
Jan 18 2016 01:46
@coltonehrman Yea that works too
Colton Ehrman
@coltonehrman
Jan 18 2016 01:46
shift() removes an item from the beginning of an array
Kyle Roach
@iRoachie
Jan 18 2016 01:47
@coltonehrman And returns that value!
Colton Ehrman
@coltonehrman
Jan 18 2016 01:47
correct @iRoachie
making it possible to return arr.shift()
Matthew Johnson
@EmjayFlight
Jan 18 2016 01:48
Receiving “TypeErrorL Cannot set property ‘prop’ of undefined”
// Setup
var collection = {
    2548: {
      album: "Slippery When Wet", // var access = collection.id.album;
      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) {
  console.log(value);
  if(value !== "" && prop !== "tracks") {
    collection.id.prop = value;
  }
 else if(prop == "tracks" && value !== "") {
   collection.id.prop.push(value);
 }
  else {
    delete collection.id.prop;
  }

  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA”);
Munish Tayal
@munishtayal
Jan 18 2016 01:48
0_0 ( : /-\ : ) 0-0 ......Is this string a palindrome....problem says to proove it a palindrome...plz someone help
Kyle Roach
@iRoachie
Jan 18 2016 01:49
@MrEmjay417 Hey you have to use the bracket notation for properties stored in variabe
Colton Ehrman
@coltonehrman
Jan 18 2016 01:49
@MrEmjay417 u need bracket notation
Kyle Roach
@iRoachie
Jan 18 2016 01:49
@MrEmjay417 collection[id][prop]
Colton Ehrman
@coltonehrman
Jan 18 2016 01:49
^
dot notation interprets the property as a string literal not a variable
collection.id is the same as collection["id"]
Matthew Johnson
@EmjayFlight
Jan 18 2016 01:51
@iRoachie @coltonehrman Thank you!
CamperBot
@camperbot
Jan 18 2016 01:51
mremjay417 sends brownie points to @iroachie and @coltonehrman :sparkles: :thumbsup: :sparkles:
:star: 247 | @iroachie | http://www.freecodecamp.com/iroachie
:star: 399 | @coltonehrman | http://www.freecodecamp.com/coltonehrman
Munish Tayal
@munishtayal
Jan 18 2016 01:52
0_0 ( : /-\ : ) 0-0 ......Is this string a palindrome.?...problem says to proove it a palindrome...plz someone help
Colton Ehrman
@coltonehrman
Jan 18 2016 01:52
@munishtayal no its not
do u kno what a palindrome is?
Abdul Awali
@awalthefirst
Jan 18 2016 01:52
@munishtayal yes
Colton Ehrman
@coltonehrman
Jan 18 2016 01:53
@awalthefirst its close but notice the _ and -
in between the 0
Abdul Awali
@awalthefirst
Jan 18 2016 01:54
@munishtayal the instruction says.. remove punctuations . so it will be valid
Munish Tayal
@munishtayal
Jan 18 2016 01:54
oh ok....Didn't noticed that @coltonehrman @awalthefirst thanks
CamperBot
@camperbot
Jan 18 2016 01:54
munishtayal sends brownie points to @coltonehrman and @awalthefirst :sparkles: :thumbsup: :sparkles:
:star: 514 | @awalthefirst | http://www.freecodecamp.com/awalthefirst
:star: 400 | @coltonehrman | http://www.freecodecamp.com/coltonehrman
Ace
@life-cosmic-game
Jan 18 2016 01:57
Hey guys, can anyone help me with the "Nest an Anchor element within a paragraph?"
B. Garber
@TheBGar
Jan 18 2016 01:58
anyone though the first bonfires? I'm looking for help with seek and destroy
Ace
@life-cosmic-game
Jan 18 2016 01:58
This is what I have so far: <p>View more <a href='http://www.freecatphotoapp.com'>cat photos</a></p>
Kyle Roach
@iRoachie
Jan 18 2016 02:00
@life-cosmic-game Yea that’s correct
Ace
@life-cosmic-game
Jan 18 2016 02:00
@iRoachie Thanks, so I guess it's a bug, because I've been stuck there for nearly 30mins
CamperBot
@camperbot
Jan 18 2016 02:00
life-cosmic-game sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 250 | @iroachie | http://www.freecodecamp.com/iroachie
Kyle Roach
@iRoachie
Jan 18 2016 02:01
@life-cosmic-game send me your exact url
Abdul Awali
@awalthefirst
Jan 18 2016 02:01
@life-cosmic-game has it pass now
Ace
@life-cosmic-game
Jan 18 2016 02:07
@awalthefirst it's gone through :smile:
kaitgp
@kaitgp
Jan 18 2016 02:08
stuck on creating a form element...
<form>
<input type="text" placeholder="cat photo URL">
<form action="/submit-cat-photo">
</form>
says im missing action and closing tag
Kyle Roach
@iRoachie
Jan 18 2016 02:09
@kaitgp Hey you have 2 forms!
@kaitgp move the action=“/submit-cat-photo” in the tag of the first form
kaitgp
@kaitgp
Jan 18 2016 02:11
@iRoachie thanks!
CamperBot
@camperbot
Jan 18 2016 02:11
kaitgp sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 254 | @iroachie | http://www.freecodecamp.com/iroachie
kaitgp
@kaitgp
Jan 18 2016 02:11
it worked!
Kyle Roach
@iRoachie
Jan 18 2016 02:11
@kaitgp No problem happy coding :)
kaitgp
@kaitgp
Jan 18 2016 02:11
:smile: thank u
Smrawls
@Smrawls
Jan 18 2016 02:16
Thanks, @coltonehrman and thanks @iRoachie It took me a while, but in addition to your help, I needed to do a hard refresh and add arr.push(7,8,9,10);
CamperBot
@camperbot
Jan 18 2016 02:16
smrawls sends brownie points to @coltonehrman and @iroachie :sparkles: :thumbsup: :sparkles:
:warning: smrawls already gave coltonehrman points
:warning: smrawls already gave iroachie points
Allan Hernandez
@allan-hernandez
Jan 18 2016 02:18
Hi - I'm not sure I'm understanding the question with the "Accessing Nested Arrays" challenge
Says "Retrieve the second tree from the variable myPlants using object dot and array bracket notation."
Error: Retrieve the second tree from the variable myPlants using object dot and array bracket notation.

I thought it'd be a simple:
`
// Setup
var myPlants = [
{
type: "flowers",
list: [
"rose",
"tulip",
"dandelion"
]
},
{
type: "trees",
list: [
"fir",
"pine",
"birch"
]
}
];

// Only change code below this line

var secondTree = myPlants.trees1; // Change this line
`

Kyle Roach
@iRoachie
Jan 18 2016 02:19
@allan-hernandez Hey they want you to get the 2nd tree, being “pine”
Allan Hernandez
@allan-hernandez
Jan 18 2016 02:21
I thought I was doing that by bringing back the second element of trees (my brackets dont show for some reason)
but i get that error: typerror: cannot read property '1' of undefined
Kyle Roach
@iRoachie
Jan 18 2016 02:23
@allan-hernandez
var secondTree = myPlants[1].list[1]; // Change this line
You needed to get the second object in the array
Allan Hernandez
@allan-hernandez
Jan 18 2016 02:24
ah okay - I didn't realize I had to specify the 2nd position for myPlants first
thank you
Kyle Roach
@iRoachie
Jan 18 2016 02:24
@allan-hernandez No problem man :)
Allan Hernandez
@allan-hernandez
Jan 18 2016 02:25

I think the example is wrong in this case then - it shows:

var ourPets = {
"cats": [
"Meowzer",
"Fluffy",
"Kit-Cat"
],
"dogs": [
"Spot",
"Bowser",
"Frankie"
]
};
ourPets.cats1; // "Fluffy"
ourPets.dogs0; // "Spot"

but the way it worked, there should be a brackets 0 and brackets one after ourpets for cats/dogs respectively
Kyle Roach
@iRoachie
Jan 18 2016 02:26
that one is different
The one with pets is an array inside an object
The one with trees in objects inside an array
Allan Hernandez
@allan-hernandez
Jan 18 2016 02:27
I see - thanks again @iRoachie
CamperBot
@camperbot
Jan 18 2016 02:27
allan-hernandez sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 257 | @iroachie | http://www.freecodecamp.com/iroachie
Allan Hernandez
@allan-hernandez
Jan 18 2016 02:27
I need to pay more attention to curly brackets versus square - that makes sense now
Kyle Roach
@iRoachie
Jan 18 2016 02:28
:)
Sam Bolton
@SamuelBolton
Jan 18 2016 02:34
I'm looking to nest my existing IMG element within an a element and also to dead link it but am having a little trouble
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
Munish Tayal
@munishtayal
Jan 18 2016 02:41
What kind of trouble @SamuelBolton
Sam Bolton
@SamuelBolton
Jan 18 2016 02:43
@munishtayal this is my current code.
<img class="smaller-image thick-green-border" <a href="#" > img src="https://bit.ly/fcc-relaxing-cat"> </a>
need to nest my existing IMG element within an a element and also to dead link it but i believe i have it a little wrong.
Munish Tayal
@munishtayal
Jan 18 2016 02:44
use anchor first....then img element between anchor
<a><img></a>
@SamuelBolton
<a href=#><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a> @SamuelBolton
EvilAndrew
@EvilAndrew
Jan 18 2016 02:47
<form action="/submit-cat-photo"> <!--Give your form element the id of cat-photo-form.-->
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
Sam Bolton
@SamuelBolton
Jan 18 2016 02:50
thank you @munishtayal
CamperBot
@camperbot
Jan 18 2016 02:50
samuelbolton sends brownie points to @munishtayal :sparkles: :thumbsup: :sparkles:
:star: 249 | @munishtayal | http://www.freecodecamp.com/munishtayal
Sam Bolton
@SamuelBolton
Jan 18 2016 02:50
thank you @EvilAndrew
CamperBot
@camperbot
Jan 18 2016 02:50
samuelbolton sends brownie points to @evilandrew :sparkles: :thumbsup: :sparkles:
:star: 11 | @evilandrew | http://www.freecodecamp.com/evilandrew
Ianko Jelev
@jelevianko
Jan 18 2016 03:15
Quick question trying to add a dead link .... a element should be a dead link with a href attribute set to "#" how do I set the attribute?
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:16
@jelevianko #href = ""
Hi all
can somebody help me with
Samedy
@Samedy
Jan 18 2016 03:18
@jelevianko href="#"
Ianko Jelev
@jelevianko
Jan 18 2016 03:18
Before my img link?
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:18
whatever it may be use #
Samedy
@Samedy
Jan 18 2016 03:19
img link has no href attribute
should be <a href="#"><img /> </a>
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:19
yes
function truncate(str, num) {
  // Clear out that junk in your trunk
 var shortText = jQuery.trim(str).substring(0, num)
    .split(" ").slice(0, num-1).join(" ") + "...";
  return shortText;
}

truncate("A-tisket a-tasket A green and yellow basket", 11);
Ianko Jelev
@jelevianko
Jan 18 2016 03:20
Im sorry I ment before my link
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:21
somebody help me with 263 challenge
Samedy
@Samedy
Jan 18 2016 03:23
@jelevianko I don't clear what you mean
Ianko Jelev
@jelevianko
Jan 18 2016 03:24
Thank you @samedy and @sukumarkutagulla I got it !!
CamperBot
@camperbot
Jan 18 2016 03:24
jelevianko sends brownie points to @samedy and @sukumarkutagulla :sparkles: :thumbsup: :sparkles:
:star: 312 | @samedy | http://www.freecodecamp.com/samedy
:star: 263 | @sukumarkutagulla | http://www.freecodecamp.com/sukumarkutagulla
Utkarsh Bhimte
@Utkarshbhimte
Jan 18 2016 03:24
what was the name of the challenge where entrance animation was taught?
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:28
Hi somebody help me with 263 Truncate a string challenge
@jelevianko :+1:
@Samedy hi
Samedy
@Samedy
Jan 18 2016 03:29
@sukumarkutagulla hi
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:30
can you help me with 263 challenge
Samedy
@Samedy
Jan 18 2016 03:31
ok first let see your code~
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:32
ok
fred abrasaldo
@markidboy2
Jan 18 2016 03:32
Headline with the h2 Element
guys help. starter here
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:32
@Samedy
function truncate(str, num) {
  // Clear out that junk in your trunk
   if(str.length > num){
     st = str.substring(0,num) + "...";
   }
}

truncate("A-tisket a-tasket A green and yellow basket", 11);
@markidboy2 how can we help you
fred abrasaldo
@markidboy2
Jan 18 2016 03:33
create an h2 element sir :)
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:33
<h2>he element</h2>
Samedy
@Samedy
Jan 18 2016 03:34
@sukumarkutagulla this will pass first hypothesis
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:34
any element in HTML starts with opening tag (<>) and cosing tag (</>)
can you explain what to modify there @Samedy
Samedy
@Samedy
Jan 18 2016 03:35
@sukumarkutagulla In that have 3 requirement need to be meet:
fred abrasaldo
@markidboy2
Jan 18 2016 03:35
@sukumarkutagulla thank you sir best great site ever.
CamperBot
@camperbot
Jan 18 2016 03:35
markidboy2 sends brownie points to @sukumarkutagulla :sparkles: :thumbsup: :sparkles:
:star: 264 | @sukumarkutagulla | http://www.freecodecamp.com/sukumarkutagulla
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:36
@markidboy2 no sir, call me by name, we are a team here
Michael
@msulock
Jan 18 2016 03:36
How do I make it so my Github profile is linked to free code camp?
fred abrasaldo
@markidboy2
Jan 18 2016 03:36
how can i adress you u sir?
Michael
@msulock
Jan 18 2016 03:37
I need dem brownie points!
fred abrasaldo
@markidboy2
Jan 18 2016 03:37
sorry
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:37
just go through getting started in freecode camp there they will guide you @bbbeans
fred abrasaldo
@markidboy2
Jan 18 2016 03:37
my bad
hehe
@sukumarkutagulla
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:37
sukumar @markidboy2
fred abrasaldo
@markidboy2
Jan 18 2016 03:37
sukumar now i know.
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:37
@Samedy suggest me something
fred abrasaldo
@markidboy2
Jan 18 2016 03:37
thanks again sukumar
Michael
@msulock
Jan 18 2016 03:37
ah found it
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:37
@markidboy2 np
Samedy
@Samedy
Jan 18 2016 03:37
@sukumarkutagulla 1. they ask us to check the 2nd argument
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:38
yes
Michael
@msulock
Jan 18 2016 03:38
i had done like 260 challenges
Samedy
@Samedy
Jan 18 2016 03:38
@sukumarkutagulla like this:
if (num<=3) /do something else //do other
Alex Chavez
@alexchavezg
Jan 18 2016 03:39
So i on Waypoint Access MultiDimensional Arrays With Indexes and I was windering how they get their answers like how do they know arr1; // equals 6 im missing something
I ment arr[1][2]; //equals 6
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:40
@Samedy
function truncate(str, num) {
  // Clear out that junk in your trunk
   if(num >= 3){
     st = str.substring(0,num) + "...";
     return st;
   } else{
    return str.substring(0,num);
   }
}

truncate("A-tisket a-tasket A green and yellow basket", 11);
anymore improvements??
Samedy
@Samedy
Jan 18 2016 03:42
@sukumarkutagulla 2. they want you to check the string length with 2nd argument also before truncate
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:42
i mentioned in if
num >=3
if less than or equal to 3 should not add .... else it should add
Samedy
@Samedy
Jan 18 2016 03:44
if (num <=3) // truncate but don't add three dot
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:44
ok
Samedy
@Samedy
Jan 18 2016 03:45
else
if (string.length >num) //do truncate and add three dot
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:45
ok
Samedy
@Samedy
Jan 18 2016 03:46
else // mean num> string.length so no need to truncate
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 03:46
ok
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 18 2016 03:47
@sukumarkutagulla you have a error in logic of your code keeping num >= 3 it should be just num>3
@sukumarkutagulla also
@sukumarkutagulla comapare it with string.length
morning everyone :smile:
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 18 2016 03:53
@alexchavezg count the array's rows and columns from 0
fred abrasaldo
@markidboy2
Jan 18 2016 03:55
@sukumarkutagulla Here's how you would set your h2 element's text color to blue:
how sir cant proceed :(
sorry
ignore the sir @sukumarkutagulla
filipino manners
cannelflow
@cannelflow
Jan 18 2016 03:56
@markidboy2 tried ?
Samedy
@Samedy
Jan 18 2016 03:56
@markidboy2 you could do <h2 style="color:blue">blah blah </h2>
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 18 2016 03:56
@alexchavezg first count the numbers of arrays , which is denoted by first bracket myArray[2][1] (always count from 0)
cannelflow
@cannelflow
Jan 18 2016 03:57
@cannelflow go to style sheet then write h2{ color:blue;}
@markidboy2
Izet
@chaidarizet
Jan 18 2016 03:57

hello can you help me

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

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

the challenge is
Your h2 element should be blue.

Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 18 2016 03:57
@alexchavezg the number in the second bracket denotes the element of the inner array count it from 0 too
fred abrasaldo
@markidboy2
Jan 18 2016 03:58
im a okay thanks guys
cannelflow
@cannelflow
Jan 18 2016 03:58
@chaidarizet code looks f9 which ex?
Izet
@chaidarizet
Jan 18 2016 03:59
the website whether bug?
@cannelflow
cannelflow
@cannelflow
Jan 18 2016 04:00
@chaidarizet which ex?
try refreshing page
Alex Chavez
@alexchavezg
Jan 18 2016 04:00
but how does that equal 6 im sorry i dont get it:/ @Mr-Kumar-Abhishek
acdingo
@acdingo
Jan 18 2016 04:01
hey guys I need some help. It's displaying what it should be displaying on the phone but its not letting me pass to the text one :(
<input type="text form-control" placeholder="cat photo URL" required>
<button type="submit btn btn-primary"><i class="fa fa-paper-plane"></i>Submit</button>
Give the submit button in your form the classes btn btn-primary.
Add a <i class="fa fa-paper-plane"></i> within your submit button element.
Give the text input in your form the class form-control.
Make sure each of your i elements has a closing tag. <-- those are the goals
cannelflow
@cannelflow
Jan 18 2016 04:02
@acdingo which ex?
acdingo
@acdingo
Jan 18 2016 04:02
@cannelflow 90
cannelflow
@cannelflow
Jan 18 2016 04:02
@acdingo name
acdingo
@acdingo
Jan 18 2016 04:03
@cannelflow Style Text Inputs as Form Controls
Haroon Ghawsi
@HaroonGhawsi
Jan 18 2016 04:03

Hi guys,

I am trying to solve this challenge [Return true if the given string is a palindrome. Otherwise, return false.]

and I have tried the below code till now

```
function palindrome(str) {
// Good luck!

var re = /(\w+)\s\W/gi;

var newStr = str.replace(re);

if(newStr){

return true;

}

//return true;
}

palindrome("eye");

fred abrasaldo
@markidboy2
Jan 18 2016 04:03
Remove the style attribute from your h2 element.
Create a style element.
Your h2 element should be blue.
Ensure that your stylesheet h2 declaration is valid with a semicolon and closing brace.
Make sure all your style elements are valid and have a closing tag.
help guys
Haroon Ghawsi
@HaroonGhawsi
Jan 18 2016 04:03
function palindrome(str) {
  // Good luck!


  var re = /(\w+)\s\W/gi;

  var newStr = str.replace(re);

  if(newStr){

    return true;
  }

  //return true;
}



palindrome("eye");
cannelflow
@cannelflow
Jan 18 2016 04:04
@acdingo <button type="submit" class="btn btn-primary"><i class="fa fa-paper-plane"></i> Submit</button>
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 18 2016 04:05
@alexchavezg your array has arrays am I correct ? so so the first number in the myArray[2][1] denotes the position of the element which in the second (2) position when you count from 0 the elements of the array are arrays so count which is 2 array in your array then the second number (1) denotes the element of the inner array, count from 0 and see which gets the position 1 in your inner array.
cannelflow
@cannelflow
Jan 18 2016 04:07
@HaroonGhawsi ok tillnow you replaced regx then make it lowercase then split then reverse then join then check if last result equal to lowercase
Izet
@chaidarizet
Jan 18 2016 04:07

@cannelflow For example, if you wanted all h2 elements to be red, your style element would look like this:

<style>
  h2 {color: red;}
</style>

Note that it's important to have both opening and closing curly braces ({ and }) around each element's style. You also need to make sure your element's style is between the opening and closing style tags. Finally, be sure to add the semicolon to the end of each of your element's styles.

Delete your h2 element's style attribute and instead create a CSS style element. Add the necessary CSS to turn all h2 elements blue.

Alex Chavez
@alexchavezg
Jan 18 2016 04:07
perfect got it @Mr-Kumar-Abhishek
acdingo
@acdingo
Jan 18 2016 04:07
@cannelflow haha okay, that makes sense! Thank you! It's still not letting me pass though because of this achievement: Give the text input in your form the class form-control.
CamperBot
@camperbot
Jan 18 2016 04:07
acdingo sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 431 | @cannelflow | http://www.freecodecamp.com/cannelflow
cannelflow
@cannelflow
Jan 18 2016 04:08
@chaidarizet style tag is good can you show your whole code
fred abrasaldo
@markidboy2
Jan 18 2016 04:09
how to remove the style attribute from your h2 element guys?
cannelflow
@cannelflow
Jan 18 2016 04:10
@markidboy2 <h2 style="color:red">abc</h2> now remove style <h2>abc</h2>
Izet
@chaidarizet
Jan 18 2016 04:10

@cannelflow

<style>
h2 {color: blue;}

</style>

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

cannelflow
@cannelflow
Jan 18 2016 04:11
@chaidarizet which ex?
Samedy
@Samedy
Jan 18 2016 04:11
@chaidarizet where is your h2 tag that need to apply your style?
cannelflow
@cannelflow
Jan 18 2016 04:11
@chaidarizet where is your h2
tag
in html
Rena
@rsugihara
Jan 18 2016 04:12
Is this room only for HTML/CSS or can I ask something about JS?
cannelflow
@cannelflow
Jan 18 2016 04:12
@HaroonGhawsi worked?
@rsugihara ask anything ppl will help eventully
Izet
@chaidarizet
Jan 18 2016 04:14

<h2 style="color: blue">CatPhotoApp</h2>

<style>
h2 {color: red;}
</style>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
@cannelflow @Samedy i dont get it whats going on

Samedy
@Samedy
Jan 18 2016 04:14
@chaidarizet you need to remove inline style that you apply
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 18 2016 04:14
@rsugihara what is your problem on JS ?
Samedy
@Samedy
Jan 18 2016 04:14
style="color: blue"
cannelflow
@cannelflow
Jan 18 2016 04:15
@chaidarizet you added h2 in style tag that is css now if there is no h2 tag in html where it is going to apply that effect
Samedy
@Samedy
Jan 18 2016 04:15
@chaidarizet
cannelflow
@cannelflow
Jan 18 2016 04:15
@chaidarizet read carefully what instruction is saying
Samedy
@Samedy
Jan 18 2016 04:15
css apply the most specific style if override!
Izet
@chaidarizet
Jan 18 2016 04:18
what is the code? :(
@cannelflow @Samedy
cannelflow
@cannelflow
Jan 18 2016 04:18
@chaidarizet tell mke which ex?
the thing you wrote is code
Haroon Ghawsi
@HaroonGhawsi
Jan 18 2016 04:19
@cannelflow I am just working on it
cannelflow
@cannelflow
Jan 18 2016 04:20
@HaroonGhawsi :+1:
AndreLR
@AndreLR
Jan 18 2016 04:20
I'm stuck again! Noob status!!!

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

<h2>CatPhotoApp</h2>

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

Trying to do the CSS style
IDK what I'm doing wrong!!!
cannelflow
@cannelflow
Jan 18 2016 04:21
@chaidarizet
<style>
  h2{
    color:blue;
  }
</style>
<h2>CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
Kyle Roach
@iRoachie
Jan 18 2016 04:21
@AndreLR looks right to me, paste ur url
Kyle Roach
@iRoachie
Jan 18 2016 04:22
@AndreLR Hey you have to make a new class called red-text
Majlind
@majlind
Jan 18 2016 04:22
any chime-ins? I prob have the wrong statement for my init If

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

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

// Only change code above this line
}
Kyle Roach
@iRoachie
Jan 18 2016 04:23
@majlind Hey you have to use the bracket notation for variables
@majlind contacts[i][prop]
Rena
@rsugihara
Jan 18 2016 04:24
@Mr-Kumar-Abhishek I'm having a problem with "Testing Objects for Properties". Here's what I have so far:
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here

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

// Test your code by modifying these values
checkObj("gift");
AndreLR
@AndreLR
Jan 18 2016 04:24
@iRoachie I get that part. I'm just stuck...
Izet
@chaidarizet
Jan 18 2016 04:24
@cannelflow ive wrote like that but the challenge item say your h2 must be blue. :(
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 04:24
hi @Mr-Kumar-Abhishek
AndreLR
@AndreLR
Jan 18 2016 04:24
I'll paste URL again
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 04:24
function truncate(str, num) {
  // Clear out that junk in your trunk
   if(num <= 3){
     st = str.substring(0,num);
     return st;
   } else if (str.length>num){
    return str.substring(0,num);
   }
}

truncate("A-tisket a-tasket A green and yellow basket", 11);
Kyle Roach
@iRoachie
Jan 18 2016 04:25
@AndreLR
<style>
  .red-text {
    color:red;
  }
</style>

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

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
Izet
@chaidarizet
Jan 18 2016 04:25
@cannelflow thank you anw
CamperBot
@camperbot
Jan 18 2016 04:25
chaidarizet sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 432 | @cannelflow | http://www.freecodecamp.com/cannelflow
Majlind
@majlind
Jan 18 2016 04:28
thanks @iRoachie I'll check it out rn
CamperBot
@camperbot
Jan 18 2016 04:28
majlind sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 281 | @iroachie | http://www.freecodecamp.com/iroachie
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 18 2016 04:28
@rsugihara in your if condition statement you are missing the argument of hasOwnProperty function it should be like this : myObj.hasOwnProperty(checkProp)
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 04:28
function truncate(str, num) {
  // Clear out that junk in your trunk
   if(num <= 3){
     st = str.substring(0,num);
     return st;
   } else if (str.length>num){
    return str.substring(0,num);
   }
}

truncate("A-tisket a-tasket A green and yellow basket", 11);
AndreLR
@AndreLR
Jan 18 2016 04:29
@iRoachie you're awesome, thanks!
CamperBot
@camperbot
Jan 18 2016 04:29
andrelr sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 282 | @iroachie | http://www.freecodecamp.com/iroachie
Rena
@rsugihara
Jan 18 2016 04:29
@Mr-Kumar-Abhishek Yes I've tried that, but then "else" won't return "Not Found".
Kyle Roach
@iRoachie
Jan 18 2016 04:29
@AndreLR No problem man, glad i could help
chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 04:29
@sukumarkutagulla whats the waypoint name ?
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 04:30
truncate a string 263 @chaitanyaashtekar
Samedy
@Samedy
Jan 18 2016 04:31
@sukumarkutagulla you miss the requirement or maybe i don't well explain
chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 04:31
@sukumarkutagulla idk you are ahead of me
cannelflow
@cannelflow
Jan 18 2016 04:31

@chaidarizet Inside your style element, change the h2 selector to .red-text and update the color's value from blue to red.

Give your h2 element the class attribute with a value of 'red-text'.

Samedy
@Samedy
Jan 18 2016 04:32
@sukumarkutagulla if (num<=3) //the truncate length should not include the 3 dot
Majlind
@majlind
Jan 18 2016 04:33
@iRoachie No success
@iRoachie I had 1/5 conditions after the recommendation, close tho
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 04:34
@Samedy i didn't inclue
function truncate(str, num) {
  // Clear out that junk in your trunk
   if(num <= 3){
     st = str.substring(0,num);
     return st;
   } else if (str.length>num){
    return str.substring(0,num);
   }
}

truncate("A-tisket a-tasket A green and yellow basket", 11);
Kyle Roach
@iRoachie
Jan 18 2016 04:34
@majlind which waypoint again?
Majlind
@majlind
Jan 18 2016 04:35
Profile Lookup
Samedy
@Samedy
Jan 18 2016 04:35
@sukumarkutagulla // Clear out that junk in your trunk
var result="";
var len = 0;
//check num length
if (num<=3)
len=num;
else
len=num-3;
// do the job
if (str.length>num){
result = str.substr(0,len) +"...";
}else{
result = str;
}
return result;
Majlind
@majlind
Jan 18 2016 04:35
//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    },
];

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

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

// Only change code above this line
}

// Change these values to test your function
lookUp("Akira", "likes");
Wp Profile Lookup
We have an array of objects representing different people in our contacts lists.

A lookUp function that takes firstName and a property (prop) as arguments has been pre-written for you.

The function should check if firstName is an actual contact's firstName and the given property (prop) is a property of that contact.

If both are true, then return the "value" of that property.

If firstName does not correspond to any contacts then return "No such contact"

If prop does not correspond to any valid properties then return "No such property"
Abhishek Kumar
@Mr-Kumar-Abhishek
Jan 18 2016 04:36

@rsugihara this should be the logic :

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

Care to show your code what have you changed ?

Kyle Roach
@iRoachie
Jan 18 2016 04:36
@majlind Hey you’re trying to compare the props of an object and a testing if the object is there at the same time
@majlind You need to check if object exists with the first name
@majlind
 var contact;

 for(var i=0; i < contacts.length; i++) {
     if(contacts[i].firstName === firstName) {
       contact = contacts[i];
     }
 }

  if(!contact) {
    return "No such contact";
  } else if(!contact[prop]) {
    return "No such property";
  } else {
    return contact[prop];
  }
Majlind
@majlind
Jan 18 2016 04:38
@iRoachie I had something before with ---.hasOwnProperty(arg) how you recommend I join that in
Rena
@rsugihara
Jan 18 2016 04:39
@Mr-Kumar-Abhishek I had "" on checkProp argument and that's why it didn't work. Now it does. Thanks a lot!
CamperBot
@camperbot
Jan 18 2016 04:39
rsugihara sends brownie points to @mr-kumar-abhishek :sparkles: :thumbsup: :sparkles:
:star: 295 | @mr-kumar-abhishek | http://www.freecodecamp.com/mr-kumar-abhishek
Kyle Roach
@iRoachie
Jan 18 2016 04:40
@majlind
 var contact;

 for(var i=0; i < contacts.length; i++) {
     if(contacts[i].firstName === firstName) {
       contact = contacts[i];
     }
 }

  if(!contact) {
    return "No such contact";
  } else if(!contact[prop]) {
    return "No such property";
  } else {
    return contact[prop];
  }
sukumarkutagulla
@sukumarkutagulla
Jan 18 2016 04:40
@Samedy thanks i will analyse it
CamperBot
@camperbot
Jan 18 2016 04:40
sukumarkutagulla sends brownie points to @samedy :sparkles: :thumbsup: :sparkles:
:star: 313 | @samedy | http://www.freecodecamp.com/samedy
Majlind
@majlind
Jan 18 2016 04:40
thanks again @iRoachie That's clean, I see it now!
CamperBot
@camperbot
Jan 18 2016 04:40
majlind sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:warning: majlind already gave iroachie points
Majlind
@majlind
Jan 18 2016 04:40
@iRoachie I see your point :thumbsup:
Kyle Roach
@iRoachie
Jan 18 2016 04:40
@majlind Nice great that you got it :)
Majlind
@majlind
Jan 18 2016 04:40
Barbados! Nice man, I got you for thanks whenever I see you :thumbsup:
AndreLR
@AndreLR
Jan 18 2016 04:41
Says my p element should have the class red-text

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

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

Kyle Roach
@iRoachie
Jan 18 2016 04:41
Lol haha thanks
@AndreLR You just have to apply it to the p
<p class=“red-text”>
AndreLR
@AndreLR
Jan 18 2016 04:42
Ah, thanks bro!
Steven Leiva
@StevenXL
Jan 18 2016 04:42
Hello everyone.
I was wondering if I could get some help on the timestamp microserver.
I know the code I want to write, but not where to put it.
Should this go in a controller?
Justin Richardsson
@hallaathrad
Jan 18 2016 04:44
@StevenXL You should give the HelpBackEnd channel a visit, methinks
there could be more helpful responses there
Steven Leiva
@StevenXL
Jan 18 2016 04:44
@hallaathrad thank you - didn't know about that channel.
CamperBot
@camperbot
Jan 18 2016 04:44
stevenxl sends brownie points to @hallaathrad :sparkles: :thumbsup: :sparkles:
:star: 414 | @hallaathrad | http://www.freecodecamp.com/hallaathrad
Justin Richardsson
@hallaathrad
Jan 18 2016 04:44
@StevenXL mah pleasure
:+1:
chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 04:45
people how to test just js code ??
in the console of our browser ?
gittyplayer
@gittyplayer
Jan 18 2016 04:45
This message was deleted
Kyle Roach
@iRoachie
Jan 18 2016 04:48
@chaitanyaashtekar Yes you can! in the console
chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 04:48
@iRoachie elaborate pls ?
Kyle Roach
@iRoachie
Jan 18 2016 04:48
Right click on in a brower and inspect
chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 04:49
@iRoachie inspect element ?
Kyle Roach
@iRoachie
Jan 18 2016 04:49
@chaitanyaashtekar Yea, that should open your developer tools
chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 04:49
@iRoachie t
Kyle Roach
@iRoachie
Jan 18 2016 04:49
@chaitanyaashtekar You can look for the console tab now
chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 04:49
@iRoachie and then ??
Kyle Roach
@iRoachie
Jan 18 2016 04:50
@chaitanyaashtekar Click the console tab. You can type ur js in there
chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 04:50

@iRoachie suppose i want to run

var a = "Wind,Rain,Fire";
//var myVar1 = a.join();
var arr=a.split(",");
console.log(arr[0]);

how to do that ?

Kyle Roach
@iRoachie
Jan 18 2016 04:51
@chaitanyaashtekar You got the console window open? What browser are you using
chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 04:51
firefox
i have also installed firebug after reading it somewhere but idk what to do
Kyle Roach
@iRoachie
Jan 18 2016 04:52
can you see the console window?
chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 04:53
yes.should i start typing my code directly there ??
and how to run it ?
Kyle Roach
@iRoachie
Jan 18 2016 04:54
once you press enter
it’ll execute
chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 04:54
@iRoachie thanks . so i have to write my entire code in a single line??
CamperBot
@camperbot
Jan 18 2016 04:54
chaitanyaashtekar sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 284 | @iroachie | http://www.freecodecamp.com/iroachie
Kyle Roach
@iRoachie
Jan 18 2016 04:55
@chaitanyaashtekar Nah once you enter a semicolon(;) you can press enter
Charlie
@charliechazz
Jan 18 2016 04:56
hi how can I do these?

Commenting is a way that you can leave comments within your code without affecting the code itself.

Commenting is also a convenient way to make code inactive without having to delete it entirely.

You can start a comment with <!-- and end a comment with -->

Uncomment your h1, h2 and p elements.

chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 04:56
@iRoachie its not working.wait ill send screenshot
chriscchristensen
@chriscchristensen
Jan 18 2016 04:57

blob

What would be wrong with my code there?

Kyle Roach
@iRoachie
Jan 18 2016 04:57
@chaitanyaashtekar I just pasted your entire code into my console
chriscchristensen
@chriscchristensen
Jan 18 2016 04:57
This message was deleted
Kyle Roach
@iRoachie
Jan 18 2016 04:58
@chriscchristensen Hey you have to close the first tag
<script>
document stuff
</script>
chriscchristensen
@chriscchristensen
Jan 18 2016 04:59
@iRoachie I tried that. It says it completes the first tast but not the other two.
Kyle Roach
@iRoachie
Jan 18 2016 05:00
@chriscchristensen
<script>
  $(document).ready(function() {
  });
</script>
chriscchristensen
@chriscchristensen
Jan 18 2016 05:00
@iRoachie Sorry I was just leaving on the ">" at the end of the line there. That's why your suggestion that I had been trying wasn't working.
Christopher Carter
@c4304c
Jan 18 2016 05:00
do people recommend taking notes when doing the challenges
chriscchristensen
@chriscchristensen
Jan 18 2016 05:00
haha
chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 05:00
fcc5.png
chriscchristensen
@chriscchristensen
Jan 18 2016 05:00
@iRoachie sorry I am new.
Kyle Roach
@iRoachie
Jan 18 2016 05:01
@chriscchristensen It’s alright man, we’re all learning :)
chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 05:01
@iRoachie see the img.it works if i copy the entire code from somewhere.but how to code line by line in the console
?
Kyle Roach
@iRoachie
Jan 18 2016 05:01
@chaitanyaashtekar Hey idk, it didn’t happen for me in chrome
chaitanya ashtekar
@chaitanyaashtekar
Jan 18 2016 05:01
@iRoachie ok.ill try in chrome
thanks @iRoachie
CamperBot
@camperbot
Jan 18 2016 05:01
chaitanyaashtekar sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:warning: chaitanyaashtekar already gave iroachie points
Kyle Roach
@iRoachie
Jan 18 2016 05:02
Screen Shot 2016-01-18 at 1.01.49 AM.png
chriscchristensen
@chriscchristensen
Jan 18 2016 05:02
Thanks @iRoachie
CamperBot
@camperbot
Jan 18 2016 05:02
chriscchristensen sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 285 | @iroachie | http://www.freecodecamp.com/iroachie
Christopher Carter
@c4304c
Jan 18 2016 05:02
do people recommend taking notes dring challenges
Kyle Roach
@iRoachie
Jan 18 2016 05:02
@c4304c If it helps you. I learn from doing things multiple times, so notes don’t really help me
@c4304c If anything happens you can always go back to previous challenge, and it will be there in the correct state if you completed it
Christopher Carter
@c4304c
Jan 18 2016 05:03
how many times do you go through a challenge before moving on? @iRoachie
Kyle Roach
@iRoachie
Jan 18 2016 05:04
@c4304c just once
@c4304c But the challenges will bring back up old stuff, so you’ll get practice
Tafadzwa
@Tafea
Jan 18 2016 05:13
@c4304c if it helps you when you take notes, go ahead and jot down somethings you learn but not everything though
rohithitro
@rohithitro
Jan 18 2016 05:16
anybody else stuck on - Set the ID of an Element ?
Kyle Roach
@iRoachie
Jan 18 2016 05:17
@rohithitro What’s the problem exactly
ultramun
@ultramun
Jan 18 2016 05:21
hey guys need some help here, can you check what's wrong here:

<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;
}
.grey-background {
background-color: grey;
}
</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="grey-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 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>

rohithitro
@rohithitro
Jan 18 2016 05:22
do I create another h2 for id ?
<h2 class="red-text">CatPhotoApp</h2>
<h2 id= "cat-photo=app"></h2>
Kyle Roach
@iRoachie
Jan 18 2016 05:22
@ultramun what is it saying is the error
Izet
@chaidarizet
Jan 18 2016 05:22
anyone can help me again? :(
ultramun
@ultramun
Jan 18 2016 05:22
i need to do this: Give your div element the class gray-background.
Your div element should have a gray background.
Kyle Roach
@iRoachie
Jan 18 2016 05:22
@chaidarizet whats wrong
rohithitro
@rohithitro
Jan 18 2016 05:23
does the h2 id go under style or outside style ?
Kyle Roach
@iRoachie
Jan 18 2016 05:23
@ultramun CSS uses US spelling, so change grey to gray
Jonathan
@jonjitsu
Jan 18 2016 05:23
How long do our apps on heroku have to stay up? We aren't allowed an unlimited number of them. Eventually they'll have to be recycled.
Izet
@chaidarizet
Jan 18 2016 05:24
html.JPG
@iRoachie
ultramun
@ultramun
Jan 18 2016 05:24
@iRoachie thanks!!
CamperBot
@camperbot
Jan 18 2016 05:24
ultramun sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 287 | @iroachie | http://www.freecodecamp.com/iroachie
Kyle Roach
@iRoachie
Jan 18 2016 05:24
@chaidarizet firstly h1 isnt a class, so remove the .h1 it should just be h1
Izet
@chaidarizet
Jan 18 2016 05:25
@iRoachie ok then.
Kyle Roach
@iRoachie
Jan 18 2016 05:25
@iRoachie remove the h1 tag from inside the p
@chaidarizet The instructions asks to change the font size of the p to 16px
@chaidarizet So you need to add a definition in you style for p
Tafadzwa
@Tafea
Jan 18 2016 05:26
Put the class name for the p to change the style
.
Kyle Roach
@iRoachie
Jan 18 2016 05:27
@chaidarizet
<style>
p {
font-size: 16px;
}
</style>
Tafadzwa
@Tafea
Jan 18 2016 05:27
.red-text not .h1
Izet
@chaidarizet
Jan 18 2016 05:28
@iRoachie how to Give elements with the p tag a font-size of 16px
Kyle Roach
@iRoachie
Jan 18 2016 05:28
@chaidarizet
<style>
p {
font-size: 16px;
}
</style>
Izet
@chaidarizet
Jan 18 2016 05:29
omg just like that :'(
rohithitro
@rohithitro
Jan 18 2016 05:29
@iRoachie does the h2 id go under style or outside style ?
Izet
@chaidarizet
Jan 18 2016 05:29
@iRoachie thank you
CamperBot
@camperbot
Jan 18 2016 05:29
chaidarizet sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 288 | @iroachie | http://www.freecodecamp.com/iroachie
Kyle Roach
@iRoachie
Jan 18 2016 05:31
@rohithitro Hey they were only using that h2 as an example. We have to add the id to the <form> tag
xgumball
@xgumball
Jan 18 2016 05:31

Assignment with a Returned Value
If you'll recall from our discussion of Storing Values with the Equal Operator, everything to the right of the equal sign is resolved before the value is assigned. This means we can take the return value of a function and assign it to a variable.

Assume we have pre-defined a function sum which adds two numbers together, then:

ourSum = sum(5, 12);

will call sum function, which returns a value of 17 and assigns it to ourSum variable.

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

Run tests (ctrl + enter)
Reset Help Bug

processed = 2

processed should have a value of 2
You should assign process to processed

how??
Kyle Roach
@iRoachie
Jan 18 2016 05:31
@xgumball var processed = process()
@xgumball you’ll have to figure out what number to put as an argument
xgumball
@xgumball
Jan 18 2016 05:33
@iRoachie omg thanks you :)
CamperBot
@camperbot
Jan 18 2016 05:33
xgumball sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 290 | @iroachie | http://www.freecodecamp.com/iroachie
rohithitro
@rohithitro
Jan 18 2016 05:35

@iRoachie before

<form action="/submit-cat-photo">
after

<form id="cat-photo-app" action="/submit-cat-photo">

Kyle Roach
@iRoachie
Jan 18 2016 05:36
@rohithitro Order doesn’t matter
ultramun
@ultramun
Jan 18 2016 05:46
<form id="cat-photo-app"> is this correct?
Kyle Roach
@iRoachie
Jan 18 2016 05:49
@ultramun Yea that should be it
ultramun
@ultramun
Jan 18 2016 05:51
@iRoachie can't run test
Kyle Roach
@iRoachie
Jan 18 2016 05:51
@ultramun Paste your url here so i can see
Christopher Carter
@c4304c
Jan 18 2016 05:51
having trouble getting an html style element without inline style
ultramun
@ultramun
Jan 18 2016 05:52
@iRoachie http://www.freecodecamp.com/challenges/set-the-id-of-an-element#?solution=%3Clink%20href%3D%22http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DLobster%22%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%3E%0A%3Cstyle%3E%0A%20%20.red-text%20%7B%0A%20%20%20%20color%3A%20red%3B%0A%20%20%7D%0A%0A%20%20h2%20%7B%0A%20%20%20%20font-family%3A%20Lobster%2C%20Monospace%3B%0A%20%20%7D%0A%0A%20%20p%20%7B%0A%20%20%20%20font-size%3A%2016px%3B%0A%20%20%20%20font-family%3A%20Monospace%3B%0A%20%20%7D%0A%0A%20%20.thick-green-border%20%7B%0A%20%20%20%20border-color%3A%20green%3B%0A%20%20%20%20border-width%3A%2010px%3B%0A%20%20%20%20border-style%3A%20solid%3B%0A%20%20%20%20border-radius%3A%2050%25%3B%0A%20%20%7D%0A%0A%20%20.smaller-image%20%7B%0A%20%20%20%20width%3A%20100px%3B%0A%20%20%7D%0A%20%20.gray-background%20%7B%0A%20%20%20%20background-color%3A%20gray%3B%0A%20%20%7D%0A%3C%2Fstyle%3E%0A%0A%3Ch2%20class%3D%22red-text%22%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%3Cp%3EClick%20here%20for%20%3Ca%20href%3D%22%23%22%3Ecat%20photos%3C%2Fa%3E.%3C%2Fp%3E%0A%0A%3Ca%20href%3D%22%23%22%3E%3Cimg%20class%3D%22smaller-image%20thick-green-border%22%20alt%3D%22A%20cute%20orange%20cat%20lying%20on%20its%20back%22%20src%3D%22https%3A%2F%2Fbit.ly%2Ffcc-relaxing-cat%22%3E%3C%2Fa%3E%0A%0A%3Cdiv%20class%3D%22gray-background%22%3E%0A%20%20%3Cp%3EThings%20cats%20love%3A%3C%2Fp%3E%0A%20%20%3Cul%3E%0A%20%20%20%20%3Cli%3Ecat%20nip%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Elaser%20pointers%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Elasagna%3C%2Fli%3E%0A%20%20%3C%2Ful%3E%0A%20%20%3Cp%3ETop%203%20things%20cats%20hate%3A%3C%2Fp%3E%0A%20%20%3Col%3E%0A%20%20%20%20%3Cli%3Eflea%20treatment%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Ethunder%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Eother%20cats%3C%2Fli%3E%0A%20%20%3C%2Fol%3E%0A%3C%2Fdiv%3E%0A%0A%3Cform%20id%3D%22cat-photo-app%22%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%20checked%3E%20Indoor%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%3E%20Outdoor%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%20checked%3E%20Loving%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Lazy%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Energetic%3C%2Flabel%3E%0A%20%20%3Cinput%20type%3D%22text%22%20placeholder%3D%22cat%20photo%20URL%22%20required%3E%0A%20%20%3Cbutton%20type%3D%22submit%22%3ESubmit%3C%2Fbutton%3E%0A%3C%2Fform%3E%0A
Kyle Roach
@iRoachie
Jan 18 2016 05:52
@c4304c What’s the actual problem
Christopher Carter
@c4304c
Jan 18 2016 05:53
changing texxt color in html with class not css
Kyle Roach
@iRoachie
Jan 18 2016 05:53
@ultramun Hey you added the wrong id. It’s “cat-photo-form"
Christopher Carter
@c4304c
Jan 18 2016 05:53

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

<h2>CatPhotoApp</h2>

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

ultramun
@ultramun
Jan 18 2016 05:54
@iRoachie lol my badd thanks
CamperBot
@camperbot
Jan 18 2016 05:54
ultramun sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:warning: ultramun already gave iroachie points
Kyle Roach
@iRoachie
Jan 18 2016 05:55
@c4304c Okay it wants you to use a class instead. So we need to define one.
<style>
.red-text {
color:red;
}
</style>

<h2 class=“red-text”>
Christopher Carter
@c4304c
Jan 18 2016 05:57
its not running css though
Kyle Roach
@iRoachie
Jan 18 2016 05:59
@c4304c paste your url here so i can see where you are going wrong

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

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

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

ultramun
@ultramun
Jan 18 2016 06:01
here http://www.freecodecamp.com/challenges/use-an-id-attribute-to-style-an-element#?solution=%3Clink%20href%3D%22http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DLobster%22%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%3E%0A%3Cstyle%3E%0A%20%20.red-text%20%7B%0A%20%20%20%20color%3A%20red%3B%0A%20%20%7D%0A%0A%20%20h2%20%7B%0A%20%20%20%20font-family%3A%20Lobster%2C%20Monospace%3B%0A%20%20%7D%0A%0A%20%20p%20%7B%0A%20%20%20%20font-size%3A%2016px%3B%0A%20%20%20%20font-family%3A%20Monospace%3B%0A%20%20%7D%0A%0A%20%20.thick-green-border%20%7B%0A%20%20%20%20border-color%3A%20green%3B%0A%20%20%20%20border-width%3A%2010px%3B%0A%20%20%20%20border-style%3A%20solid%3B%0A%20%20%20%20border-radius%3A%2050%25%3B%0A%20%20%7D%0A%0A%20%20.smaller-image%20%7B%0A%20%20%20%20width%3A%20100px%3B%0A%20%20%7D%0A%0A%20%20.gray-background%20%7B%0A%20%20%20%20background-color%3A%20gray%3B%0A%20%20%7D%0A%20%20%23cat-photo-element%20%7B%0A%20%20background-color%3A%20green%3B%0A%7D%0A%3C%2Fstyle%3E%0A%0A%3Ch2%20class%3D%22red-text%22%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%3Cp%3EClick%20here%20for%20%3Ca%20href%3D%22%23%22%3Ecat%20photos%3C%2Fa%3E.%3C%2Fp%3E%0A%0A%3Ca%20href%3D%22%23%22%3E%3Cimg%20class%3D%22smaller-image%20thick-green-border%22%20alt%3D%22A%20cute%20orange%20cat%20lying%20on%20its%20back%22%20src%3D%22https%3A%2F%2Fbit.ly%2Ffcc-relaxing-cat%22%3E%3C%2Fa%3E%0A%0A%3Cdiv%20class%3D%22gray-background%22%3E%0A%20%20%3Cp%3EThings%20cats%20love%3A%3C%2Fp%3E%0A%20%20%3Cul%3E%0A%20%20%20%20%3Cli%3Ecat%20nip%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Elaser%20pointers%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Elasagna%3C%2Fli%3E%0A%20%20%3C%2Ful%3E%0A%20%20%3Cp%3ETop%203%20things%20cats%20hate%3A%3C%2Fp%3E%0A%20%20%3Col%3E%0A%20%20%20%20%3Cli%3Eflea%20treatment%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Ethunder%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Eother%20cats%3C%2Fli%3E%0A%20%20%3C%2Fol%3E%0A%3C%2Fdiv%3E%0A%0A%3Cform%20fccfaa%3D%22%2Fsubmit-cat-photo%22%20id%3D%22cat-photo-form%22%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%20checked%3E%20Indoor%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%3E%20Outdoor%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%20checked%3E%20Loving%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Lazy%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Energetic%3C%2Flabel%3E%0A%20%20%3Cinput%20type%3D%22text%22%20placeholder%3D%22cat%20photo%20URL%22%20required%3E%0A%20%20%3Cbutton%20type%3D%22submit%22%3ESubmit%3C%2Fbutton%3E%0A%3C%2Fform%3E%0A
rohithitro
@rohithitro
Jan 18 2016 06:02
@iRoachie http://www.freecodecamp.com/challenges/set-the-id-of-an-element#?solution=%3Clink%20href%3D%22http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DLobster%22%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%3E%0A%3Cstyle%3E%0A%20%20.red-text%20%7B%0A%20%20%20%20color%3A%20red%3B%0A%20%20%7D%0A%0A%20%20h2%20%7B%0A%20%20%20%20font-family%3A%20Lobster%2C%20Monospace%3B%0A%20%20%7D%0A%0A%20%20p%20%7B%0A%20%20%20%20font-size%3A%2016px%3B%0A%20%20%20%20font-family%3A%20Monospace%3B%0A%20%20%7D%0A%0A%20%20.thick-green-border%20%7B%0A%20%20%20%20border-color%3A%20green%3B%0A%20%20%20%20border-width%3A%2010px%3B%0A%20%20%20%20border-style%3A%20solid%3B%0A%20%20%20%20border-radius%3A%2050%25%3B%0A%20%20%7D%0A%0A%20%20.smaller-image%20%7B%0A%20%20%20%20width%3A%20100px%3B%0A%20%20%7D%0A%20%20.gray-background%20%7B%0A%20%20%20%20background-color%3A%20gray%3B%0A%20%20%7D%0A%3C%2Fstyle%3E%0A%0A%3Ch2%20class%3D%22red-text%22%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%3Cp%3EClick%20here%20for%20%3Ca%20href%3D%22%23%22%3Ecat%20photos%3C%2Fa%3E.%3C%2Fp%3E%0A%0A%3Ca%20href%3D%22%23%22%3E%3Cimg%20class%3D%22smaller-image%20thick-green-border%22%20alt%3D%22A%20cute%20orange%20cat%20lying%20on%20its%20back%22%20src%3D%22https%3A%2F%2Fbit.ly%2Ffcc-relaxing-cat%22%3E%3C%2Fa%3E%0A%0A%3Cdiv%20class%3D%22gray-background%22%3E%0A%20%20%3Cp%3EThings%20cats%20love%3A%3C%2Fp%3E%0A%20%20%3Cul%3E%0A%20%20%20%20%3Cli%3Ecat%20nip%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Elaser%20pointers%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Elasagna%3C%2Fli%3E%0A%20%20%3C%2Ful%3E%0A%20%20%3Cp%3ETop%203%20things%20cats%20hate%3A%3C%2Fp%3E%0A%20%20%3Col%3E%0A%20%20%20%20%3Cli%3Eflea%20treatment%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Ethunder%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Eother%20cats%3C%2Fli%3E%0A%20%20%3C%2Fol%3E%0A%3C%2Fdiv%3E%0A%0A%3Cform%20fccfaa%3D%22%2Fsubmit-cat-photo%22%3E%0A%3Cform%20id%3D%22cat-photo-app%22%3E%20%20%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%20checked%3E%20Indoor%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%3E%20Outdoor%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%20checked%3E%20Loving%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Lazy%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Energetic%3C%2Flabel%3E%0A%20%20%3Cinput%20type%3D%22text%22%20placeholder%3D%22cat%20photo%20URL%22%20required%3E%0A%20%20%3Cbutton%20type%3D%22submit%22%3ESubmit%3C%2Fbutton%3E%0A%3C%2Fform%3E%0A

i did add <form action="/submit-cat-photo">

<form id="cat-photo-app"> ---this new id here but wont work

Kyle Roach
@iRoachie
Jan 18 2016 06:03
@c4304c Hey it’s jsut a syntax error, change the “ to "
rohithitro
@rohithitro
Jan 18 2016 06:04
@ultramun where did u add the form id ?
Kyle Roach
@iRoachie
Jan 18 2016 06:05
@ultramun Your id the style is suppose to be cat-photo-form not cat-photo-element
@rohithitro Hey you have 2 form tags. The action and the id can go on the same form
<form action="/submit-cat-photo" id="cat-photo-form">
rohithitro
@rohithitro
Jan 18 2016 06:12
thanks @iRoachie how do i give those points to you
CamperBot
@camperbot
Jan 18 2016 06:12
rohithitro sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 296 | @iroachie | http://www.freecodecamp.com/iroachie
Kyle Roach
@iRoachie
Jan 18 2016 06:12
@rohithitro Ha just by saying thanks :P
CamperBot
@camperbot
Jan 18 2016 06:12
iroachie sends brownie points to @rohithitro :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for rohithitro
rohithitro
@rohithitro
Jan 18 2016 06:16
@iRoachie thanks
CamperBot
@camperbot
Jan 18 2016 06:16
rohithitro sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:warning: rohithitro already gave iroachie points
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 06:16
This message was deleted
ultramun
@ultramun
Jan 18 2016 06:18
@iRoachie thank u. I always confused by that terms. What is the difference between form and element?
CamperBot
@camperbot
Jan 18 2016 06:18
ultramun sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:warning: ultramun already gave iroachie points
Kyle Roach
@iRoachie
Jan 18 2016 06:19
@ultramun A form is a type of element. Think of element as a tag. html, body, p, form are all tags/elements
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 06:21

var temp = args.delete(args[0]);

I know this isn't the correct syntax, but is there a way to make 'temp' equal to everything in args except for args[0]? I'd like for the indexes to fix themselves, so args1 would be the new temp[0]

Kyle Roach
@iRoachie
Jan 18 2016 06:22
@CodingDucky if args is an array you can use shift() which removes the 0 index of an array
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 06:25
thanks @iRoachie
CamperBot
@camperbot
Jan 18 2016 06:25
codingducky sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 298 | @iroachie | http://www.freecodecamp.com/iroachie
Christopher Carter
@c4304c
Jan 18 2016 06:33
im not getting it at all im about to call it a night and figure it out in the morning
goodnight
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 06:34
gnight
Lekecia Entrot
@GurlFriday88
Jan 18 2016 06:37
I think i need some help, I am trying to size an image to fit the width of my screen using the img-responsive class. I have the style set with margins with the left and right set at -20px but Its not running. I am not sure what i am doing wrong. Any assistance would help. Thank you.
Izet
@chaidarizet
Jan 18 2016 06:38
help me again please somebody
CamperBot
@camperbot
Jan 18 2016 06:38
no wiki entry for: me again please somebody
Markus Kiili
@Masd925
Jan 18 2016 06:38
@iRoachie The shift method doesn't remove the 0 index of an array. The shift method removes the element at the zeroeth index and shifts the values at consecutive indexes down. delete(args[ 0 ]) would remove the 0 index from an array, but you rarely wan't to do that.
Ranjith Kumar Yadav Cheguri
@theeverindian
Jan 18 2016 06:38
@chaidarizet waypoint ?
CiJ Ramos-Engracia
@Cijore
Jan 18 2016 06:40
help pls, i need to create a form element... how do I nest the text element within a form element?
CamperBot
@camperbot
Jan 18 2016 06:40
no wiki entry for: pls i need to create a form element how do i nest the text element within a form element
Izet
@chaidarizet
Jan 18 2016 06:40
@theeverindian i have problem "Nest the existing img element within an a element."
1.JPG
Kyle Roach
@iRoachie
Jan 18 2016 06:40
This message was deleted
@Masd925 This is what he asked for
Lekecia Entrot
@GurlFriday88
Jan 18 2016 06:41
@Cijore <form action="/submit-cat-photo">
Kyle Roach
@iRoachie
Jan 18 2016 06:41
@Masd925 he wanted the item at [1] to shift to [0] after removing the first index
Markus Kiili
@Masd925
Jan 18 2016 06:42
@iRoachie Not removing the first index, but removing the value from first index. There is a difference. Arrays are objects.
CiJ Ramos-Engracia
@Cijore
Jan 18 2016 06:42
@Acuyan88 yes i typed that but it didn't work.
Kyle Roach
@iRoachie
Jan 18 2016 06:43

Read what he asked

var temp = args.delete(args[0]);

I know this isn't the correct syntax, but is there a way to make 'temp' equal to everything in args except for args[0]? I'd like for the indexes to fix themselves, so args1 would be the new temp[0]

This message was deleted
Ranjith Kumar Yadav Cheguri
@theeverindian
Jan 18 2016 06:44
@chaidarizet waypoint name please, so that it would be clear for me to understand instructions
Kyle Roach
@iRoachie
Jan 18 2016 06:44
@Masd925 arrays are not objects btw, arrays and objects are two different structures
Markus Kiili
@Masd925
Jan 18 2016 06:44
@iRoachie Arrays definitely are objects in JS.
Kyle Roach
@iRoachie
Jan 18 2016 06:45
@Masd925 Everything is an object by that definition
Markus Kiili
@Masd925
Jan 18 2016 06:45
@iRoachie No, everything is not an object in JS.
Kyle Roach
@iRoachie
Jan 18 2016 06:45
DId you read what the guy asked ?
Nick Robson
@nickrobson
Jan 18 2016 06:46
@iRoachie @Masd925 Everything in JS is an object except for primitives, nulls, and strings.
Lekecia Entrot
@GurlFriday88
Jan 18 2016 06:46
@Cijore when you hit run it doesnt do anything?
did you close the form with </form>?
Markus Kiili
@Masd925
Jan 18 2016 06:46
@iRoachie No. I commented about you saying that shift removes the first index. That is bad terminology.
Nick Robson
@nickrobson
Jan 18 2016 06:47
An object is something that can possess more properties than just a value, and since those three types I mentioned can't do that, they're not objects.
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 06:47
So I wrote code to solve this problem:
You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.
Izet
@chaidarizet
Jan 18 2016 06:47
1.JPG
@theeverindian
Ranjith Kumar Yadav Cheguri
@theeverindian
Jan 18 2016 06:47
@chaidarizet way point name ???
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 06:47
function destroyer(arr) {
  //args is the subset
  //temp is the stuff we want to filter out
  //newArr is the set to assign the new stuff to
  var args = [];
  var newArr = [];
  for (var i = 0; i < arguments.length; i++){
    args[i] = arguments[i];
  }
  var temp = args.slice(1);

  args.splice(1);

  for (var p = 0; p < temp.length; p++) {
    if (args.indexOf(temp[p]) >= 0) {
      newArr.push(temp[p]);
    }
  }
  return newArr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Doesn't work. Why?
Izet
@chaidarizet
Jan 18 2016 06:47
1.1.png
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 06:48

Task is here:

You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.

Izet
@chaidarizet
Jan 18 2016 06:48
@theeverindian im sorry
CiJ Ramos-Engracia
@Cijore
Jan 18 2016 06:48
@Acuyan88 it didn't do anything, yes I closed the form. the only thing not working is the to nest the text input element within a form element.
Nick Robson
@nickrobson
Jan 18 2016 06:48
@CodingDucky [aside]: You should use args.push(arguments[i]) instead of args[i] = arguments[i]
Kyle Roach
@iRoachie
Jan 18 2016 06:48
@Masd925 If you want to get technical, an index is actually a pointer to a position in the array in memory so removing the index is removing the pointer to the object thus deleting it. That’s computer architecture right there
@Masd925 Same applies to all lists
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 06:49
@nickrobson Done that, what's my next screwup?
Nick Robson
@nickrobson
Jan 18 2016 06:49
@CodingDucky Use for (var i = 1; i < arguments.length; i++) as well, since that will automatically ignore the first element.
(note the i=1)
Ranjith Kumar Yadav Cheguri
@theeverindian
Jan 18 2016 06:50
<h2 class="red-text">CatPhotoApp</h2>
<a href="#">
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
</a>
<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>
@chaidarizet this should work.
Nick Robson
@nickrobson
Jan 18 2016 06:50
You could do this very simply as well, using Array#filter.
Izet
@chaidarizet
Jan 18 2016 06:50
@theeverindian thanks
CamperBot
@camperbot
Jan 18 2016 06:50
chaidarizet sends brownie points to @theeverindian :sparkles: :thumbsup: :sparkles:
:star: 298 | @theeverindian | http://www.freecodecamp.com/theeverindian
Nick Robson
@nickrobson
Jan 18 2016 06:51
var args = [];
for (var i = 1; i < arguments.length; i++)
    args.push(arguments[i]);
return arguments[0].filter(a => args.indexOf(a) === -1);
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 06:51
thanks @nickrobson
CamperBot
@camperbot
Jan 18 2016 06:51
codingducky sends brownie points to @nickrobson :sparkles: :thumbsup: :sparkles:
:warning: codingducky already gave nickrobson points
Nick Robson
@nickrobson
Jan 18 2016 06:52
@CodingDucky npnp
Benji
@benjifriedman
Jan 18 2016 06:53
can someone tell me what's wrong with this?
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 06:53
Wait. If I use your for (var i = 1; i < arguments.length; i++) then my var temp = args.slice(1); stops working @nickrobson
Benji
@benjifriedman
Jan 18 2016 06:53
Screen Shot 2016-01-17 at 10.53.10 PM.jpg
I haven't used case, switch, or if statements
and I don't know how to make it return "undefined"
this is the "Using Objects for Lookups" level
Nick Robson
@nickrobson
Jan 18 2016 06:56
@CodingDucky Yeah, you don't need that then.
args.slice(1) has the same effect as what I mentioned doing.
Katz
@katzabcd
Jan 18 2016 06:57
@benjifriedman you got to set the table as a var
Benji
@benjifriedman
Jan 18 2016 06:57
how so
Ray LeDuc
@MrRSLeduc
Jan 18 2016 06:57

Hey guys while were having a discussion on arrays I'm also having issues with them in particular the "Stand in Line" challenge my code is as follows:

function queue(arr, item) {
  // Your code here
  arr.push(item);
  var removed = arr.shift();
  return removed;  // Change this line
}
// Test Setup
var testArr = [1,2,3,4,5];

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

But I'm getting an error of Maximum call stack size exceeded.

Jose Dzireh Chong
@CodingDucky
Jan 18 2016 06:57
@nickrobson Can you explain why your code would nullify the need of temp?
Katz
@katzabcd
Jan 18 2016 06:57
var lookup = {}
var lookup = {
alpha:"Adams",
bravo:"Boston",
charlie:"Chicago",
delta:"Denver",
echo:"Easy",
foxtrot:"Frank",
};
some thing like that
Benji
@benjifriedman
Jan 18 2016 06:58
Screen Shot 2016-01-17 at 10.58.27 PM.jpg
it has to be the word "lookup"?
still doesn't work though
Katz
@katzabcd
Jan 18 2016 06:59
there is one more line of code you need to input
Markus Kiili
@Masd925
Jan 18 2016 06:59
@iRoachie In JS arrays are objects and the indices are actually object keys (strings). Small enough numeric keys are considered array keys and their values are considered array values. That is how ecmascript puts it. Different story is how browsers actually implement arrays.
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 06:59
function destroyer(arr) {
  //args is the subset
  //temp is the stuff we want to filter out
  //newArr is the set to assign the new stuff to
  var args = [];
  var newArr = [];
  for (var i = 0; i < arguments.length; i++){
    args.push(arguments[i]);
  }
  var temp = args.slice(1);
  args.splice(1);

  for (var p = 0; p < temp.length; p++) {
    if (args.indexOf(temp[p]) >= 0) {
      newArr.push(temp[p]);
    }
  }
  return newArr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
I just wanna understand why my code doesn't work
Here's the task:
You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.
Benji
@benjifriedman
Jan 18 2016 07:00
what's the additional line @katzabcd?
Katz
@katzabcd
Jan 18 2016 07:00
@benjifriedman add this line result = lookup[val];
Kyle Roach
@iRoachie
Jan 18 2016 07:00
@Masd925 By that terminology i should be able to call the methods of the Array.prototype on any object then...
Markus Kiili
@Masd925
Jan 18 2016 07:01
@iRoachie No,arrays are objects but all objects are not arrays.
Benji
@benjifriedman
Jan 18 2016 07:01
Screen Shot 2016-01-17 at 11.01.35 PM.jpg
still not it
and I guess there's errors on lines 6 -- 9
?
Kyle Roach
@iRoachie
Jan 18 2016 07:02
@Masd925 That isn’t valid, cause then i should be able to call all these Object methods on an array
Katz
@katzabcd
Jan 18 2016 07:03
@benjifriedman add an = after lookup

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

result = lookup[val];

it should look like this
Benji
@benjifriedman
Jan 18 2016 07:04
oh wow
yep, that was it
thank you @katzabcd
CamperBot
@camperbot
Jan 18 2016 07:04
benjifriedman sends brownie points to @katzabcd :sparkles: :thumbsup: :sparkles:
:star: 225 | @katzabcd | http://www.freecodecamp.com/katzabcd
Benji
@benjifriedman
Jan 18 2016 07:04
little things
just an equals sign
Katz
@katzabcd
Jan 18 2016 07:05
It's always the small things that break the code @benjifriedman
Ray LeDuc
@MrRSLeduc
Jan 18 2016 07:05
Hey guys doing the Stand in Line challenge and I
Benji
@benjifriedman
Jan 18 2016 07:05
totally
d wilder
@alhazen1
Jan 18 2016 07:05
@CodingDucky Not sure but I do see on MDN that there is an easier way to get your args (and they suggested not slicing arguments). var args = Array.prototype.slice.call(arguments);
Ray LeDuc
@MrRSLeduc
Jan 18 2016 07:06
i'm getting a maximum call stack exceeded here is my code
function queue(arr, item) {
  // Your code here
  arr.push(item);
  var removed = arr.shift();
  return removed;  // Change this line
}
// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(queue(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
Katz
@katzabcd
Jan 18 2016 07:08
@MrRSLeduc you got to change all the testArr to arr
Markus Kiili
@Masd925
Jan 18 2016 07:08
@iRoachie Objects don't inherit methods and properties from Object constructor. They inherit them from Object.prototype. https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/prototype
Zohair Akhtar
@zohairakhtar
Jan 18 2016 07:08
whats wrong with having testArr there
d wilder
@alhazen1
Jan 18 2016 07:09
@katzabcd parameter and argument shouldn't need to be named the same
Kyle Roach
@iRoachie
Jan 18 2016 07:09
@Masd925 We could go on and on. The point is that Arrays and Objects are accessed differently and that was the point the guy asked in the first place
Zohair Akhtar
@zohairakhtar
Jan 18 2016 07:09
@katzabcd whats wrong with having an testArr there
Kyle Roach
@iRoachie
Jan 18 2016 07:10
@MrRSLeduc return arr.shift()
kirbyedy
@kirbyedy
Jan 18 2016 07:10
@MrRSLeduc this line is wrong var removed = arr.shift();
Piyush Danej
@piyushdanej
Jan 18 2016 07:10
Hi guys !
I need to signup on codepen , but I am not able to pull my github profle .
Zohair Akhtar
@zohairakhtar
Jan 18 2016 07:11
@piyushdanej hello there
Piyush Danej
@piyushdanej
Jan 18 2016 07:11
hey @zohairakhtar
there is no button to get my git hub info on the sign up page
Katz
@katzabcd
Jan 18 2016 07:12
@zohairakhtar not sure but that's what I did
Markus Kiili
@Masd925
Jan 18 2016 07:13
@iRoachie They are accessed the same way, because arrays are objects. Numeric keys are just considered array indices. JS arrays differ from arrays in many other languages because of that.
But yes, we can finish this debate.
Bon
@OriBon
Jan 18 2016 07:16
It's not really a debate. It's more of an incorrect opinion vs fact. Javascript arrays are objects. This is already defined in Javascript literature.
Kyle Roach
@iRoachie
Jan 18 2016 07:16
@OriBon We already know this… please see the original question
Bon
@OriBon
Jan 18 2016 07:18
@iRoachie I did see the original question. I was commenting on the most recent statements.
Ray LeDuc
@MrRSLeduc
Jan 18 2016 07:18
@kirbyedy can you explain why that line is wrong, please?
druchip
@druchip
Jan 18 2016 07:19

<'''function myFunction() {
var myVar = 'why i can\'t pass';

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

// run and check the console
// myVar is not defined outside of myFunction

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

CamperBot
@camperbot
Jan 18 2016 07:19
:bulb: to format code use backticks! ``` more info
druchip
@druchip
Jan 18 2016 07:19
help meeee
CamperBot
@camperbot
Jan 18 2016 07:19
no wiki entry for: meeee
druchip
@druchip
Jan 18 2016 07:20

function myFunction() {
var myVar = 'why i can\'t pass';

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

// run and check the console
// myVar is not defined outside of myFunction

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

anyone can tell me: what i must do ?
Markus Kiili
@Masd925
Jan 18 2016 07:22
@druchip Try to completely remove the console.log lines.
kirbyedy
@kirbyedy
Jan 18 2016 07:22
@MrRSLeduc don't need the var in front of the removed
Yasin Yusuf
@YasinYA
Jan 18 2016 07:23
hi guys
druchip
@druchip
Jan 18 2016 07:23
Masd : it say : No global myVar variable
and : console.log never called @@
Markus Kiili
@Masd925
Jan 18 2016 07:24
@druchip Could you post the problem name.
Chuck Wongus
@YesImChuck
Jan 18 2016 07:25

@YesImChuck
Hello. Me again. I feel like I'm asking too much help. I might not be picking up JS as well as I thought. I am trying to use the .map method to add 3 to each element of this array. What am I doing wrong?

var oldArray = [1,2,3,4,5];
var newArray = [];

// Only change code below this line.

var plusThree = oldArray.map(function(val){
return val + 3;
});

WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:25
If I want to update the text contents in a <span> wouldn't this work? $("#break-duration").html = "06";
 $("#break-plus").click(function(){
    $("#break-duration").html = "06";
  });
Bon
@OriBon
Jan 18 2016 07:28
@WebCodeNinja the string has to be in parenthesis. $("#break-duration").html("06");
WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:29
@OriBon I just tried that...It still doesn't work.
It should fire when I click the button with the ID = "break-duration" but it doesn't work
Chuck Wongus
@YesImChuck
Jan 18 2016 07:31
Anyone able to assist with my JS question?
Chris Neal
@chrisvneal
Jan 18 2016 07:31
@OriBon try
Try dot text
.text("06")
Markus Kiili
@Masd925
Jan 18 2016 07:32
@YesImChuck plusThree holds the new array with incremented elements.
Problem might wan't it on some other variable?
druchip
@druchip
Jan 18 2016 07:33

@Masd925 : original ->
```js function myFunction() {
'use strict';

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

Markus Kiili
@Masd925
Jan 18 2016 07:33
@druchip what is the problem name?
druchip
@druchip
Jan 18 2016 07:34
Instructions say:
Declare a local variable myVar inside myFunction
my code:

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

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

// run and check the console
// myVar is not defined outside of myFunction
// i'm delette this :console.log(myVar);

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

WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:35
@chrisvneal nope .text doesn't work either. It acts like the click event listener isn't working. It is in my document ready function so it isn't like it is trying to run before the page is rendered or anything. I have double checked spelling of the id in the HTML it just doesn't fire. This is very frustrating
@druchip if you use var inside of a function it is created as a local variable. If you omit the var it will create a global variable. So try myVar = 'use strict';
h4r1m4u
@h4r1m4u
Jan 18 2016 07:37
@WebCodeNinja do you have it in codepen?
Chris Neal
@chrisvneal
Jan 18 2016 07:38
@OriBon hmmm. Try to comment out the html line and try to trigger a simple alert message. If the alert doesn't fire, check if you have jquery "hooked up" to the document
WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:38
@h4r1m4u yes...want the link?
druchip
@druchip
Jan 18 2016 07:38
the err say: x Add a local myVar variable
h4r1m4u
@h4r1m4u
Jan 18 2016 07:38
@WebCodeNinja yes please. if you still need help :)
WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:39
I'm just getting started, I have the HTML and CSS mostly done, but the JS is just beginning.
http://codepen.io/WebCodeNinja/pen/jWGLLd
druchip
@druchip
Jan 18 2016 07:39
@WebCodeNinja : (x) Add a local myVar variable
@WebCodeNinja : (x) no glabal myvar variable
WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:40
@druchip what waypoint are you on?
h4r1m4u
@h4r1m4u
Jan 18 2016 07:40
@WebCodeNinja ok, two issues:
1) var displaySeconds = docuemnt.getElementById("display-secconds"); notice the typo here - docuemnt.
2) $("#break-duration").text = ("06"); is not the way the .text() method is used. this is the right way: $("#break-duration").text("06");
WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:41
@OriBon alert doesn't work either, and JQuery is hooked up
h4r1m4u
@h4r1m4u
Jan 18 2016 07:41
fix these and you're golden
WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:41
@h4r1m4u I'll try that
Markus Kiili
@Masd925
Jan 18 2016 07:42
@druchip Don't touch the 'use strict'; line. Declare your variable. Remove all console.log lines. Post the code again.
druchip
@druchip
Jan 18 2016 07:44
@WebCodeNinja
i've passed

function myFunction() {

var myVar = "use trick2";
yourVal = "you pass";
console.log(myVar);
}
myFunction();

// run and check the console
// myVar is not defined outside of myFunction
// i'm delette this :console.log(myVar);

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

i must have : var myVar :) and yourVar (global)
:D
WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:45
@h4r1m4u wow! I can't believe that typo was the issue. With the typo in the variable declaration line the event listener wouldn't fire at all. I had tried several variations of .text .html and .innerHTML and even an alert() to see if the event was firing, it wasn't. Obviously the .text was messed up too but I can't believe that a typo in the completely unrelated variable declaration stopped the whole thing...
@druchip glad to hear it!
Thanks to you both @h4r1m4u @OriBon
CamperBot
@camperbot
Jan 18 2016 07:45
webcodeninja sends brownie points to @h4r1m4u and @oribon :sparkles: :thumbsup: :sparkles:
:star: 524 | @oribon | http://www.freecodecamp.com/oribon
:star: 1324 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
druchip
@druchip
Jan 18 2016 07:45
thank :P
h4r1m4u
@h4r1m4u
Jan 18 2016 07:45
@WebCodeNinja yeah, the error breaks the code execution so whatever came after that wouldn't run
WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:46
so touchy this JS is...
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 07:46
@alhazen1 Can you break down Array.prototype.slice.call(arguments);? As in, what prototype does, what slice does and what call does.
h4r1m4u
@h4r1m4u
Jan 18 2016 07:47

btw, since you're using jquery already, you could simplify those initial var declarations:

var breakDuration = document.getElementById("break-duration"); // original
var breakDuration = $("#break-duration"); // instead

@WebCodeNinja

WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:49
@h4r1m4u that is great. I'm just dabbling in JQuery but I will definitely change that. Thanks again
CamperBot
@camperbot
Jan 18 2016 07:49
webcodeninja sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: webcodeninja already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Jan 18 2016 07:50
@WebCodeNinja my pleasure. the additional advantage of doing it as i suggest above is that you'll be able to use all the jQuery methods on these variables (since they'll be a jQuery object)
druchip
@druchip
Jan 18 2016 07:50
code here
WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:50
@h4r1m4u very nice
druchip
@druchip
Jan 18 2016 07:51
how to sent brownie point ?
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 07:54
Type 'thanks @personyouwanttothank'
Markus Kiili
@Masd925
Jan 18 2016 07:54
@CodingDucky Array.prototype.slice is the array slice method. Call method calls slice on arguments object. It works because with call, you can call array methods on array like objects (like arguments, strings and nodelists). It returns an array with the arguments as elements. About the same as:
CamperBot
@camperbot
Jan 18 2016 07:54
codingducky sends brownie points to @personyouwanttothank :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for personyouwanttothank
Markus Kiili
@Masd925
Jan 18 2016 07:54
var args = [];
  for (var i=0; i<arguments.length; i++) args[i]=arguments[i];
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 07:54
@druchip try it on me to check if it will work
I usually just use array.slice(). Is that bad?
Markus Kiili
@Masd925
Jan 18 2016 07:55
@CodingDucky The difference is that browsers can optimize the loop code better that the slice code.
WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:55
@druchip just put the persons @ name in a comment and the word thanks
CamperBot
@camperbot
Jan 18 2016 07:55
webcodeninja sends brownie points to @druchip :sparkles: :thumbsup: :sparkles:
:star: 179 | @druchip | http://www.freecodecamp.com/druchip
druchip
@druchip
Jan 18 2016 07:56
@WebCodeNinja thank
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 07:56
@WebCodeNinja that is exactly what i said
jeez
Christopher Ngo
@ingochris
Jan 18 2016 07:56
function truncate(str, num) {
  // Clear out that junk in your trunk
  str=str.split(""); //.splice(0,num).join("");
  if (num>3){
  return str.splice(0,num-3).join("")+"...";
  }
  else return str.splice(0,num).join("")+"...";
}

truncate("A-tisket a-tasket A green and yellow basket", 2);

Why ain't the following case working?

truncate("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2) should return "A-tisket a-tasket A green and yellow basket".

bonfire truncate a string
CamperBot
@camperbot
Jan 18 2016 07:56

:fire:Bonfire: Truncate a string :link:

function truncate(str, num) {
  // Clear out that junk in your trunk
  return str;
}

truncate('A-tisket a-tasket A green and yellow basket', 11);

Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a '...' ending.

more info:  bf details | bf links | hint

Jose Dzireh Chong
@CodingDucky
Jan 18 2016 07:56
function destroyer(arr) {
  //args is the subset
  //temp is the stuff we want to filter out
  //newArr is the set to assign the new stuff to
  var args = [];
  var newArr = [];
  for (var i = 0; i < arguments.length; i++){
    args.push(arguments[i]);
  }
  var temp = args.slice(1);
  args.splice(1);

  for (var p = 0; p < temp.length; p++) {
    if (args.indexOf(temp[p]) >= 0) {
      newArr.push(temp[p]);
    }
  }
  return newArr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
I just wanna understand why my code doesn't work, optimisation aside. The function always returns [], no matter the input.
Here's the task:
You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.
Christopher Ngo
@ingochris
Jan 18 2016 07:56
case:
truncate("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2) should return "A-tisket a-tasket A green and yellow basket".
Markus Kiili
@Masd925
Jan 18 2016 07:56
@CodingDucky No. You can use arr.slice(). The code is used because array methods don't work on arguments.
WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:57
@druchip "thanks" not "thank"
CamperBot
@camperbot
Jan 18 2016 07:57
webcodeninja sends brownie points to @druchip :sparkles: :thumbsup: :sparkles:
:star: 180 | @druchip | http://www.freecodecamp.com/druchip
WebCodeNinja
@WebCodeNinja
Jan 18 2016 07:57
@Masd925 @CodingDucky or you can convert the arr to an array
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 07:58
@Masd925 So adding prototype makes it useable for arguments?
Also, what makes my code not work?
Aside from optimisation.
Markus Kiili
@Masd925
Jan 18 2016 07:59
@CodingDucky Using call makes array methods usable on arguments.
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 07:59
Got it
Also, what makes my code not work?
Aside from optimisation.
Markus Kiili
@Masd925
Jan 18 2016 08:01
@CodingDucky Remove the splice line and use arr and temp.
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:03
@Masd925 Not sure I follow. What exactly do you want me to replace args.splice(1); with?
Markus Kiili
@Masd925
Jan 18 2016 08:04
If you remove it you have the array on arr and the extra arguments on temp.
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:05
@Masd925 Removed the line
New code:
function destroyer(arr) {
  //args is the subset
  //temp is the stuff we want to filter out
  //newArr is the set to assign the new stuff to
  var newArr = [];
  var args = Array.prototype.slice.call(arguments);
  var temp = args.slice(1);

  for (var p = 0; p < temp.length; p++) {
    if (args.indexOf(temp[p]) >= 0) {
      newArr.push(temp[p]);
    }
  }
  return newArr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Now returns [2,3]
It should return [1,1]
Markus Kiili
@Masd925
Jan 18 2016 08:08
@CodingDucky I got it to work. You have some wrong variables here and there.
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:08
@Masd925 I shall check
Markus Kiili
@Masd925
Jan 18 2016 08:09
arr instead of temp mainly and you should seek for -1.
And use indexOf on temp.
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:14
thank @Masd925
CamperBot
@camperbot
Jan 18 2016 08:14
codingducky sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star: 725 | @masd925 | http://www.freecodecamp.com/masd925
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:14
finally got it to work!
function destroyer(arr) {
  //args is the subset
  //temp is the stuff we want to filter out
  //newArr is the set to assign the new stuff to
  var newArr = [];
  var args = Array.prototype.slice.call(arguments);
  var temp = args.slice(1);
  args = args[0];
  for (var p = 0; p < args.length; p++) {
    if (temp.indexOf(args[p]) < 0) {
      newArr.push(args[p]);
    }
  }
  return newArr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Markus Kiili
@Masd925
Jan 18 2016 08:15
@CodingDucky Great!
You can do the double slicing with .call(arguments,1) if you like.
Your loop is implementing the built-in filter method, so you can use it instead if you wan't.
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:17
Hmm.
I might come back to these when I'm learning how to optimise, but for now I think I'll leave it.
More questions!
function where(arr, num) {
  arr += num;
  // Find my place in this sorted array.
  return arr;
}

where([40, 60], 50);
Markus Kiili
@Masd925
Jan 18 2016 08:19
@CodingDucky Good idea to do these later again.
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:19
returns 40, 6050
I want it to return 40, 60, 50
Markus Kiili
@Masd925
Jan 18 2016 08:19
@CodingDucky Use push
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:19
Should I use .push()?
yay for coincidences
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:19
<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.here is a <a href="http://freecatphotoapp.com">link of cat photos<a/></p>
what is the bug in above code?
Make sure your a element has a closing tag. is says this!
i have already put an closing tag!
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:22
It's </a> not <a/>
Kyle Roach
@iRoachie
Jan 18 2016 08:22
@deepakdubey2624 paste ur url? So we can see wher u went wrong?
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:22
@deepakdubey2624 It's </a> not <a/>
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:22
ok got it thankx @CodingDucky
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:22
pls replace the x with an s pls
Kyle Roach
@iRoachie
Jan 18 2016 08:22
Lool ^
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:24
http://www.freecodecamp.com/challenges/link-to-external-pages-with-anchor-elements#?solution=%3Clink%20href%3D%22http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DLobster%22%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%3E%0A%3Cstyle%3E%0A%20%20.red-text%20%7B%0A%20%20%20%20color%3A%20red%3B%0A%20%20%7D%0A%0A%20%20h2%20%7B%0A%20%20%20%20font-family%3A%20Lobster%2C%20Monospace%3B%0A%20%20%7D%0A%0A%20%20p%20%7B%0A%20%20%20%20font-size%3A%2016px%3B%0A%20%20%20%20font-family%3A%20Monospace%3B%0A%20%20%7D%0A%0A%20%20.thick-green-border%20%7B%0A%20%20%20%20border-color%3A%20green%3B%0A%20%20%20%20border-width%3A%2010px%3B%0A%20%20%20%20border-style%3A%20solid%3B%0A%20%20%20%20border-radius%3A%2050%25%3B%0A%20%20%7D%0A%0A%20%20.smaller-image%20%7B%0A%20%20%20%20width%3A%20100px%3B%0A%20%20%7D%0A%3C%2Fstyle%3E%0A%0A%3Ch2%20class%3D%22red-text%22%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%3Cimg%20class%3D%22smaller-image%20thick-green-border%22%20src%3D%22https%3A%2F%2Fbit.ly%2Ffcc-relaxing-cat%22%3E%0A%0A%3Cp%20class%3D%22red-text%22%3EKitty%20ipsum%20dolor%20sit%20amet%2C%20shed%20everywhere%20shed%20everywhere%20stretching%20attack%20your%20ankles%20chase%20the%20red%20dot%2C%20hairball%20run%20catnip%20eat%20the%20grass%20sniff.Here%20is%20a%20%3Ca%20href%3D%22http%3A%2F%2Ffreecatphotoapp.com%22%3E%20%20link%20of%20cat%20photos%3C%2Fp%3E%0A%3Cp%20class%3D%22red-text%22%3EPurr%20jump%20eat%20the%20grass%20rip%20the%20couch%20scratched%20sunbathe%2C%20shed%20everywhere%20rip%20the%20couch%20sleep%20in%20the%20sink%20fluffy%20fur%20catnip%20scratched.%3C%2Fp%3E%0A
here is the link.problem still not solved!
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:24
@deepakdubey2624 nooooooo
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:25
i am not getting what its saying.!
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:26
What don't you get?
Kyle Roach
@iRoachie
Jan 18 2016 08:27
@deepakdubey2624 You’re error is here
 <a href="http://freecatphotoapp.com">  link of cat photos</p>
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:27
i am placing the </a> tag still its saying Make sure your a element has a closing tag.
Kyle Roach
@iRoachie
Jan 18 2016 08:28
@deepakdubey2624 You need to close the anchor tag
 <a href="http://freecatphotoapp.com">  link of cat photos</a></p>
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:29
i am doing the same!
Kyle Roach
@iRoachie
Jan 18 2016 08:29
When i clicked on your link just now, it said you didnt do it
optprime72
@optprime72
Jan 18 2016 08:30
exercise : add border around the element
<style>
.thin-red-border {
border-color: red;
border-width: 5px;
border-style: solid;
}
</style>
where to put this?
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:31
In <head></head>
Kyle Roach
@iRoachie
Jan 18 2016 08:31
@CodingDucky there’s no head.. <style></style>
@deepakdubey2624 You got it done?
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:32
just put that thing on line 1 @optprime72
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:32
@iRoachie I'm a little rusty
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:32
i am trying @iRoachie
Kyle Roach
@iRoachie
Jan 18 2016 08:32
@CodingDucky It’s cool man
optprime72
@optprime72
Jan 18 2016 08:32
let me try
Kyle Roach
@iRoachie
Jan 18 2016 08:32
@deepakdubey2624 Hey send your url again?
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:32
okay
thanks @iRoachie got it done!
CamperBot
@camperbot
Jan 18 2016 08:33
deepakdubey2624 sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 307 | @iroachie | http://www.freecodecamp.com/iroachie
Kyle Roach
@iRoachie
Jan 18 2016 08:33
@deepakdubey2624 Awesome :smile:
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:33
Wow.
@iRoachie why do u get thanked with proper spelling
cri
Kyle Roach
@iRoachie
Jan 18 2016 08:34
Lool haha @CodingDucky thanks
CamperBot
@camperbot
Jan 18 2016 08:34
iroachie sends brownie points to @codingducky :sparkles: :thumbsup: :sparkles:
:star: 265 | @codingducky | http://www.freecodecamp.com/codingducky
Kyle Roach
@iRoachie
Jan 18 2016 08:34
There you go
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:34
thanks a lot guys @iRoachie @CodingDucky
CamperBot
@camperbot
Jan 18 2016 08:34
deepakdubey2624 sends brownie points to @iroachie and @codingducky :sparkles: :thumbsup: :sparkles:
:warning: deepakdubey2624 already gave iroachie points
:star: 266 | @codingducky | http://www.freecodecamp.com/codingducky
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:34
thanks man!
lol i got double points
thanks @iRoachie
CamperBot
@camperbot
Jan 18 2016 08:34
codingducky sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 308 | @iroachie | http://www.freecodecamp.com/iroachie
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:34
more for you
just to be fair
Kyle Roach
@iRoachie
Jan 18 2016 08:37
Lol haha we’re equal then!
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:37
Indeed
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:38
hey guys how did you do that snap part, i mean how to paste the code here ?
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:38
type three backpacks (```), shift enter, then submit your code
Kyle Roach
@iRoachie
Jan 18 2016 08:38
help format
CamperBot
@camperbot
Jan 18 2016 08: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

Brian
@sludge256
Jan 18 2016 08:38
backpacks :D
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:39
goddamn autocorrect
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:39
haha!!
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:39
@iRoachie dammit i should've done that
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:39
thanks, again!
Kyle Roach
@iRoachie
Jan 18 2016 08:39
Lol now you know!
optprime72
@optprime72
Jan 18 2016 08:42
This message was deleted
CamperBot
@camperbot
Jan 18 2016 08:42
:bulb: to format code use backticks! ``` more info
optprime72
@optprime72
Jan 18 2016 08:44
where to put border element in following code?
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
    .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

  .smaller-image {
    width: 100px;
  }
   .thin-red-border {
    border-color: red;
    border-width: 5px;
    border-style: solid;

}

</style>
<h2 class="red-text">CatPhotoApp</h2>
<img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Kyle Roach
@iRoachie
Jan 18 2016 08:44
@optprime72 on the img tag
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:45
create a class name .thick-green-border in image tag
then use .thick-green-border CSS to add properties @optprime72
optprime72
@optprime72
Jan 18 2016 08:46
let me try
@deepakdubey2624
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:46
okay!
Kyle Roach
@iRoachie
Jan 18 2016 08:51
Later folks! The sun wont catch me this morning :smile:
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 08:51
Bye. @iRoachie
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 08:58
@iRoachie bye
Pranav Doshi
@pranavdoshi
Jan 18 2016 08:59
wassup guys
optprime72
@optprime72
Jan 18 2016 09:04
This message was deleted
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 09:05
All cgoo!
good!
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:05
cgoo
optprime72
@optprime72
Jan 18 2016 09:05
This message was deleted
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 09:06
@CodingDucky u always prompt me for that!
LOL!
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:06
;)
optprime72
@optprime72
Jan 18 2016 09:07

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

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

h2 {
font-family: Lobster, Monospace;
}

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

.smaller-image {
width: 100px;
}
.thin-red-border {
border-color: red;
border-width: 5px;
border-style: solid;

}
</style>

<h2 class="red-text">CatPhotoApp</h2>
<img class="smaller-image .thick-green-border" src="https://bit.ly/fcc-relaxing-cat" >

<style>
.thin-red-border {
border-color: red;
border-width: 5px;
border-style: solid;
}
</style>

<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>
``` is this the way @deepakdubey2624

Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 09:07
use thick.green-border
dont put . !
thick-green-border
and give the same thick-green-border name to your CSS
.thick-green-border {
border-color: red;
border-width: 5px;
border-style: solid;
}
do according to the instruction given
optprime72
@optprime72
Jan 18 2016 09:10
@deepakdubey2624 i got that thank you
CamperBot
@camperbot
Jan 18 2016 09:10
optprime72 sends brownie points to @deepakdubey2624 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for deepakdubey2624
ChrisWu1108
@ChrisWu1108
Jan 18 2016 09:10
hi
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 09:10
width: 10px @optprime72
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:10
@deepakdubey2624 looks like you don't exist
oops
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 09:11
whats the problem behind that?
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:11
I don't even know
CamperBot couldn't find you to give points to
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 09:12
CamperBot u there??
LOL!
optprime72
@optprime72
Jan 18 2016 09:12
done thanku @deepakdubey2624
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:12
well isn't this ironic
getting thanked with bad spelling
lol
thanks @deepakdubey2624
CamperBot
@camperbot
Jan 18 2016 09:13
codingducky sends brownie points to @deepakdubey2624 :sparkles: :thumbsup: :sparkles:
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:13
for you
CamperBot
@camperbot
Jan 18 2016 09:13
:warning: could not find receiver for deepakdubey2624
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:13
wait
@deepakdubey2624 you don't even exist
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 09:13
replace u with s in thanku @optprime72
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:13
Wouldn't even work
He already thanked you properly before
CamperBot can't find you
watch this:
thanks @deepakdubey2624
CamperBot
@camperbot
Jan 18 2016 09:14
codingducky sends brownie points to @deepakdubey2624 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for deepakdubey2624
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:14
tada you don't exist
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 09:14
yea, whats wrong with CamperBot
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:14
No idea
Mahmoud Refat
@Beast2life
Jan 18 2016 09:16
hello guys something awful just happened
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:16
what
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 09:16
what??
Mahmoud Refat
@Beast2life
Jan 18 2016 09:16
i was at "next an anchor element" and by mistake i deleted some stuff
so i tried to reset the code
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:16
and
Mahmoud Refat
@Beast2life
Jan 18 2016 09:16
but everything got deleted
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:17
in that activity?
Mahmoud Refat
@Beast2life
Jan 18 2016 09:17
didn't get me the code of previous lesson
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:17
or all your progress ever
Mahmoud Refat
@Beast2life
Jan 18 2016 09:17
not all of it
it got me something very old
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:17
what's the task name called?
druchip
@druchip
Jan 18 2016 09:17
function golfScore(par, strokes) {
  // Only change code below this line
  if (strokes == 1){
    return "Hole-in-one!";
  } else if(strokes <= par - 2){
    return "Eagle";
  } else if(strokes == par - 1){
    return "Birdie";
  } else if(strokes == par){
    return "par";
  } else if(strokes == par + 1){
    return "Bogey";
  } else if(strokes == par + 2){
    return "Double Bogey";
  } else 
  return "Go Home!";
  // Only change code above this line
}
// Change these values to test
golfScore(4, 4);
@_@ not passs
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:17
wiki task an anchor element
CamperBot
@camperbot
Jan 18 2016 09:17
no wiki entry for: task an anchor element
Mahmoud Refat
@Beast2life
Jan 18 2016 09:17
"Nest an Anchor Element within a Paragraph"
wiki that?
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:18
wiki nest an anchor element within a graph
CamperBot
@camperbot
Jan 18 2016 09:18
no wiki entry for: nest an anchor element within a graph
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:18
wiki "Nest an Anchor Element within a Paragraph"
CamperBot
@camperbot
Jan 18 2016 09:18

:point_right: waypoint nest an anchor element within a paragraph [wiki]

Nesting is simple, just add one element inside another: <p> click here for <a href="http://www.catphotoapp.com">cat photos</a></p>
:pencil: read more about waypoint nest an anchor element within a paragraph on the FCC Wiki
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:18
@Beast2life So you lost that challenge and a few others
Mahmoud Refat
@Beast2life
Jan 18 2016 09:19
yes
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:19
Go on the wiki and copy paste the solutions for them
Mahmoud Refat
@Beast2life
Jan 18 2016 09:19
how is that
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:19
just type 'wiki nameofchallenge'
Markus Kiili
@Masd925
Jan 18 2016 09:19
@druchip Use Par not par
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:19
follow the link camperbot gives
Mahmoud Refat
@Beast2life
Jan 18 2016 09:19
wiki 'Nest an Anchor Element within a Paragraph'
CamperBot
@camperbot
Jan 18 2016 09:19

:point_right: waypoint nest an anchor element within a paragraph [wiki]

Nesting is simple, just add one element inside another: <p> click here for <a href="http://www.catphotoapp.com">cat photos</a></p>
:pencil: read more about waypoint nest an anchor element within a paragraph on the FCC Wiki
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:20
it gives solutions once you scroll as far down as you can
Mahmoud Refat
@Beast2life
Jan 18 2016 09:20
but it will give me only solution?
not the whole code
ChrisWu1108
@ChrisWu1108
Jan 18 2016 09:20
hello
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:20
It'll give you the whole code when you need the whole code
If you've done it before and have the solution it shouldn't be too hard to redo it
Mahmoud Refat
@Beast2life
Jan 18 2016 09:21
how i could remember everything i was told to add before D:
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:21
message @QuincyLarson
Tell him exactly what happened, what led up to it etc.
Mahmoud Refat
@Beast2life
Jan 18 2016 09:23
a'right i am at his page now
can't see a "message" button or something
Jose Dzireh Chong
@CodingDucky
Jan 18 2016 09:24
search for him in the search bar in the top right of full screen gitter
click him
click his icon next to his chat messages
select 'chat privately'
Mahmoud Refat
@Beast2life
Jan 18 2016 09:26
i'm felling dump, where is that screen gitter
just nevermind i just went to the previous task and i got the code
Edward Hong
@edward-hong
Jan 18 2016 09:29
Hi I'm stuck on bonfire DNA pairing here's my code:
function pair(str) {
  var arr = str.split('');
  for (i = 0; i < arr.length; i++) {
    arr[i] = arr[i].split('');
  }
  for (j = 0; j < arr.length; j++) {
    switch (arr[i][0]){
      case "A":
        arr[i].push("T");
        break;
      case "T":
        arr[i].push("A");
        break;
      case "G":
        arr[i].push("C");
        break;
      case "C":
        arr[i].push("G");
        break;
    }
  }
  return arr;
}

pair("GCG");
Markus Kiili
@Masd925
Jan 18 2016 09:31
This message was deleted
Edward Hong
@edward-hong
Jan 18 2016 09:33
@Masd925 the loop changes each element of the array into an array itself
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 09:33
declare the var arr outside the function!
Markus Kiili
@Masd925
Jan 18 2016 09:34
@edward-hong Yeah, I remembered the problem wrong.
Blauelf
@Blauelf
Jan 18 2016 09:34
@edward-hong Your second loop uses j, switch to i (you are using arr[i] all the time). And follow @deepakdubey2624 's advice.
For your first loop: An easier way to put something in an array is to use arr[i]=[arr[i]], you could skip that first loop if you did that inside the second loop, instead of using push. Like case "A": arr[i]=["A","T"]; break;
Edward Hong
@edward-hong
Jan 18 2016 09:35
yep got it working thanks @deepakdubey2624 @Blauelf @Masd925
CamperBot
@camperbot
Jan 18 2016 09:35
edward-hong sends brownie points to @deepakdubey2624 and @blauelf and @masd925 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for deepakdubey2624
:star: 905 | @blauelf | http://www.freecodecamp.com/blauelf
:star: 726 | @masd925 | http://www.freecodecamp.com/masd925
Mahmoud Refat
@Beast2life
Jan 18 2016 09:45
wiki "bulleted unordered list"
CamperBot
@camperbot
Jan 18 2016 09:45

:point_right: waypoint create a bulleted unordered list [wiki]

HTML has a special element for creating unordered lists, or bullet point-style lists.

Unordered lists start with a <ul> element. Then they contain some number of <li> elements.

For example:

<ul>
  <li>milk</li>
  <li>cheese</li>
</ul>

would create a bullet point-style list of "milk" and "cheese".
:pencil: read more about waypoint create a bulleted unordered list on the FCC Wiki

Ashwin Gurbuxani
@gurbuxani
Jan 18 2016 09:49
hello, how do I add a class to an img element?
I'm trying to add smaller-image to <img src="https://bit.ly/fcc-relaxing-cat">
Got it, it should be <img src="https://bit.ly/fcc-relaxing-cat" class=smaller-image>
Blauelf
@Blauelf
Jan 18 2016 10:01
Should be in quotation marks: class="smaller-image". If you have multiple classes, add them all in the same string separated by space: class="class1 class2 yet-another-class"
Shruti Hardat
@shrutihardat
Jan 18 2016 10:12
Hello, could someone help me with the task "Record Collection" under "Basic JavaScript?" I'm unable to implement it because I'm having trouble understanding what I'm supposed to do.
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 10:13
send the link @shrutihardat
Shruti Hardat
@shrutihardat
Jan 18 2016 10:14
Of the task?
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 10:14
yea!
jsut copy the link from ur address bar and paste it here!
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 10:18
you have to give the if condition for this
if(value!==0 && prop!==tracks){}
Shruti Hardat
@shrutihardat
Jan 18 2016 10:19
@deepakdubey2624 Yes, I did that. But I think my conditions are incorrect. Trying to fix them. :(
Sorry, I mean my conditions are probably correct. But the assignments I've made are incorrect. Fixing them.
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 10:20
okay try to fix the assignments!
Christopher Ngo
@ingochris
Jan 18 2016 10:22
yay!
Shruti Hardat
@shrutihardat
Jan 18 2016 10:25
@deepakdubey2624 Works now. Thanks for the help!
CamperBot
@camperbot
Jan 18 2016 10:25
shrutihardat sends brownie points to @deepakdubey2624 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for deepakdubey2624
Deepak Dwivedi
@deepakdubey2624
Jan 18 2016 10:26
Np!
Shinigami Gökhan
@Bondygio
Jan 18 2016 10:29
hey guys, could you help me? I am stuck and cant find my problem. <