These are chat archives for FreeCodeCamp/Help

4th
Nov 2015
ScousaJay
@ScousaJay
Nov 04 2015 00:03
@m6cheung ah ok, i didnt notice i forgot the www. , thats my bad, so that line you showed me appears to have cleared up one of the issues, but the View More (with a space after it) is still not as it should be when i run the test, thanks for the help too @m6cheung & @byronic
CamperBot
@camperbot
Nov 04 2015 00:03
scousajay sends brownie points to @m6cheung and @m6cheung and @byronic :sparkles: :thumbsup: :sparkles:
:star: 250 | @m6cheung | http://www.freecodecamp.com/m6cheung
:star: 225 | @byronic | http://www.freecodecamp.com/byronic
:star: 250 | @m6cheung | http://www.freecodecamp.com/m6cheung
Michael Cheung
@m6cheung
Nov 04 2015 00:04
@ScousaJay try deleting the extra characters after the anchor and see if that works
ScousaJay
@ScousaJay
Nov 04 2015 00:07
it hasnt worked, still get the same issue
Jim
@JimC86
Nov 04 2015 00:08
wow I had to open in new tab otherwise everytime I clicked chat, it just opened then quickly closed the window...
Byron Lagrone
@byronic
Nov 04 2015 00:10
@ScousaJay I see an extra space after View more
as well as another a link to the cat photos app -- are we supposed to leave that as-is?
Jim
@JimC86
Nov 04 2015 00:11
im having trouble with one that should be pretty easy, I guess I don't know how to "nest my text input element within a form element", the latter being more likely of course
*meant to delete after the comma..
ok I cleared it, and it wont move on
theres nothing to the lower left, but theres not dialogue box to move on.. Any ideas?
Michael Cheung
@m6cheung
Nov 04 2015 00:16
@JimC86 screen shot?
Jim
@JimC86
Nov 04 2015 00:16
sure how do I post it in here
Michael Cheung
@m6cheung
Nov 04 2015 00:17
drag the picture to the chat box
Jim
@JimC86
Nov 04 2015 00:17
sec
Michael Cheung
@m6cheung
Nov 04 2015 00:17
alternatively you can refresh the page repost the code and press ctrl j
twice
Jim
@JimC86
Nov 04 2015 00:18
when I drag it it goes to a new page, no longer in chat
Michael Cheung
@m6cheung
Nov 04 2015 00:19
@JimC86 oh ok you can press prt scr and then press ctrl v in the chat box
ScousaJay
@ScousaJay
Nov 04 2015 00:19
@byronic i have address the extra space after View More, but i dont see the extra a link, other than the main picture link that i was directed to do in an earlier part of the lesson programme
Jim
@JimC86
Nov 04 2015 00:20
its in paint right now cuz I jst used the prnt scrn key and pasted in to there
I tried that
Michael Cheung
@m6cheung
Nov 04 2015 00:20
try pasting directly onto the chat box
Cameron Bass
@cameronbass
Nov 04 2015 00:20
How do I get a random number in javascript?
Jim
@JimC86
Nov 04 2015 00:20
i am, its not letting me, i had problems even opening the chat box
Michael Cheung
@m6cheung
Nov 04 2015 00:20
hmm paste ur code here
help format
CamperBot
@camperbot
Nov 04 2015 00:20

:point_right: code format [wiki]

Inline code

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

Code Block

``` ⇦ Type 3 backticks and then press [shift + enter ⏎]

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

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

How to Code

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

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

Cameron Bass
@cameronbass
Nov 04 2015 00:21

function myFunction() {

// Only change code below this line.

math.random();

// Only change code above this line.
}

(function(){return myFunction();})();

Michael Cheung
@m6cheung
Nov 04 2015 00:21
@cameronbass math.random need to be -->M<---ath.random()
Cameron Bass
@cameronbass
Nov 04 2015 00:22
CamperBot
@camperbot
Nov 04 2015 00:22
if you want to thank someone, put an @ before their name!
Jim
@JimC86
Nov 04 2015 00:22
one sec ill get a link to the pic
all the things are not just x or checked, theyre gone when I click ok answer
er Run Test
tried it twice now
Michael Cheung
@m6cheung
Nov 04 2015 00:25
@JimC86 the problem may lie in the browser, but im not entirely sure
the support for internet explorer especially older versions is not the greatest
Jim
@JimC86
Nov 04 2015 00:25
yeah I was guessing that and tried it in firefox
no luck, but im running some cleaning programs now
i just wanted to make asure i did it right
what browser do u use
Michael Cheung
@m6cheung
Nov 04 2015 00:27
@JimC86 chrome
firefox should be fine though
Jim
@JimC86
Nov 04 2015 00:27
hm, i used to use chrome, until the malware got RELENTLESS
maybe ill try it again
im not particularly fond of firefox
but ill do that and restart and try again
bbl hopefully
thanks for the help
CamperBot
@camperbot
Nov 04 2015 00:28
if you want to thank someone, put an @ before their name!
Michael Cheung
@m6cheung
Nov 04 2015 00:28
@JimC86 by the way for that waypoint
they want you to nest the input element within your form
you have the form outside of the input
so there's no actual nesting thats happening
IndyC
@IndyC
Nov 04 2015 00:30
I'm on the Waypoint: Use a CSS Class to Style an Element. When I try to apply a class to a HTML
<h2 class="blue-text">CatPhotoApp</h2>
I keep getting an error.
Michael Cheung
@m6cheung
Nov 04 2015 00:31
@IndyC use css Class?
or selector?
IndyC
@IndyC
Nov 04 2015 00:32
I'm doing the Use CSS to style an element
When I try to apply class to a HTML...I have errors
Michael Cheung
@m6cheung
Nov 04 2015 00:33
@IndyC i see
@IndyC does the exercise ask for blue text?
i think it asks to set h2 class** to red-text
IndyC
@IndyC
Nov 04 2015 00:34
It is asking me for red
Michael Cheung
@m6cheung
Nov 04 2015 00:35
@IndyC so you're on the right track, <h2 class='red-text'>dsfasdf</h2>
IndyC
@IndyC
Nov 04 2015 00:35
so it should read..<h2 class="red-text>CatPhotoApp</h2>
I meant "red-text"
Michael Cheung
@m6cheung
Nov 04 2015 00:36
@IndyC that's right
IndyC
@IndyC
Nov 04 2015 00:37
For some reason...its not working Hmmmm. Okay @m6cheung
kwdavis42
@kwdavis42
Nov 04 2015 00:37

Hey so I'm on Waypoint: Create a bulleted unordered list. It's asking for a u1 element with three li elements inside, but it says I haven't created the u1 element, 3 li elements, or closed u1. Code:

<u1>
<li>milk</li>
<li>cheese</li>
<li>petting</li>
</u1>

So to end I'm really confused why that doesn't work, any help appreciated!

Michael Cheung
@m6cheung
Nov 04 2015 00:37
@m6cheung what's the new problem?
IndyC
@IndyC
Nov 04 2015 00:38
@m6cheung thanks
CamperBot
@camperbot
Nov 04 2015 00:38
indyc sends brownie points to @m6cheung :sparkles: :thumbsup: :sparkles:
:star: 251 | @m6cheung | http://www.freecodecamp.com/m6cheung
Michael Cheung
@m6cheung
Nov 04 2015 00:40
@kwdavis42 where are you placing the list?
Micheal Hall
@michealhall
Nov 04 2015 00:40
@kwdavis42 ... that's supposed to be a ul (UL) not u1. :)
Michael Cheung
@m6cheung
Nov 04 2015 00:41
@michealhall lol! nice catch, I didn't even notice
kwdavis42
@kwdavis42
Nov 04 2015 00:41
@michealhall that would explain quite a bit... haha thanks!
CamperBot
@camperbot
Nov 04 2015 00:41
kwdavis42 sends brownie points to @michealhall :sparkles: :thumbsup: :sparkles:
:star: 227 | @michealhall | http://www.freecodecamp.com/michealhall
Micheal Hall
@michealhall
Nov 04 2015 00:41
@kwdavis42 Sure thing!
Michael Swartz
@mlswartz
Nov 04 2015 01:08
Has anyone done Waypoint: Iterate over Arrays with map
I came up with a solution that works in node.js but FCC won't accept it.

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

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


```var newArray = addThree;
Matt Yamamoto
@MattYamamoto
Nov 04 2015 01:20
@mlswartz did you close the function block?
ScousaJay
@ScousaJay
Nov 04 2015 01:38
how do you guys copy from the console and paste it in here with the black background? thanks
CamperBot
@camperbot
Nov 04 2015 01:38
if you want to thank someone, put an @ before their name!
Katie
@Katie-S
Nov 04 2015 01:42
@ScousaJay type 3 ` backticks like that except without the spaces then press shift and enter to put in your code the shift enter again then type three more backticks and press enter
Matt Yamamoto
@MattYamamoto
Nov 04 2015 01:42
help format
CamperBot
@camperbot
Nov 04 2015 01:42

:point_right: code format [wiki]

Inline code

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

Code Block

``` ⇦ Type 3 backticks and then press [shift + enter ⏎]

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

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

How to Code

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

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

Katie
@Katie-S
Nov 04 2015 01:42
Yep that's it :)
Melissa Eaton
@meaton3
Nov 04 2015 01:42
guide to base jumps
whoops sorry, disregard that!
ScousaJay
@ScousaJay
Nov 04 2015 01:43
cool, thanks Katie-S :)
CamperBot
@camperbot
Nov 04 2015 01:43
if you want to thank someone, put an @ before their name!
DJ
@qualitymanifest
Nov 04 2015 01:43
Thanks @Masd925 that was interesting
CamperBot
@camperbot
Nov 04 2015 01:43
qualitymanifest sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star: 169 | @masd925 | http://www.freecodecamp.com/masd925
Roger K.
@misterhtmlcss
Nov 04 2015 01:47

Hi Guys, I’m about to run out the door, but I wondered if I could get some feedback on this code I was writing. It’s not FCC, but it’s me trying out my new FCC stuff. Trying to do a function, maybe an object too. I’d like to build a calculator (eventually) that I can use to calculate accumulated value from dividend stocks I own (so you know the goal).

var myLIQ = function(stockPrice, divYield, keepTime) {
    this.stockPrice = stockPrice;
    this.divYield = divYield;
    this.keepTime = keepTime;
}
stockPrice = prompt("What is the stock price? " + "");
divYield = prompt("How many shares do you get granted? " + "");
keepTime = prompt("What time period will you hold these shares? " + "");
var totalReturn = myLIQ((stockPrice * divYield) * keepTime); 
document.write(totalReturn);

Basically I had written it where it was like this too:

var myLIQ = function(stockPrice, divYield, keepTime) {
    this.stockPrice =  prompt("What is the stock price? " + "");
    this.divYield = prompt("How many shares do you get granted? " + "");
    this.keepTime = prompt("What time period will you hold these shares? " + "");
}
var totalReturn = myLIQ((stockPrice * divYield) * keepTime); 
document.write(totalReturn);

I thought I was on the write track with both (I failed and moved to the other and I had a couple more failures before this I can’t even remember - been at it a 2 hours :(((( - your help is appreciated).

All I am trying to achieve at this time is a prompt for each variable e.g. stockPrice and I’d like to do it as part of a Object (and squeeze in as much fucntionality as possible) because I believe this is a data set that I’d like to keep together if I was to code correctly.

Can someone tweak and push back to me privately? Privately just so I can respond later when I’m free late tonight and show appreciation to that person and ask further follow up questions as necassary. :)

Linzy
@LinzyPanda
Nov 04 2015 01:51
Hey all! Having some trouble with Waypoint: Create a Block Element Bootstrap Button. It seems like it should be so simple, but I keep getting the error "Your button should still have the class btn."
This is what I have <button class="btn-block">Like</button>. How do I have the btn class AND the btn-block class at the same time?
Samantha Medeiros
@samanthamed
Nov 04 2015 01:52
you can have them both with just a space in between
"btn btn-block" like that
Linzy
@LinzyPanda
Nov 04 2015 01:53
Ok. I have getting confused because in the example they have a period instead of a space.
Thanks @samanthamed, that worked :)
CamperBot
@camperbot
Nov 04 2015 01:53
linzypanda sends brownie points to @samanthamed :sparkles: :thumbsup: :sparkles:
:star: 219 | @samanthamed | http://www.freecodecamp.com/samanthamed
Samantha Medeiros
@samanthamed
Nov 04 2015 01:53
when you refer to classes in CSS or jQuery you write them with the period in front of them, but there's no period in the html
glad that did the trick! :)
Makist95
@Makist95
Nov 04 2015 01:59
Hello, anyone mind helping me with basic OOP functions?
Jacob Andra
@jacob4
Nov 04 2015 02:00
@Makist95 Can you be more specific? That's a very broad question.
Makist95
@Makist95
Nov 04 2015 02:01
Of course. I'm having problems understanding how to make an objects properties private or public. The challenges are making me use the ".this" command. But I really don't understand it at all.
Jacob Andra
@jacob4
Nov 04 2015 02:01
Are you on the "Make Object Properties Private" challenge? @Makist95
Makist95
@Makist95
Nov 04 2015 02:02
Yup
Jacob Andra
@jacob4
Nov 04 2015 02:02
Me too. Just trying to figure it out. @Makist95
Makist95
@Makist95
Nov 04 2015 02:03
Well, that makes two of us then I guess. @jacob4 Everything was going smooth until now, but I feel as if I've hit a brick wall
Jacob Andra
@jacob4
Nov 04 2015 02:03
@Makist95 the .this is a built-in thingy that always refers back to whatever object you're using it inside of
@Makist95 yea, this one is a bit challenging. I'll keep working it and let you know if i make progress
Makist95
@Makist95
Nov 04 2015 02:04
Thanks a lot, same goes you to @jacob4
CamperBot
@camperbot
Nov 04 2015 02:04
makist95 sends brownie points to @jacob4 :sparkles: :thumbsup: :sparkles:
:star: 174 | @jacob4 | http://www.freecodecamp.com/jacob4
M Used
@mildused
Nov 04 2015 02:05
Can someone help with some basic mongo?
Makist95
@Makist95
Nov 04 2015 02:09
@jacob4 Heya, thanks a lot!. Your explanation on the ".this thingy" really helped. Try playing around with .var and .this in the challenge, look at the start of the code for examples!
CamperBot
@camperbot
Nov 04 2015 02:09
makist95 sends brownie points to @jacob4 :sparkles: :thumbsup: :sparkles:
:warning: makist95 already gave jacob4 points
Jacob Andra
@jacob4
Nov 04 2015 02:09
@Makist95 you solve it?
Makist95
@Makist95
Nov 04 2015 02:10
@jacob4 Yup. Just use the examples listed at the start. It's really not that hard once you read them.
Jacob Andra
@jacob4
Nov 04 2015 02:10
cool, thanks @Makist95
CamperBot
@camperbot
Nov 04 2015 02:10
jacob4 sends brownie points to @makist95 :sparkles: :thumbsup: :sparkles:
:star: 177 | @makist95 | http://www.freecodecamp.com/makist95
David Wilbanks
@dwilbank68
Nov 04 2015 02:11
what kind of mongo
M Used
@mildused
Nov 04 2015 02:13
@dwilbank68 MongoLab and setting up a database structure
Anna-Sophie
@annasophie
Nov 04 2015 02:17
hi everyone, would anyone mind helping me out with this? I passed the waypoint on the method reduce, but I don't understand it fully
David Wilbanks
@dwilbank68
Nov 04 2015 02:17
that's a whole course! (which I can make available for you if you want)
Anna-Sophie
@annasophie
Nov 04 2015 02:17

in the example it says var singleVal = array.reduce(function(previousVal, currentVal) {

return previousVal - currentVal;

}, 0);

what is that 0?????
everything else makes sense but I don't get that floaty zero, without which my code wouldn't work
Anna-Sophie
@annasophie
Nov 04 2015 02:29
sorry, silly question. I got it.
DJ
@qualitymanifest
Nov 04 2015 02:32
@annasophie wanna tell me? because i can't figure that out now that i've seen it
Jahiruddin Saiyed
@jahirsaiyed
Nov 04 2015 02:41
hi guys i need your help
i wana solve this prob
the href should be replaced to # but it docent work
<p>Click here for <a # ="http://www.freecatphotoapp.com">cat photos</a>.</p>
DJ
@qualitymanifest
Nov 04 2015 02:48
@jahirsaiyed you need to keep the href, not replace it with #
Anna-Sophie
@annasophie
Nov 04 2015 02:49
@qualitymanifest it's the optional second argument from the description!
"reduce has an optional second argument which can be used to set the initial value of the accumulator. If no initial value is specified it will be the first array element and currentVal will start with the second array element."
so it initialized previousVal to 0, at least how I understand it
DJ
@qualitymanifest
Nov 04 2015 02:51
@annasophie ah. i've used .reduce in bonfires before but never knew about that. thanks
CamperBot
@camperbot
Nov 04 2015 02:51
qualitymanifest sends brownie points to @annasophie :sparkles: :thumbsup: :sparkles:
:star: 178 | @annasophie | http://www.freecodecamp.com/annasophie
Jahiruddin Saiyed
@jahirsaiyed
Nov 04 2015 02:51
thanks quality
CamperBot
@camperbot
Nov 04 2015 02:51
if you want to thank someone, put an @ before their name!
Anna-Sophie
@annasophie
Nov 04 2015 02:53
you are so very welcome! and thank you for the points! ooh my first ones
CamperBot
@camperbot
Nov 04 2015 02:53
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Nov 04 2015 02:55
@jpjenkins that's awesome, good job! i'm glad i could help
Carlton Stith
@carltonstith
Nov 04 2015 03:00
can someone help me with the waypoint make objects properties private exercise?
Chris Phillips
@christoph-phillips
Nov 04 2015 03:01
Hi All, I have worked on the "Sorted Union" bonfire this morning - My code passes all tests when I run it in codepen, but will not pass tests on FreeCodeCamp, anyone got any ideas?
Katie
@Katie-S
Nov 04 2015 03:10
help title case
CamperBot
@camperbot
Nov 04 2015 03:10

:point_right: bonfire title case a sentence [wiki]

Explanation:

We have to return a sentence with camel case. This means that the first letter will always be in uppercase and the rest lowercase.

:pencil: read more about bonfire title case a sentence on the FCC Wiki

h4r1m4u
@h4r1m4u
Nov 04 2015 03:20
@christoph-phillips just having a quick look at your codepen. you don't seem to return anything from your unite() function?
you're just logging the finalArray into console which is not enough
Chris Phillips
@christoph-phillips
Nov 04 2015 03:30
Thank you so much @h4r1m4u what a ridiculous mistake to make! Thanks for taking the time to look
CamperBot
@camperbot
Nov 04 2015 03:30
christoph-phillips sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 497 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 04 2015 03:31
@christoph-phillips no problem! happens to all of us. fresh set of eyes help
Chris Phillips
@christoph-phillips
Nov 04 2015 03:32
I was working on it for ages using a for loop, with slices and splices and making a real mess, then I thought about how easy it would be to push it on to an array. When I got that working I just forgot about checking my code properly. Thanks again.
CamperBot
@camperbot
Nov 04 2015 03:32
if you want to thank someone, put an @ before their name!
ProfessorAloha
@professoraloha
Nov 04 2015 03:33
I am totally stuck on GENERATE RANDOM FRACTIONS WITH JS.. HELP!! Not enough instructions for where to put the math.random
h4r1m4u
@h4r1m4u
Nov 04 2015 03:34
@professoraloha what do you have so far?
ProfessorAloha
@professoraloha
Nov 04 2015 03:35
I am totally stumped. Donʻt even know what to do with this one.
return (math.random);
h4r1m4u
@h4r1m4u
Nov 04 2015 03:36
@professoraloha you're pretty close with that!
here's a hint: letter case matters in Javascript
check again what the function to generate a random number looks like
ProfessorAloha
@professoraloha
Nov 04 2015 03:39
return (myFunctio(Math.random)); ????
Mike Bobadilla
@mikebobadilla
Nov 04 2015 03:39
any advice on getting freelance work?
h4r1m4u
@h4r1m4u
Nov 04 2015 03:39
@professoraloha what do they tell you in the sidebar the function to generate the random number is?
ProfessorAloha
@professoraloha
Nov 04 2015 03:40

This is all: Random numbers are useful for creating random behavior.

JavaScript has a Math.random() function that generates a random decimal number.

Change myFunction to return a random number instead of returning 0.

Note that you can return a function, just like you would return a variable or value.

h4r1m4u
@h4r1m4u
Nov 04 2015 03:40
so can you tell me what the function looks like?
ProfessorAloha
@professoraloha
Nov 04 2015 03:41
function myFunction() {
return (0);
}
h4r1m4u
@h4r1m4u
Nov 04 2015 03:41
i meant the function to generate the random number
ProfessorAloha
@professoraloha
Nov 04 2015 03:42
Math.random();
h4r1m4u
@h4r1m4u
Nov 04 2015 03:42
yeah, Math.random(), that's right
ProfessorAloha
@professoraloha
Nov 04 2015 03:43
(function(){return myFunction();})();
h4r1m4u
@h4r1m4u
Nov 04 2015 03:43

so if this:

function myFunction() {
  return 0;
}

is returning 0 at the moment, how do you need to adjust it so that it returns random number?

ProfessorAloha
@professoraloha
Nov 04 2015 03:43
return Math.random(); ???
h4r1m4u
@h4r1m4u
Nov 04 2015 03:44
:clap:
ProfessorAloha
@professoraloha
Nov 04 2015 03:44
that is not working.
has to return a decimal
h4r1m4u
@h4r1m4u
Nov 04 2015 03:44
post the entire code you have in the code pane
ProfessorAloha
@professoraloha
Nov 04 2015 03:45
(function(){return myFunction();})();
sorry.; it wonʻt let me
h4r1m4u
@h4r1m4u
Nov 04 2015 03:45
it won't let you what?
ProfessorAloha
@professoraloha
Nov 04 2015 03:46
function myFunction() {
return (Math.random);
}
(function(){return myFunction();})();
h4r1m4u
@h4r1m4u
Nov 04 2015 03:46
we established above that the random function looks like this: Math.random(). can you spot the difference between this and your code?
ProfessorAloha
@professoraloha
Nov 04 2015 03:48
oh boy.. that did it. had the parenthesis around the function. Thanks so much for saving my evening. Sigh.
CamperBot
@camperbot
Nov 04 2015 03:48
if you want to thank someone, put an @ before their name!
ProfessorAloha
@professoraloha
Nov 04 2015 03:48
thank you @h4r1m4u
CamperBot
@camperbot
Nov 04 2015 03:48
professoraloha sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 499 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 04 2015 03:49
the issue were the missing parenthesis after the function name: Math.random vs Math.random()
Math.random returns the entire random function, whereas Math.random() executes it and evaluates the result (in other words returns only the random number)
Hector Jimenez
@xmyoot
Nov 04 2015 04:06

var Bike = function() {

// Only change code below this line.

var myBike = function() {
// this is a private variable
this.speed = 100;
// this is a private function (also known as a private method)
function addUnit(value) {
return value + "KM/H";
}
// this is a public method
this.getSpeed= function () {
return addUnit(speed);
};

};
};

Hello Campers, I was having some trouble with my code. I cannot manage to get the getSpeed method to be accessible as outside the object, if someone could guide me in the right direction, I would greatly appreciate it!
h4r1m4u
@h4r1m4u
Nov 04 2015 04:23
@xmyoot it seems that you've somehow managed to jumble up the code provided to you by the waypoint. var myBike = function() { ... should not be part of the Bike() constructor function. it should look something like this:
var Bike = function() { // the Bike object constructor function
  ....
}

var myBike = new Bike(); // making myBike a new Bike object
this.getSpeed= function () { is correct though. using the word 'this' inside the object constructor function makes it a public property or method
Hector Jimenez
@xmyoot
Nov 04 2015 04:36
@h4r1m4u Thank you for the clarification, greatly appreciated!
CamperBot
@camperbot
Nov 04 2015 04:36
xmyoot sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 500 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 04 2015 04:37
@xmyoot did you manage to figure it out?
h4r1m4u @h4r1m4u does a little wiggle jiggle dance for his 500th cookie
Alex
@wiscoay521
Nov 04 2015 04:39
could i get some help on my code? specifically creating a deadlink. I dont know what it is im doing wrong

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

<p>Click here for a#="http://www.freecatphotoapp.com"cat photos</a>.</p>

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

h4r1m4u
@h4r1m4u
Nov 04 2015 04:40
@wiscoay521 link usually looks like this: <a href="http://someurl.com">link text</a>
Alex
@wiscoay521
Nov 04 2015 04:41
yes, but I'm trying to make that a deadlink by using #
h4r1m4u
@h4r1m4u
Nov 04 2015 04:41
if you want to make it a 'dead' link, you replace the href value (the URL) with #
Alex
@wiscoay521
Nov 04 2015 04:41
so a#="http://www.freecatphotoapp.com"cat photos</a>.</p> ?
h4r1m4u
@h4r1m4u
Nov 04 2015 04:42
can you use backticks to format the code?
`
Alex
@wiscoay521
Nov 04 2015 04:42
what is that? im new lol
h4r1m4u
@h4r1m4u
Nov 04 2015 04:42
wiki format
CamperBot
@camperbot
Nov 04 2015 04:42

:point_right: code format [wiki]

Inline code

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

Code Block

``` ⇦ Type 3 backticks and then press [shift + enter ⏎]

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

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

How to Code

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

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

Alex
@wiscoay521
Nov 04 2015 04:43

'''

<p>Click here for a#="http://www.freecatphotoapp.com"cat photos</a>.</p>
'''

CamperBot
@camperbot
Nov 04 2015 04:43
:bulb: to format code use backticks! ``` more info
Alex
@wiscoay521
Nov 04 2015 04:44
i don't know what im doing
bruglesco
@bruglesco
Nov 04 2015 04:44
backticks are under the escape key
h4r1m4u
@h4r1m4u
Nov 04 2015 04:44
backtick is not an apostrophe. backtick should be under your escape
bruglesco
@bruglesco
Nov 04 2015 04:44
those were apostrophes
and dont feel bad I made the same mistake the first time
Alex
@wiscoay521
Nov 04 2015 04:45
<p>Click here for <a href="http://www.freecatphotoapp.com">cat photos</a>.</p>
h4r1m4u
@h4r1m4u
Nov 04 2015 04:45
there you go :clap:
Alex
@wiscoay521
Nov 04 2015 04:45
<p>Click here for <a#="http://www.freecatphotoapp.com">cat photos</a>.</p>
this is what I have
bruglesco
@bruglesco
Nov 04 2015 04:46
so you kinda got it wonky
h4r1m4u
@h4r1m4u
Nov 04 2015 04:46
let me repeat what i said before:
link usually looks like this: <a href="http://someurl.com">link text</a>
if you want to make it a 'dead' link, you replace the href value (the URL) with #
Alex
@wiscoay521
Nov 04 2015 04:46
Do i replace the href with # or the actual URL?
h4r1m4u
@h4r1m4u
Nov 04 2015 04:46
you don't replace the href attribute itself, you replace its value
Alex
@wiscoay521
Nov 04 2015 04:46
ok
bruglesco
@bruglesco
Nov 04 2015 04:46
the url
Alex
@wiscoay521
Nov 04 2015 04:46
thanks
CamperBot
@camperbot
Nov 04 2015 04:46
if you want to thank someone, put an @ before their name!
Alex
@wiscoay521
Nov 04 2015 04:46
@h4r1m4u thanks1
@bruglesco thanks
CamperBot
@camperbot
Nov 04 2015 04:47
wiscoay521 sends brownie points to @bruglesco :sparkles: :thumbsup: :sparkles:
:star: 223 | @bruglesco | http://www.freecodecamp.com/bruglesco
bruglesco
@bruglesco
Nov 04 2015 04:47
np
Traisna Kurnia Limijaya
@traisna
Nov 04 2015 05:07
what is the nesting i dont undestand
h4r1m4u
@h4r1m4u
Nov 04 2015 05:08
@traisna
<p>
  <p> this paragraph is nested in the other one</p>
</p>
it's when you put one HTML element inside another
Traisna Kurnia Limijaya
@traisna
Nov 04 2015 05:08
thanks
CamperBot
@camperbot
Nov 04 2015 05:08
if you want to thank someone, put an @ before their name!
Traisna Kurnia Limijaya
@traisna
Nov 04 2015 05:09
thanks @h4r1m4u
CamperBot
@camperbot
Nov 04 2015 05:09
traisna sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 501 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 04 2015 05:09
no problem
Traisna Kurnia Limijaya
@traisna
Nov 04 2015 05:19
Your p element should have the text "View more " (with a space after it). what is that ?
h4r1m4u
@h4r1m4u
Nov 04 2015 05:23
<p>Some text with a space after it </p>
<p>Some text with no space after it</p>
Traisna Kurnia Limijaya
@traisna
Nov 04 2015 05:27
<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 view more <a href="http://www.freecatphotoapp.com">traisna </p></a><p>"View more "</p>
then Your p element should have the text "View more " (with a space after it). ? how
h4r1m4u
@h4r1m4u
Nov 04 2015 05:29
it's only supposed to have the text View more in it. not the quotes
Michael Bomholt
@bomholtm
Nov 04 2015 05:38
@h4r1m4u are you from germany or somewhere else in europe
seeing you around everytime i wake up lol :D
h4r1m4u
@h4r1m4u
Nov 04 2015 05:39
originally from europe, but i live in asia now
Michael Bomholt
@bomholtm
Nov 04 2015 05:43
ah cool. seeing you help a lot of people everytime i stand up and sitting down here with some coffee
keep up the good work :P
h4r1m4u
@h4r1m4u
Nov 04 2015 05:44
hahaha. yeah, i sit in front of a computer the whole day, so might as well multitask :D
Craig Morrison
@frogmorton
Nov 04 2015 05:44
@h4r1m4u where in Asia, I'm in Japan, and I know some other FCCampers in Korea and Taiwan.
h4r1m4u
@h4r1m4u
Nov 04 2015 05:45
@frogmorton hong kong
Craig Morrison
@frogmorton
Nov 04 2015 05:46
Oh, cool. What kind of work are you doing there?
h4r1m4u
@h4r1m4u
Nov 04 2015 05:48
i work as an independent consultant. i do web design and development, manage projects, etc.
how about yourself?
Craig Morrison
@frogmorton
Nov 04 2015 05:49
Great! I'm wanting to transition into web dev, but am teaching English to put bread on the table...
h4r1m4u
@h4r1m4u
Nov 04 2015 05:50
@frogmorton yeah, i understand. it's not a bad gig to teach english in asia. i've a friend in nagoya who's doing the same
Michael Bomholt
@bomholtm
Nov 04 2015 05:50
@h4r1m4u @frogmorton ahh you guys.. i basically want to do the exact same
Traisna Kurnia Limijaya
@traisna
Nov 04 2015 05:50
Your p element should have the text "View more " (with a space after it).
i dont undestand sir
<p <a </p> </a> <a href="http://www.freecatphotoapp.com">cat photos</a>
http://www.freecodecamp.com/challenges/waypoint-nest-an-anchor-element-within-a-paragraph#?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%3Ca%20href%3D%22http%3A%2F%2Fwww.freecatphotoapp.com%22%3Ecat%20photos%3C%2Fa%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%3EView%20more%20Kitty%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.%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%0A%0A%3Cp%20%20%3Ca%20%20%3C%2Fp%3E%20%3C%2Fa%3E%20%3Ca%20href%3D%22http%3A%2F%2Fwww.freecatphotoapp.com%22%3Ecat%20photos%3C%2Fa%3E%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A
Michael Bomholt
@bomholtm
Nov 04 2015 05:51
would love to live in hong kong and i love japan... you guys live the dream
:)
h4r1m4u
@h4r1m4u
Nov 04 2015 05:51
@bomholt :D dreams come true. make it happen!
Craig Morrison
@frogmorton
Nov 04 2015 05:51
@traisna text is typically put between an opening p tag and closing p tag
There is no back tick key on a mobile, so I can't enter formatted code
Michael Bomholt
@bomholtm
Nov 04 2015 05:54
@h4r1m4u i hope they do ;) planning on moving to berlin next year for work and freelancing opportunities
hopefully i can start traveling then and find some jobs in asia
Craig Morrison
@frogmorton
Nov 04 2015 05:55
@h4r1m4u Not a bad gig, but the money isn't great. Seeing as I am married with 2 kids, I need to do (a lot) better. Not to mention, I'm getting a bit burned out with it.
h4r1m4u
@h4r1m4u
Nov 04 2015 05:55
@bomholt sounds like a good plan. if you're a freelance web developer with a decent supply of work, it makes moving elsewhere very easy. all you need is a laptop and internet
@frogmorton yeah, i hear you. it's sort of an easy way to travel and work abroad if you're a native speaker, but it's not everyone's calling. that said, teaching english pays a lot in hong kong.
Craig Morrison
@frogmorton
Nov 04 2015 05:58
I wonder what the workload is like? My Japanese wife would never go for moving, even if I was open to it.
@h4r1m4u so, you are on FCC to learn new tools? MEAN stack?
h4r1m4u
@h4r1m4u
Nov 04 2015 06:01
@frogmorton i'm working on improving my javascript. i'm fluent in HTML / CSS and i know a decent amount of JS and jQuery too, but want to get better
if i lived in japan, i wouldn't want to move either :D
went there earlier this year and totally loved it
Craig Morrison
@frogmorton
Nov 04 2015 06:03
Gotcha, I'm through the intermediate bf's, and I noticed a big jump in my understanding and confidence with JS as well...
h4r1m4u
@h4r1m4u
Nov 04 2015 06:04
yeah, i breezed through those, but the ziplines were interesting
i'm now more looking at the more advanced stuff like modular javascript, how to properly structure your code in large projects, etc.
and the back-end / node.js should be good too. i've had some exposure to it, but not enough
Craig Morrison
@frogmorton
Nov 04 2015 06:05
I'm just frustrated that I can't dedicate more time to the FCC stuff, to get to the point where I'm employable. Yes, those topics deserve plenty of attention as well.
h4r1m4u
@h4r1m4u
Nov 04 2015 06:06
it must be really tough if you have a full-time job and family. but patience, you'll get there. it'll just take you longer
Craig Morrison
@frogmorton
Nov 04 2015 06:07
I know I t's not a race, and I should thoroughly understand the things I'm working with, but I feel I'm going at a snails pace...
Have you looked into the Clementine thing?
h4r1m4u
@h4r1m4u
Nov 04 2015 06:12
nope. what's that?
Craig Morrison
@frogmorton
Nov 04 2015 06:14
The boilerplate project framework for full stack JS projects. It was written by an FC Camper, and has officially been adopted by FCC for full stack projects
Google "clementinejs"
h4r1m4u
@h4r1m4u
Nov 04 2015 06:15
oh, ok. i haven't heard about it. i'll look it up. thanks for the suggestion @frogmorton
CamperBot
@camperbot
Nov 04 2015 06:15
h4r1m4u sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:star: 293 | @frogmorton | http://www.freecodecamp.com/frogmorton
Craig Morrison
@frogmorton
Nov 04 2015 06:16
Quincy and company have announced it publicly and it was a topic on one of their videos
You're welcome
Jorine Bryan Agua
@mongos134
Nov 04 2015 06:25

guys.. what's wrong with this.. its for nesting anchor

<p> View more <a href="freecatphotoapp.com"> cat photos</a> for you to follow</p>

h4r1m4u
@h4r1m4u
Nov 04 2015 06:26
@mongos134 looks like you modified the URL part in the <a> tag. see what it looked like initially when you loaded the waypoint and make sure you don't change it
Michael Bomholt
@bomholtm
Nov 04 2015 06:26
This message was deleted
h4r1m4u
@h4r1m4u
Nov 04 2015 06:26
(it should include the http:// bit)
Jorine Bryan Agua
@mongos134
Nov 04 2015 06:27
it was the same with what was given..
Craig Morrison
@frogmorton
Nov 04 2015 06:28
Well, add it, just for kicks and grins ;-)
Michael Bomholt
@bomholtm
Nov 04 2015 06:28
:smile:
Afshin Malek
@afshinmalek
Nov 04 2015 06:28
Hi, anybody knows how to do this:

var Car = function() {
// this is a private variable
var gear = 1;
// this is a private function (also known as a private method)
function addStyle(styleMe){
return 'The Current Gear Is: ' + styleMe;
}
// this is a public method
this.getGear = function() {
return addStyle(this.gear);
};

};

var Bike = function() {

// Only change code below this line.

this.speed = 100;

function addUnit(value) {
return value + "KM/H";
}

getSpeed = function () {
return addUnit(speed);
};

};

// Only change code above this line.

var myCar = new Car();

var myBike = new Bike();

if(myBike.hasOwnProperty('getSpeed')){(function() {return JSON.stringify(myBike.getSpeed());})();}

See if you can keep myBike.speed and myBike.addUnit private, while making myBike.getSpeed publicly accessible
srinivas
@srinivasdasu
Nov 04 2015 06:30
@traisna You have to enter text between open tag of P and closing tag of P . For Example: <p>some text <a></a></p>
Jorine Bryan Agua
@mongos134
Nov 04 2015 06:32

its says here that
Your a element should be nested within your new p element.
Your p element should have the text "View more " (with a space after it).

for this

<p class="red-text"> View more <a href="freecatphotoapp.com">cat photos</a> for you to follow.</p>

Michael Bomholt
@bomholtm
Nov 04 2015 06:39

@mongos134 it says... Here's an example:

<p>Here's a <a href="http://freecodecamp.com"> link to Free Code Camp</a> for you to follow.</p>

h4r1m4u
@h4r1m4u
Nov 04 2015 06:40
@mongos134 i already told you. the URL inside the <a> is wrong
it needs to be the same as the initial code
Michael Bomholt
@bomholtm
Nov 04 2015 06:40
just add the http:// like @h4r1m4u told you and you are fine
h4r1m4u
@h4r1m4u
Nov 04 2015 06:40
it won't pass without it
ldeschepper11
@ldeschepper11
Nov 04 2015 06:46

@mongos134 , I too am seeing that bug. This is what I have and I'm still seeing it as a fail:

<p>View more
<a href="freecatphotoapp.com">
cat photos
</a>
</p>

Has this been bugged?
Ronald Jarin
@ronaldjarin
Nov 04 2015 06:47
hi can anyone help with bonfire Make A Person?
Jorine Bryan Agua
@mongos134
Nov 04 2015 06:47
thanks guys...
CamperBot
@camperbot
Nov 04 2015 06:47
if you want to thank someone, put an @ before their name!
Jorine Bryan Agua
@mongos134
Nov 04 2015 06:47
thanks @h4r1m4u and @bomholt
CamperBot
@camperbot
Nov 04 2015 06:47
mongos134 sends brownie points to @h4r1m4u and @bomholt :sparkles: :thumbsup: :sparkles:
:star: 422 | @bomholt | http://www.freecodecamp.com/bomholt
:star: 505 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 04 2015 06:48
@ldeschepper11 same as @mongos134 do not modify the <a> tag or anything that's in it that's given you by the waypoint
it needs to look the same
ldeschepper11
@ldeschepper11
Nov 04 2015 06:49
@h4r1m4u thanks!
CamperBot
@camperbot
Nov 04 2015 06:49
ldeschepper11 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 506 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
ldeschepper11
@ldeschepper11
Nov 04 2015 06:56
Ok, now I'm having trouble on the same exercise, but with this criteria:
"Your p element should have the text "View more " (with a space after it)."
I clearly have a space after "more", but it won't pass
any suggestions?
this is my code: <p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>
srinivas
@srinivasdasu
Nov 04 2015 06:57
@ldeschepper11 <p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>
after view more you have to give space
Bill
@kirah1314
Nov 04 2015 06:57
@ldeschepper11 post your full codes?
ldeschepper11
@ldeschepper11
Nov 04 2015 06:58
@srinivasdasu I have a space after "more"
ok, let me post all

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

<a href="http://www.freecatphotoapp.com">cat photos</a>

<img class="smaller-image thick-green-border" 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>

<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>

Bill
@kirah1314
Nov 04 2015 06:58
@ldeschepper11 you can't add a new <p>, edit the line under h2
ldeschepper11
@ldeschepper11
Nov 04 2015 06:58
@kirah1314 it's the last <p> tag that's giving me trouble.
h4r1m4u
@h4r1m4u
Nov 04 2015 06:59
@ldeschepper11 you need to nest the original <a> (just under the <h2> tag). not add another <p> with <a> in it
as @kirah1314 says
ldeschepper11
@ldeschepper11
Nov 04 2015 06:59
@kirah1314 that totally worked!!!
I didn't 'check the whole code. Thank you so much
CamperBot
@camperbot
Nov 04 2015 06:59
if you want to thank someone, put an @ before their name!
Bill
@kirah1314
Nov 04 2015 06:59
yeah many people
do this, I think there's a git to add comments not to make changes under that line of code
@ldeschepper11 :thumbsup:
Elliott McNary
@bighitbiker3
Nov 04 2015 07:11
can someone point in a better way of doing this bonfire? I passed the challenge, but my code isn't universal
function truncate(str, num) {


 if (str.length <= 15) {
    newStr = str.slice(0, -(num));
  }
   else if (str.length > num) {
    newStr = str.slice(0, (num - str.length - 3));
  }
  else if (str.length <= num){
    return str;
  }

  return newStr + "...";
}

truncate("A-tisket a-tasket A green and yellow basket", 11);
Elliott McNary
@bighitbiker3
Nov 04 2015 07:22
edited to this but i imagine this isn't the most efficient haha
function truncate(str, num) {


 if (str.length - num < 0) {
    return str;
  }
  else if (str.length == num) {
    return str;
  }
   else if (str.length - num < 3){
     newStr = str.slice(0, (num - str.length));
   }
   else if (str.length > num) {
    newStr = str.slice(0, (num - str.length - 3));
  }
  else if (str.length <= num){
    return str;
  }

  return newStr + "...";
}

truncate("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length);
Bryan Hatton
@bryan-hatton
Nov 04 2015 07:44
@bighitbiker3 There are only three main behaviors, so you shouldn't need that many branches - give me a bit to go through this
Michael Bomholt
@bomholtm
Nov 04 2015 07:49
@bighitbiker3 you only need 2 specific cases (str.length <= num) and (num <= 3) ... every other case works with return str.slice(0, num - 3) + '...';
Bryan Hatton
@bryan-hatton
Nov 04 2015 07:50
if (str.length - num < 0 ) {
   return str;
} else if (str.length == num) {
   return str;
} else if {str.length <= num) {
   return str;
}
can collapse into
if (str.length <= num ) {
   return str;
}
Elizabeth Hatleli
@TheHighPriestess
Nov 04 2015 07:50
I still haven't been able to figure out how to let the computer know that the human player is done matching the computer generated array in the Simon game. The way I have it now...it doesn't work..because each time..the human's clicks gets longer
Elizabeth Hatleli
@TheHighPriestess
Nov 04 2015 07:55
I feel that...right now...I will not be able to do this without creating some sort of check button that the user must enter after he's done trying to match the computer's sequence
After re-reading the Zipline's instructions...this seems to be OK...based on the user stories
Elizabeth Hatleli
@TheHighPriestess
Nov 04 2015 08:01
Of course...it won't be the classic Simon game...but something similar.
It's either that...or I will have to learn from someone else's code. ...which is probably the best idea.
D/S
@dantesolis
Nov 04 2015 08:06
Good morning peeps I’m having problems with the Bonfire Repeat a string challenge. Here is my code
function repeat(str, num) {
  // repeat after me
  var emptyStr = "";
  var negNum = num < 0;
  var repeatedStr = str * num;

  if(negNum) {
    return emptyStr;
   } else {
    return repeatedStr;
   }
}

repeat("abc", 3);
I get an NaN error
h4r1m4u
@h4r1m4u
Nov 04 2015 08:08

@TheHighPriestess here's a suggestion:

$("#yellow").on("click",function(){
  yellow();
  var idToFunc = yellow;
  if(idToFunc == compArray[count]){
    console.log("yay");
    count++;
    playSimon();
  }
  else{
    console.log("you lose");
  }
});

extract the game logic from the click handlers. put all the game logic in the playSimon() function. a) generally it's a bad idea to mix your code logic with click handlers - each block of code should be only responsible for a small, self-contained task, and b) it'll allow you to adhere to the DRY principle - you won't have to repeat yourself in each of the button click handlers. everything will be in one place - the playSimon() function

the human is done playing if the click counter matches the length of the compArray
so that's something that you need work into your playSimon() function
Elizabeth Hatleli
@TheHighPriestess
Nov 04 2015 08:10
@h4r1m4u ok...I will try that
I know that my problem is related to how I originally set this up...
D/S
@dantesolis
Nov 04 2015 08:11
modified code.. still one test is not passing :
function repeat(str, num) {
  // repeat after me
  var emptyStr = "";
  var negNum = num < 0;
  var repeatedStr = str.repeat(num);

  if(negNum) {
    return emptyStr;
   } else {
    return repeatedStr;
   }
}

repeat("abc", 3)
h4r1m4u
@h4r1m4u
Nov 04 2015 08:11
@dantesolis i don't think you can multiply strings in JS. that's what's giving you NaN
Elizabeth Hatleli
@TheHighPriestess
Nov 04 2015 08:11
@h4r1m4u Thank you. The honey badger comes through once again
CamperBot
@camperbot
Nov 04 2015 08:11
thehighpriestess sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 507 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
D/S
@dantesolis
Nov 04 2015 08:12
Thanks @h4r1m4u
but I modified the code. Still I do not get the empty string if num is negative
@h4r1m4u thanks
CamperBot
@camperbot
Nov 04 2015 08:12
dantesolis sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 508 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 04 2015 08:14
@TheHighPriestess you're welcome. it should be too complicated to do what i'm suggesting with the code you have. with only the playSimon() function being responsible for the game logic, it should be fairly easy for you to come with an algorithm that decides whether the game is over, whether the human turn continues, or whether the computer should play. all based on the count variable and the compArray
stoked you recognized the badger!
Elizabeth Hatleli
@TheHighPriestess
Nov 04 2015 08:15
honey badgers are cool!
h4r1m4u
@h4r1m4u
Nov 04 2015 08:16
way too cool!
@dantesolis it's failing with the negative numbers because of this line: var repeatedStr = str.repeat(num);
the str.repeat() function does not take negative arguments
you should call this function only if num > 0
D/S
@dantesolis
Nov 04 2015 08:26
Thank you @h4r1m4u still not passing and trying to make it pass, but thanks for the hint
CamperBot
@camperbot
Nov 04 2015 08:26
dantesolis sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: dantesolis already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Nov 04 2015 08:27
@dantesolis post your updated code, i can have a look at it
D/S
@dantesolis
Nov 04 2015 08:28
@h4r1m4u I think I just circumvented the problem without fixing it. Here is the updated code
function repeat(str, num) {
  // repeat after me
  var emptyStr = "";
  var negNum = num < 0;
  var newRepeatedStr = str.repeat(num);
  function repeatedStr(str, num) {
    if(num > 0) {
      return newRepeatedStr;
    }
  }

  if(negNum) {
    return emptyStr;
   } else {
    return newRepeatedStr;
   }
}

repeat("abc", 3);
h4r1m4u
@h4r1m4u
Nov 04 2015 08:28
that's way too complicated! there's a much easier fix
Elizabeth Hatleli
@TheHighPriestess
Nov 04 2015 08:29
I know that my difficulties with the Simon game are due to the fact that I didn't properly think things through before I started coding. So, my advice would be....ALWAYS think it through well..FIRST..before you start writing the actual code. If you don't...it could take years off your life.
I have learned my lesson
h4r1m4u
@h4r1m4u
Nov 04 2015 08:30
@dantesolis all you had to do was to move one line of code
D/S
@dantesolis
Nov 04 2015 08:31
ok. let me see if I can figure it out, if not I’ll be asking for help. Once again Thanks @h4r1m4u
CamperBot
@camperbot
Nov 04 2015 08:31
dantesolis sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: dantesolis already gave h4r1m4u points
Michael Bomholt
@bomholtm
Nov 04 2015 08:31
im looking for two simple icons.. one to represent web development and one to represent mobile development. they should be kinda the same style and free to use. do you guys have any suggestions?
Michael Bomholt
@bomholtm
Nov 04 2015 08:38
@h4r1m4u i already use the mobile one with the desktop and tablet icon to show of the optimization of the web dev projects
and i will use the apple android and windows for the mobile dev portfolio section
so im looking for an icon to represent the whole sections
h4r1m4u
@h4r1m4u
Nov 04 2015 08:42
hmm, i think the 'globe' or the 'wrench' works for the web. for mobile maybe you could use 'cog' or 'battery-full'?
or 'wifi'?
Ankit Panwar
@coderNoob
Nov 04 2015 08:45
@h4r1m4u The font URLs that you mentioned, how and where do you find such resources?
h4r1m4u
@h4r1m4u
Nov 04 2015 08:47
@coderNoob font awesome is fairly well known. it's mentioned in the FCC waypoints as well. but there are others, e.g. http://ionicons.com/. if you google for 'icon font', you'll find more
Ankit Panwar
@coderNoob
Nov 04 2015 08:47
@h4r1m4u And they are free to use on our sites/projects?
h4r1m4u
@h4r1m4u
Nov 04 2015 08:48
@coderNoob some are, some are commercial. i usually end up using FA and that one is free
Ankit Panwar
@coderNoob
Nov 04 2015 08:49
@h4r1m4u Well thanks for the awesome resource.
CamperBot
@camperbot
Nov 04 2015 08:49
codernoob sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 509 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Soumya Rauth
@soumyaRauth
Nov 04 2015 08:49
Bonfire: Sorted Union
CamperBot
@camperbot
Nov 04 2015 08:49

:fire:Bonfire: Sorted Union :link:

function unite(arr1, arr2, arr3) {
  return arr1;
}

unite([1, 2, 3], [5, 2, 1, 4], [2, 1]);

Write a function that takes two or more arrays and returns a new array of unique values in the order of the original provided arrays.

more info:  bf details | bf links | hint

h4r1m4u
@h4r1m4u
Nov 04 2015 08:49
sure thing
Mistereo
@Mistereo
Nov 04 2015 08:52
@coderNoob what if user deny access to geolocation?
Ankit Panwar
@coderNoob
Nov 04 2015 08:53
@Mistereo A message "Your browser will not let us know your location." will be displayed.
Mistereo
@Mistereo
Nov 04 2015 08:53
@coderNoob nope.
Ankit Panwar
@coderNoob
Nov 04 2015 08:53
hmm
Mistereo
@Mistereo
Nov 04 2015 08:53
@coderNoob it will be displayed only if browser don't support geolocation
Ankit Panwar
@coderNoob
Nov 04 2015 08:53
Yes
Need to work on it.
What else
Mistereo
@Mistereo
Nov 04 2015 08:55
@coderNoob it's better to show weather without pressing the button.
@coderNoob strange thing happens when I try to press "No this unit !" multiple times.
h4r1m4u
@h4r1m4u
Nov 04 2015 08:57
i personally like the button. it's kinda inviting to click on it
Ankit Panwar
@coderNoob
Nov 04 2015 08:57
@Mistereo Strange how?
Mistereo
@Mistereo
Nov 04 2015 08:58
@h4r1m4u but it's unnecessary action.
@coderNoob try it, and see what happens with temperature :)
Ankit Panwar
@coderNoob
Nov 04 2015 08:59
@Mistereo It's functioning as desired. Clicking it converts the weather unit to F to C and vice versa.
Mistereo
@Mistereo
Nov 04 2015 08:59
@coderNoob oh, it's ok now, did you fixed that just right now? :)
Ankit Panwar
@coderNoob
Nov 04 2015 08:59
@Mistereo Nope. Changed nothing.
Mistereo
@Mistereo
Nov 04 2015 09:00
ok, strange :) @coderNoob
oh, I found why @coderNoob
@coderNoob try to reaload page and press blue button multiple times before temperature appears, and then try "Not this unit!"...
Ankit Panwar
@coderNoob
Nov 04 2015 09:03
@Mistereo Still nothing bro. The page simply reloaded with the "What's the weather like today ?!" button at the center.
Mistereo
@Mistereo
Nov 04 2015 09:03
@coderNoob ok, a minute :)
Ankit Panwar
@coderNoob
Nov 04 2015 09:10
@Mistereo This was exactly what was happening when I started on this Zipline. But I had fixed it. Hmmm.
@Mistereo The issue was with the formula that I had used for the unit conversion.
Soumya Rauth
@soumyaRauth
Nov 04 2015 09:23
Yeahhhhh!!!!!!!!!!!!!
Elliott McNary
@bighitbiker3
Nov 04 2015 09:28
@bryan-hatton thank you! I also was able to condense
if (str.length <= num|str.length - num < 0 ) {
   return str;
}
CamperBot
@camperbot
Nov 04 2015 09:28
bighitbiker3 sends brownie points to @bryan-hatton :sparkles: :thumbsup: :sparkles:
:star: 202 | @bryan-hatton | http://www.freecodecamp.com/bryan-hatton
D/S
@dantesolis
Nov 04 2015 10:18
@h4r1m4u I can’t figure it out man
h4r1m4u
@h4r1m4u
Nov 04 2015 10:18
@dantesolis what's the code you have now?
D/S
@dantesolis
Nov 04 2015 10:18
the same one
function repeat(str, num) {
  // repeat after me
  var emptyStr = "";
  var negNum = num < 0;
  var repeatedStr = str.repeat(num);

  if(negNum) {
    return emptyStr;
   } else {
    return repeatedStr;
   }
}

repeat("abc", 3);
h4r1m4u
@h4r1m4u
Nov 04 2015 10:20
ok, so you know that the issue is with this line: var repeatedStr = str.repeat(num); because you cannot pass negative argument to the repeat function, yeah? @dantesolis
Elliott McNary
@bighitbiker3
Nov 04 2015 10:20
hey guys...trying to chunk these arrays and am having trouble...right now it's only spitting out the first array
function chunk(arr, size) {


  for (i = 0; arr.length > i; i+=size) {
  var sArr = arr.slice(i, i + size);
    return sArr;
  }


}

chunk([0, 1, 2, 3, 4, 5], 3);
D/S
@dantesolis
Nov 04 2015 10:21
yes. But I cannot get it to work. Ok, maybe I need some coffee first. Let me step out of my pc for awhile and try this again
h4r1m4u
@h4r1m4u
Nov 04 2015 10:21
@dantesolis no, let's do this
it's simple
D/S
@dantesolis
Nov 04 2015 10:21
ok so
I don’t know how to tackle it. I tried inverting the function but it didn’t work
h4r1m4u
@h4r1m4u
Nov 04 2015 10:22
ok, so you now that you cannot use that line of code in the position where it is, because it'll break if num < 0
do you have some code block already in the function that will run only if num > 0?
D/S
@dantesolis
Nov 04 2015 10:22
yes
h4r1m4u
@h4r1m4u
Nov 04 2015 10:22
which code block is that?
D/S
@dantesolis
Nov 04 2015 10:23
figured it out man
h4r1m4u
@h4r1m4u
Nov 04 2015 10:23
are you facepalming right now? :D
D/S
@dantesolis
Nov 04 2015 10:23
@h4r1m4u THANKS!!!! You deserved major, MAJOR brownie points
CamperBot
@camperbot
Nov 04 2015 10:23
dantesolis sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
D/S
@dantesolis
Nov 04 2015 10:23
hahaha
CamperBot
@camperbot
Nov 04 2015 10:23
:star: 511 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 04 2015 10:23
:D nice work
D/S
@dantesolis
Nov 04 2015 10:24
major facepalming. Thanks man, really
CamperBot
@camperbot
Nov 04 2015 10:24
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Nov 04 2015 10:24
you betcha, any time
Ankit Panwar
@coderNoob
Nov 04 2015 10:24
In my quote machine, the background seems to be repeating at the bottom even though I set it to no-repeat and how do I fix the position of the button?
http://codepen.io/coderNoob/pen/MaepdX
h4r1m4u
@h4r1m4u
Nov 04 2015 10:33
@coderNoob it seems like you fixed the background issue. what's the problem with the button?
Ankit Panwar
@coderNoob
Nov 04 2015 10:33
@h4r1m4u It's jumping up and down. Trying to fix it.
Aniruddh Agarwal
@anrddh
Nov 04 2015 10:34
@coderNoob It's because of the quotes
h4r1m4u
@h4r1m4u
Nov 04 2015 10:34
ah, that's because depending on the length of the quote the buttons get pushed around. you'll want to position it absolutely in relation to the jumbotron
Aniruddh Agarwal
@anrddh
Nov 04 2015 10:35
^ what he said
Elizabeth Hatleli
@TheHighPriestess
Nov 04 2015 10:37
Is there some reason people include an .ogg AND an .mp3 file??
Ankit Panwar
@coderNoob
Nov 04 2015 10:38
sigh still couldn't work it out. It's still jumping up and down.
h4r1m4u
@h4r1m4u
Nov 04 2015 10:39
not all browsers play the formats. but if you include both of them, you're pretty safe because a browser not playing mp3 will typically play ogg and vice versa @TheHighPriestess https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats
Elizabeth Hatleli
@TheHighPriestess
Nov 04 2015 10:41
@h4r1m4u thanks
h4r1m4u
@h4r1m4u
Nov 04 2015 10:41
@coderNoob
.jumbotron {
  position:relative;
}
.onlyButt {
  position: absolute;
  bottom: 20px;
  left: 50%;
}
jpjenkins
@jpjenkins
Nov 04 2015 10:44
I found a bug in one of the bonfires, what should I do?
Ankit Panwar
@coderNoob
Nov 04 2015 10:44
@h4r1m4u Thanks. Jumbotron's position: relative did the trick. And I've noticed with many elements when I try to center them horizontally by left:50%; right:50% the elements are never really centered. Why?
CamperBot
@camperbot
Nov 04 2015 10:44
codernoob sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 512 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
jpjenkins
@jpjenkins
Nov 04 2015 10:45
ah, I found the github issue thang
h4r1m4u
@h4r1m4u
Nov 04 2015 10:45
@coderNoob left: 50%; sets the left edge of the element at the 50% width of its containers. since the element itself has some width, you need to take that into account
Muhammed Gamal
@JimyAllam
Nov 04 2015 10:46
blob
what i should do .... is it a bug ??/
h4r1m4u
@h4r1m4u
Nov 04 2015 10:49
@JimyAllam you need to keep the original code in (the container-fluid div). it won't pass without it:
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <!-- add the row here -->
</div>
Muhammed Gamal
@JimyAllam
Nov 04 2015 10:49
yeah sry :D
h4r1m4u
@h4r1m4u
Nov 04 2015 10:49
generally for all the waypoints, you don't want to mess with the code that's in the code pane by default. usually you just need to add something to it
Muhammed Gamal
@JimyAllam
Nov 04 2015 10:52
still wrong
blob
h4r1m4u
@h4r1m4u
Nov 04 2015 10:52
compare the code above with your code
Elliott McNary
@bighitbiker3
Nov 04 2015 10:53
trying to chunk this out and need some help. I can only get the loop to return the first array...
function chunk(arr, size) {


  for (i = 0; arr.length > i; i+=size) {
  var sArr = arr.slice(i, i + size);
    return sArr;
  }


}

chunk([0, 1, 2, 3, 4, 5], 3);
h4r1m4u
@h4r1m4u
Nov 04 2015 10:55
@bighitbiker3 you cannot return from a for loop. if you do that, the for loop will stop as soon it hits the return statement (hence it'll run only one pass)
Muhammed Gamal
@JimyAllam
Nov 04 2015 10:55
solved :D
Elliott McNary
@bighitbiker3
Nov 04 2015 10:56
@h4r1m4u damnit i keep messing that up! thank you
CamperBot
@camperbot
Nov 04 2015 10:56
bighitbiker3 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 513 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 04 2015 10:56
instead you should store the chunks into one variable and then return the variable all the way at the end
after the for loop finishes
you're welcome
Elliott McNary
@bighitbiker3
Nov 04 2015 11:05

@h4r1m4u just to learn...why does this work

function chunk(arr, size) {

  sArr = [];
  for (i = 0; arr.length > i; i += size){
    sArr.push(arr.slice(i, i + size));
  }
  return sArr;
}

chunk(["a", "b", "c", "d"], 2);

and not this? (I changed the i in the for loop to size to tell it when to stop)

function chunk(arr, size) {

  sArr = [];
  for (i = 0; arr.length > size; i += size){
    sArr.push(arr.slice(i, i + size));
  }
  return sArr;
}

chunk(["a", "b", "c", "d"], 2);
jpjenkins
@jpjenkins
Nov 04 2015 11:06
because the array modifies
A while loop would be more appropriate
Elliott McNary
@bighitbiker3
Nov 04 2015 11:07
it's because the loop won't ever run right? because it's reading the arr. length as 4 which is already > 2
@jpjenkins what would the while loop look like
jpjenkins
@jpjenkins
Nov 04 2015 11:07
while(arr.length > 0) {
@bighitbiker3 pretty much
Lê Viết Hoàng Dũng
@nangtrongvuon
Nov 04 2015 11:08

i'm having trouble with the "finding largest number in 2d array"..

here is what I have so far:

function largestOfFour(arr) {

for (var i = 0; i < arr.length; i++) {

  for (var j = 0; j < arr[i].length; i++) {
    var largest = 0;
    if (largest < arr[i][j]) {
      arr[i][j] = largest;
    }

    return largest;
  }

}


}


largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
jpjenkins
@jpjenkins
Nov 04 2015 11:08
you'll need to change your slice parameters though
Muhammed Gamal
@JimyAllam
Nov 04 2015 11:08
blob
Elliott McNary
@bighitbiker3
Nov 04 2015 11:08
@jpjenkins hmm okay let me try that
Lê Viết Hoàng Dũng
@nangtrongvuon
Nov 04 2015 11:09
i kind of have pseudo code out. but i don't know how to translate it into js
jpjenkins
@jpjenkins
Nov 04 2015 11:10
@nangtrongvuon do you remember the .sort function?
helps a lot in this case...
remember there are rules when sorting numbers since it sorts it with unicode and not the actual number value, check out .sort on mozilla page
Lê Viết Hoàng Dũng
@nangtrongvuon
Nov 04 2015 11:11
@jpjenkins that is brilliant, i'll look into that, thanks
CamperBot
@camperbot
Nov 04 2015 11:11
nangtrongvuon sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
:star: 199 | @jpjenkins | http://www.freecodecamp.com/jpjenkins
jpjenkins
@jpjenkins
Nov 04 2015 11:12
you're welcome :)
Elliott McNary
@bighitbiker3
Nov 04 2015 11:12
@JimyAllam remember that you have to close each element
housing one element inside another means that the parent element closes after the child element is closed
<div class="row"></div>
<div class="col-xs-4></div>

isn't the same as

<div class="row">
<div class="col-xs-4></div>
</div>

in the second one the col-xs-4 class is housed inside the row div. making the row div the parent and the col-xs the child

sorry they should look like this:
<div class="row"></div>
<div class="col-xs-4"></div>
<div class="row">
<div class="col-xs-4"></div>
</div>
Andrew
@fastpock
Nov 04 2015 11:17
@nangtrongvuon

@nangtrongvuon function largestOfFour(arr) {
var largest = 1;
for (var i = 0; i < arr.length; i++) {
for (var j = 0; j < arr[i].length; j++) {
if (largest < arr[i][j]) {
largest = arr[i][j];
}
}

}
return largest;
}

console.log(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]));

Esteban
@fr0gs
Nov 04 2015 11:20
Hello, is there any possibility to talk to technical support of FCC? I could not find any contact email
Du Do
@vaan1990
Nov 04 2015 11:23
<form id="cat-photo-app" 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>
hi guys, i am trying to give my form element id, is this correct?
Vyacheslav
@Fitzjerald
Nov 04 2015 11:24
Esteban
@fr0gs
Nov 04 2015 11:24
@Fitzjerald thx !
CamperBot
@camperbot
Nov 04 2015 11:24
fr0gs sends brownie points to @fitzjerald :sparkles: :thumbsup: :sparkles:
:star: 200 | @fitzjerald | http://www.freecodecamp.com/fitzjerald
Du Do
@vaan1990
Nov 04 2015 11:25
nvm i got it :D
Z.G.Hao
@akidox
Nov 04 2015 11:34
how a set of .col-md-* looks like?
Lê Viết Hoàng Dũng
@nangtrongvuon
Nov 04 2015 11:35
@fastpock how is it different if it's 1 and not 0?
Andrew
@fastpock
Nov 04 2015 11:41
@nangtrongvuon No difference 0 or 1
@nangtrongvuon the error in this line largest = arr[i][j];
@nangtrongvuon It was arr[i][j]=largest;
Craig Morrison
@frogmorton
Nov 04 2015 11:45
@akidox you mean how does the code look?
Z.G.Hao
@akidox
Nov 04 2015 11:46
yes,just curious
Floris Warmenhoven
@FlorisWarmenhoven
Nov 04 2015 11:47
Quick question, is it 'nicer' to have a space between HTML5 elements and their text? Or is it nicer without. (So <h1> Hello World </h1> or <h1>Hello World</h1>)
With nicer I mean, common practise.
Spatz
@Spatzerny
Nov 04 2015 11:48
@FlorisWarmenhoven i'd say without
This message was deleted
i dont think i ever saw tags wrapped in spaces
Floris Warmenhoven
@FlorisWarmenhoven
Nov 04 2015 11:50
@Spatzerny Thank you for your answer. =)
CamperBot
@camperbot
Nov 04 2015 11:50
floriswarmenhoven sends brownie points to @spatzerny :sparkles: :thumbsup: :sparkles:
:star: 327 | @spatzerny | http://www.freecodecamp.com/spatzerny
Mellymoon
@Mellymoon
Nov 04 2015 11:56
Can someone help me understand this? What's the difference between
var flip = Math.floor(Math.random() (1 - 0 + 1)) + 0;
and
var flip = Math.floor(Math.random()
(2)) + 0;
if you're trying to store a 1 or 0? Why does FCC choose the former in the example?
jpjenkins
@jpjenkins
Nov 04 2015 12:01
addition happens before subtraction @Mellymoon
you would end up with 0 in (1-0+1)
0+1 = 1
1-1 = 0
Mellymoon
@Mellymoon
Nov 04 2015 12:06
If it comes out to 0, then how do you get anything other than 0 when multiplied by the random number that's generated? The (1-0+1) is what's in the example and they somehow can generate a 1 from it after the rounding function. I hope what I'm asking makes sense. @jpjenkins
Riley
@valsemusette
Nov 04 2015 12:07
hi! anyone know why i'd get the error message "$ is not defined"? trying to get through a very easy early part but i'm unable to submit because i keep getting that message
Mellymoon
@Mellymoon
Nov 04 2015 12:07
If it helps to know, this is #37 under "Basic Javascript" @jpjenkins
jpjenkins
@jpjenkins
Nov 04 2015 12:07
I'll go have a quick refresh :P
Mellymoon
@Mellymoon
Nov 04 2015 12:08
lol ok :)
jpjenkins
@jpjenkins
Nov 04 2015 12:11
sorry @Mellymoon now that I'm looking at it, I don't really understand it myself
here it says that it's a single integer inputted
but in the example, it has 2
What's it doing with those 2 numbers indeed hmmm
ah, I see it in the example now, it's multiplying them
Karolis
@Luomint
Nov 04 2015 12:13
failing recursion on my pomodoro clock, everything falls apart when the break starts 2nd time http://codepen.io/luomint/pen/NGBBaR
Mellymoon
@Mellymoon
Nov 04 2015 12:13
@jpjenkins Ahh. I see, the asterisk didn't copy-paste to the chatbox. Sorry for that confusion.
jpjenkins
@jpjenkins
Nov 04 2015 12:19
@Mellymoon I don't understand it either :/
I'll keep reading but if you find out I'd love to get my head around this
Mellymoon
@Mellymoon
Nov 04 2015 12:21
@jpjenkins Maybe it's one of things they chose for the sake of showing a point that I don't quite understand. Either way, I feel better that I'm not the only one stumped. :P
@jpjenkins Thanks so much for trying to help me! :)
CamperBot
@camperbot
Nov 04 2015 12:21
mellymoon sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
:star: 200 | @jpjenkins | http://www.freecodecamp.com/jpjenkins
jpjenkins
@jpjenkins
Nov 04 2015 12:22
var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;

it's like

Math.floor(0) + 0;

which seems silly

ah no problem, let me know if you ever become unstumped :)
Mellymoon
@Mellymoon
Nov 04 2015 12:23
shrug It does work somehow, because when I ran it I got a 1. But I'll let you know :)
Z.G.Hao
@akidox
Nov 04 2015 12:23
In the waypoint of "add font awesome icons to our buttons",what it means that "they will assume the font size of their parent HTML elements"?
jpjenkins
@jpjenkins
Nov 04 2015 12:24
@akidox they're vector graphics, they will scale according to whatever size the font is for the element that you're in
so
what do you not understand actually? Is it the parent concept?
Z.G.Hao
@akidox
Nov 04 2015 12:31
your explanation is fine,thanks,that’s helpful @jpjenkins
CamperBot
@camperbot
Nov 04 2015 12:31
akidox sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
:star: 201 | @jpjenkins | http://www.freecodecamp.com/jpjenkins
h4r1m4u
@h4r1m4u
Nov 04 2015 12:31
@bighitbiker3 sorry, i was afk. as @jpjenkins suggested, as a general rule of thumb, never modify the arrays (or objects) you're iterating on. not even with the while loop. it can behave in really unpredictable ways.
you can always make a copy of the array/object before the iteration and modify that instead while keeping the original array/object intact
Z.G.Hao
@akidox
Nov 04 2015 12:43
so the bootstrap-grid’s row have 12 columns by default?
Aniruddh Agarwal
@anrddh
Nov 04 2015 12:43
Yep
Z.G.Hao
@akidox
Nov 04 2015 12:43
thank
CamperBot
@camperbot
Nov 04 2015 12:43
if you want to thank someone, put an @ before their name!
Z.G.Hao
@akidox
Nov 04 2015 12:48
if you put a col-xs-* class in your elements,what it will spreads out in a lap-top?
Oleg Cherkasky
@gunrunners-paradise
Nov 04 2015 12:50
Hey, can I get some advice on coding a zipline?
Z.G.Hao
@akidox
Nov 04 2015 12:50
we don’t need to change our code,do we?
Oleg Cherkasky
@gunrunners-paradise
Nov 04 2015 12:50
It's the Wikipedia search app
I'm trying to figure out a way to get it to start working, I don't know what part of the documentation helps with setting up a search.
h4r1m4u
@h4r1m4u
Nov 04 2015 12:51
@akidox this is the key: Grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes, and override grid classes targeted at smaller devices. Therefore, e.g. applying any .col-md-* class to an element will not only affect its styling on medium devices but also on large devices if a .col-lg-* class is not present. in other words, if you don't apply any .col-sm-, .col-md- or .col-lg-* on the same div, it'll behave the same across all screen sizes
Oleg Cherkasky
@gunrunners-paradise
Nov 04 2015 12:52
I'll come back later
Ankit Panwar
@coderNoob
Nov 04 2015 12:54
@h4r1m4u So in order to achieve a consistent behavior, we should add all three class? i.e. col-xs, md, and lg?
h4r1m4u
@h4r1m4u
Nov 04 2015 12:54
@coderNoob only if you want to change the layout on larger screens, otherwise the col-xs will kick in.
take this example: <div class="col-xs-12 col-md-6"></div>
on xs and sm screens it will be 12 cols wide (100% of the row). on md and lg screens it'll be 6 cols wide (50% of the row)
Z.G.Hao
@akidox
Nov 04 2015 12:56
looks I need some time to digest that,thanks a lot @h4r1m4u
CamperBot
@camperbot
Nov 04 2015 12:56
akidox sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 514 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 04 2015 12:57
bootstrap is mobile first, so a rule of thumb - start from the small screens and override the col classes only if you want the cols to look differently on larger screens
@akidox sure. ask if you need clarification
farnesi
@farnesi
Nov 04 2015 13:05
Hi everybody... I'm doing the lesson 35, but I couldn't solve it.
I didn't understand how to complete the checkpoint: Nest your text input element within a form element
h4r1m4u
@h4r1m4u
Nov 04 2015 13:08
@farnesi what have you tried and what do you not understand? do you have any code you could share?
farnesi
@farnesi
Nov 04 2015 13:09
I just put <form action="/submit-cat-photo"></form>
h4r1m4u
@h4r1m4u
Nov 04 2015 13:10
is it the Create a Form Element waypoint?
farnesi
@farnesi
Nov 04 2015 13:11
Yes
h4r1m4u
@h4r1m4u
Nov 04 2015 13:11
alright. so the assignment is: NEST YOUR TEXT FIELD in a form element. Add the action="/submit-cat-photo" attribute to this form element.
do you see a text field in the code provided to you by the waypoint?
farnesi
@farnesi
Nov 04 2015 13:12
Yes
h4r1m4u
@h4r1m4u
Nov 04 2015 13:12
alright. so your task is to nest in the form element
do you know what it means to nest an element?
farnesi
@farnesi
Nov 04 2015 13:13
No idea
h4r1m4u
@h4r1m4u
Nov 04 2015 13:13
ok. here's an example:
<p>
 <p>This is a paragraph nested in another paragraph</p>
</p>
'nest' means to 'put inside'
your goal is to put the input field inside the form
Z.G.Hao
@akidox
Nov 04 2015 13:16
the answer is I don’t need to add any classes targeted at larger devices if I don’t want the layout to change,right? @h4r1m4u
h4r1m4u
@h4r1m4u
Nov 04 2015 13:17
@akidox yeah, it goes from the bottom to the top. so if you set col-xs-12 on a div, it will automatically be 12 cols wide on all larger screens
unless you override it with a col class targeting the larger resolutions
jpjenkins
@jpjenkins
Nov 04 2015 13:18
which would probably be good practice no?
h4r1m4u
@h4r1m4u
Nov 04 2015 13:18
it really depends on your page layout and how you want it to behave
Z.G.Hao
@akidox
Nov 04 2015 13:19
got it,thanks again
CamperBot
@camperbot
Nov 04 2015 13:19
if you want to thank someone, put an @ before their name!
farnesi
@farnesi
Nov 04 2015 13:20
Thanks a lot @h41m4u
CamperBot
@camperbot
Nov 04 2015 13:20
farnesi sends brownie points to @h41m4u :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for h41m4u
h4r1m4u
@h4r1m4u
Nov 04 2015 13:20
@farnesi did you figure it out?
jpjenkins
@jpjenkins
Nov 04 2015 13:21
@farnesi if you tab the name once you start typing it's a lot easier, so you don't miss any letters :P
h4r1m4u @h4r1m4u was wondering who ate his cookie
farnesi
@farnesi
Nov 04 2015 13:21
Thanks again @h4r1m4u
CamperBot
@camperbot
Nov 04 2015 13:21
farnesi sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 515 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 04 2015 13:22
sure thing :)
Jason Wood
@catapixel
Nov 04 2015 13:22
This message was deleted
jpjenkins
@jpjenkins
Nov 04 2015 13:42
what's a good application to code javascript in?
I was using atom but it's a bit too sparse for me at the moment, though I'll probably go back to it later
loftyrama
@loftyrama
Nov 04 2015 13:42
@jpjenkins you mean a good Editor?
jpjenkins
@jpjenkins
Nov 04 2015 13:42
yeah, that's the word
loftyrama
@loftyrama
Nov 04 2015 13:42
I prefer Sublime Text
It's fast, highly customizable, useable for other things as well (HTML, RUBY, ... , etc)
jpjenkins
@jpjenkins
Nov 04 2015 13:44
it looks much the same as atom
almost identical
Matt Leonard
@matty22
Nov 04 2015 13:53
What do you need aside from the ability to type into it?
h4r1m4u
@h4r1m4u
Nov 04 2015 13:54
can it fly?
Jason Wood
@catapixel
Nov 04 2015 13:54
no but it can blend
h4r1m4u
@h4r1m4u
Nov 04 2015 13:55
hahahaha
jpjenkins
@jpjenkins
Nov 04 2015 14:01
how do I run the script?
in an editor
Arnis Jaundzeikars
@SangSatori
Nov 04 2015 14:02
I was using Sublime before primarily using Atom these days.
jpjenkins
@jpjenkins
Nov 04 2015 14:03
I'm a beginner folks, I know it's a stupid question
unfortunately atom doesn't have a big green 'run tests' button
though I'm still holding out for the inspirational quote and tick
Arnis Jaundzeikars
@SangSatori
Nov 04 2015 14:05
I think there might be/should be an Atom plugin that does that. At lest Brackets did have Gulp integration plugin (and Grunt, and whatever else too) -- I'm not a fan of Brackets though.
loftyrama
@loftyrama
Nov 04 2015 14:05
@jpjenkins you save the script (say, xyz.js) and run said script in an html file for example
you could just set up a basic html file and put a <script src="xyz.js"><script> in it
jpjenkins
@jpjenkins
Nov 04 2015 14:06
ah okay, I'm thinking back to my compile and run days
loftyrama
@loftyrama
Nov 04 2015 14:06
use console.log() or alert() to print things to your browser
jpjenkins
@jpjenkins
Nov 04 2015 14:06
yeah I had it all, except the html
loftyrama
@loftyrama
Nov 04 2015 14:07
if you just wanna script something real quick you could also just go into the chrome console and code in there without integrating a thing
or use jsbin.com
Arnis Jaundzeikars
@SangSatori
Nov 04 2015 14:10
I think there was some Atom package that allowed for live evaluation of JS code (a la Lighttable) by using Node.js processes. If you code in the browser, it's possible to ensure a browser window reloads code every time a code is modified and saved, but I find it more useful for CSS/JS than JavaScript. It's also tough to set up.
jpjenkins
@jpjenkins
Nov 04 2015 14:13
so does everyone here just do the code in the actual fcc editor then?
A few people had console.log in their code, I presumed that they were using an external editor
Arnis Jaundzeikars
@SangSatori
Nov 04 2015 14:14
You can view console.log messages in the browser's dev tools; they get logged to the console there.
h4r1m4u
@h4r1m4u
Nov 04 2015 14:15
i did all the waypoints and bonfires in the FCC editor directly. ziplines in codepen. for actual work i use sublime too
Matt Leonard
@matty22
Nov 04 2015 14:15
Waypoints/Bonfires in FCC editor, Ziplines in SublimeText
jpjenkins
@jpjenkins
Nov 04 2015 14:16
ah okay, thanks folks
CamperBot
@camperbot
Nov 04 2015 14:16
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Nov 04 2015 14:16
if i just need to quickly try something, jsfiddle.net is useful
jpjenkins
@jpjenkins
Nov 04 2015 14:17
nice website
have you completed the course @h4r1m4u
?
h4r1m4u
@h4r1m4u
Nov 04 2015 14:17
i've got the tic-tac-toe left from the front-end dev section. work got in the way
jpjenkins
@jpjenkins
Nov 04 2015 14:18
sweet, good luck :)
h4r1m4u
@h4r1m4u
Nov 04 2015 14:19
thanks :)
CamperBot
@camperbot
Nov 04 2015 14:19
if you want to thank someone, put an @ before their name!
Tanner
@dieb4udie
Nov 04 2015 14:20
How do I show you my code so you can help me?
Matt Leonard
@matty22
Nov 04 2015 14:21
explain format
CamperBot
@camperbot
Nov 04 2015 14:21

:point_right: code format [wiki]

Inline code

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

Code Block

``` ⇦ Type 3 backticks and then press [shift + enter ⏎]

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

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

How to Code

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

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

h4r1m4u
@h4r1m4u
Nov 04 2015 14:21
@dieb4udie you can post it here
ideally formatted as :point_up:
Tanner
@dieb4udie
Nov 04 2015 14:22

'''

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

<style>
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;

}
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

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

CamperBot
@camperbot
Nov 04 2015 14:22
:bulb: to format code use backticks! ``` more info
Tanner
@dieb4udie
Nov 04 2015 14:22

'''

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

<style>
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;

}
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

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

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

CamperBot
@camperbot
Nov 04 2015 14:22
:bulb: to format code use backticks! ``` more info
Kaoussi Souhail
@kaoussi
Nov 04 2015 14:22
hey, Can someone please help me with the private properties? I still can't understand them
jpjenkins
@jpjenkins
Nov 04 2015 14:22
@dieb4udie before and after. Also, they're backticks! Not normal apostrophes.
Matt Leonard
@matty22
Nov 04 2015 14:23

@dieb4udie ` not '

It's the same key as ~

jpjenkins
@jpjenkins
Nov 04 2015 14:23
On my keeyboard it's to the left of the '1' on the top row
everyone does it :P
Tanner
@dieb4udie
Nov 04 2015 14:23
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;

  }
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Ah, therew e go
h4r1m4u
@h4r1m4u
Nov 04 2015 14:24
@dieb4udie as to your issue, you need to apply the classes onto the existing <img>, not create a new one
jpjenkins
@jpjenkins
Nov 04 2015 14:24
congrats
h4r1m4u
@h4r1m4u
Nov 04 2015 14:24
<img class="some-class another-class" src="...">
Matt Leonard
@matty22
Nov 04 2015 14:24
I see the problem already. Your img classes need to be on the same tag as the <img src="">
h4r1m4u
@h4r1m4u
Nov 04 2015 14:24
here's a hint :point_up:
jpjenkins
@jpjenkins
Nov 04 2015 14:24
hehe
I've been struggling with this bonfire 'mutations' for a while folks
I keep staring, writing, wronging
it's crippled me
I finally got it to work, got my glorious tick
Tanner
@dieb4udie
Nov 04 2015 14:26
Still im doing something wrong
Matt Leonard
@matty22
Nov 04 2015 14:26
Life is all about the check marks!
Tanner
@dieb4udie
Nov 04 2015 14:27
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;

  }
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

<img class="smaller-image" "thick-green-border" 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>
jpjenkins
@jpjenkins
Nov 04 2015 14:27
but then I realised that, while it passed, it was wrong and it was just a loophole where the conditions don't thoroughly check the code. I started again but can't get my head around it, my original approach proved impossible.
you don't need multiple quotes @dieb4udie
Matt Leonard
@matty22
Nov 04 2015 14:27
Look at the "" marks in @h4r1m4u 's hint
jpjenkins
@jpjenkins
Nov 04 2015 14:27
img class="smaller-image thick-green-border" src="..."
Tanner
@dieb4udie
Nov 04 2015 14:28
Hallelujah
thanks!
CamperBot
@camperbot
Nov 04 2015 14:28
if you want to thank someone, put an @ before their name!
jpjenkins
@jpjenkins
Nov 04 2015 14:28
:)
function mutation(arr) {
  firstWord = arr[0].split('');  // splits first word into array.
  secondWord = arr[1].split(''); // splits second word into array.
  firstWord = firstWord.join('').toLowerCase().split(''); // lowercase all the things to the arrays
  secondWord = secondWord.join('').toLowerCase().split('');

    for(i=0 ;i < secondWord.length; i++){

        while(firstWord.indexOf(secondWord[i]) != -1) // checks second words letters with first.
      {
        i++;
      }
        if(i < (secondWord.length)){
          console.log('false'); } // if it didn't reach the end of the search,
        else{
            console.log('true');
      }

    } // close loop

}

mutation(["hello", "hellooS"]); // when the second words last letter isn't in the array...!
I was probably more complicated than I should have been
I know that a regex is needed /\w/i
I can't work out how I can then go through each of the characters within a given index
as you can see above, I created variables, my guess is that they are not needed
I don't know why my brain can't push through this
I fired off about 6 bonfires last night beautifully then this one came along to spoil the fun
Anyway, sorry, what I'm trying to understand is:
firstWord.indexOf[i](secondWord.indexOf[i] != /\w/i
jpjenkins
@jpjenkins
Nov 04 2015 14:33
that's the direction of my logic right now
Jason Wood
@catapixel
Nov 04 2015 14:34
@jpjenkins You've got the right idea. I did it nearly the same as you. You don't need the while loop inside your for loop
jpjenkins
@jpjenkins
Nov 04 2015 14:34
so you have lots of if and else statements to get the result?
to me it seems highly inefficient
My guess is there's a function needed, then iterating through with that function
Jason Wood
@catapixel
Nov 04 2015 14:35
No. You can put a return true; outside of your for loop at the end and just return false inside your for loop using an if conditional very similar to your while loop condition
jpjenkins
@jpjenkins
Nov 04 2015 14:36
ah right, of course
but what about this issue with creating variables at the top
I convert it to a string, is that what you did?
My guess is there's a way to do it without that and instead use a regex to scan through the index
that's what I want to understand
Jason Wood
@catapixel
Nov 04 2015 14:37
  var string1 = arr[0].toLowerCase().split('');
  var string2 = arr[1].toLowerCase().split('');
that's all you need. You can still call them firstWord and secondWord if you want
one other thing... on your for loop you need to declare i as a var to have proper form for (var i = 0; i < secondWord.length; i++) {
jpjenkins
@jpjenkins
Nov 04 2015 14:39
isn't that understood though?
it is in other languages
the loop itself creates the variable
Arnis Jaundzeikars
@SangSatori
Nov 04 2015 14:39
eval.png
In-editor JS evaluation with Hydrogen.
Which is a package for Atom.
jpjenkins
@jpjenkins
Nov 04 2015 14:40
ah beautiful
Jason Wood
@catapixel
Nov 04 2015 14:41
@jpjenkins the keyword var is significant for scope
Arnis Jaundzeikars
@SangSatori
Nov 04 2015 14:41
Selecting the lines desired and then evaluating them all at once produces the result where appropriate - it might be good for testing some algorithms, functions and the like. I'm going to keep tinkering with this.
More info on Hydrogen - it relies on Jupyter kernels, so it can support other languages as well.
jpjenkins
@jpjenkins
Nov 04 2015 14:42
@SangSatori just installed it, thanks :) so you can highlight a specific function and it runs in a little popup thing?
CamperBot
@camperbot
Nov 04 2015 14:42
jpjenkins sends brownie points to @sangsatori :sparkles: :thumbsup: :sparkles:
:star: 184 | @sangsatori | http://www.freecodecamp.com/sangsatori
jpjenkins
@jpjenkins
Nov 04 2015 14:42
@catapixel what's the difference?
Jason Wood
@catapixel
Nov 04 2015 14:44
@jpjenkins See Description Section Significant quote: "Because of these three differences, failure to declare variables will very likely lead to unexpected results. Thus it is recommended to always declare variables, regardless of whether they are in a function or global scope. And in ECMAScript 5 strict mode, assigning to an undeclared variable throws an error."
Arnis Jaundzeikars
@SangSatori
Nov 04 2015 14:44
@jpjenkins: Well, it evaluates the expression highlighted -- so if you do something like var myVar = true;, the result will be undefined because that's what var returns. You can select the lines and use Ctrl+Alt+Enter (on Windows, Linux) to evaluate that. Mind you, there are specific requirements -- you must run Atom from the working directory and you must have Jupyter and IJavaScript both installed. You can look up the specifics of that.
So it relies on external process, which it communicates via ZeroMQ. The process then evaluates the code and returns the result.
jpjenkins
@jpjenkins
Nov 04 2015 14:44
just watched the little gif on github, that looks really nice
Rory Smith
@alanbuchanan
Nov 04 2015 14:45
angular question: i am using a toast using angular material. it takes up a LOT of code in my project. i want to get it out the way without minifying or anything like that. i think i should be using a service or factory and then injecting that into my controller. is this a good way to handle it?
CamperBot
@camperbot
Nov 04 2015 14:45
:trollface: troll problems? notify admins here
jpjenkins
@jpjenkins
Nov 04 2015 14:45
instant feedback constantly for everything in your code
should be standard
Karolis
@Luomint
Nov 04 2015 14:45
I would appreciate if anyone had some ideas why my pomodoro clock starts acting weird after a while http://codepen.io/luomint/pen/NGBBaR
Shair Mir
@ShairMir
Nov 04 2015 14:48
<div class="intro-text">
    <h1>Game of Thrones</h1>
    <a class="btn btn-warning quoteButton" id="click">New Quote</a>
</div>
I am trying to make the anchor text change, by the following code. Anybody knows why it doesn't work?
$('#click').text('You know nothing..');
Jason Wood
@catapixel
Nov 04 2015 14:49
@Luomint The times are off for me on your clock. You shouldn't be able to go negative for one. I'd start looking there for the root of the strange behavior.
@ShairMir click is a reserved word. Just change the name of your ID and see if that solves your problem
Karolis
@Luomint
Nov 04 2015 14:51
yep
jpjenkins
@jpjenkins
Nov 04 2015 14:53
that code just crashed my browser, I think it's an infinite loop somewhere
my gitter process was going crazy
Shair Mir
@ShairMir
Nov 04 2015 14:54
@catapixel didn't do anything
Aleksander Gębicki
@Takumar
Nov 04 2015 14:54
@ShairMir I also thought about click name, but if it don't work do you attach jQuery correctly?
I pasted your code to CodePen and it changed text to: "You know nothing.."
Shair Mir
@ShairMir
Nov 04 2015 14:55
@Takumar Yes because everything else with jquery works. Im showing just a small part
Jason Wood
@catapixel
Nov 04 2015 14:55
@ShairMir I agree with @Takumar . There is nothing wrong with the code you are showing us
Shair Mir
@ShairMir
Nov 04 2015 14:56
@Takumar somebody suggested using append() instead of text..which does work but it doesnt remove the new quote text, just adds it behind that part
Shawn
@ShawnVB
Nov 04 2015 14:57

Can someone tell me what I'm doing wrong? h1 text should be pink, but it's not.<style>
body {
background-color: black;
font-family: Monospace;
color: green;}
.pink-text:{color:pink;}

</style>

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

Aleksander Gębicki
@Takumar
Nov 04 2015 14:57
@ShawnVB change body { to <style >
Rodrigo Fierro R.
@rodrigofierro
Nov 04 2015 14:58
anyone connected via an IRC client?... which network/channel?
Shair Mir
@ShairMir
Nov 04 2015 14:58
@Takumar Oh snap...your suggestion does work...i didnt save the file :D
@Takumar thanks!
CamperBot
@camperbot
Nov 04 2015 14:58
shairmir sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 620 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Nov 04 2015 14:58
@ShairMir :-) I just wanted to ask you for full code.
Byron Lagrone
@byronic
Nov 04 2015 14:58
actually @ShawnVB the issue is the : after .pink-text in your style definition
Shawn
@ShawnVB
Nov 04 2015 14:59
thank you!
CamperBot
@camperbot
Nov 04 2015 14:59
if you want to thank someone, put an @ before their name!
Byron Lagrone
@byronic
Nov 04 2015 14:59
a CSS class declaration looks like:
.class-name
{
   color: green;
}
Shawn
@ShawnVB
Nov 04 2015 14:59
thank you! @byronic
CamperBot
@camperbot
Nov 04 2015 14:59
shawnvb sends brownie points to @byronic :sparkles: :thumbsup: :sparkles:
:star: 228 | @byronic | http://www.freecodecamp.com/byronic
Aleksander Gębicki
@Takumar
Nov 04 2015 15:00
@byronic you are right, ':' is unnecessary after name of class.
jpjenkins
@jpjenkins
Nov 04 2015 15:02
@SangSatori how did you get it to install? I thought it was a success but no
I first installed it through the extensions section in atom, then I cloned it from github and did 'npm install hydrogen' but that didn't work
I'm not getting enough errors to reveal why it's failing :/
I see the issue, I don't have zeromq
Paul Morin
@paul5150
Nov 04 2015 15:07
I’ve been away from Codecamp awhile and wanted to restart form the beginning? Is there a way to clear out all my previous work? Apologize in advance if it’s obvious.
jpjenkins
@jpjenkins
Nov 04 2015 15:08
@paul5150 have you looked at your waypoints yet?
they may already be deleted
Esteban
@fr0gs
Nov 04 2015 15:08
Hello! I was wondering if it is possible to reduce an array in javascript using a logical and '&&' operator. I've been trying to check if all objects in array have the same property but I guess I am making a big mistake somehow:
```
Jason Wood
@catapixel
Nov 04 2015 15:09
@paul5150 the only way I can think of that might work would be to go to your profile page, at the bottom delete your account, and then sign up again
Esteban
@fr0gs
Nov 04 2015 15:09
  return collection.reduce(function (prev, cur) {
    return prev.hasOwnProperty(pre) && cur.hasOwnProperty(pre);
  });
If I just write
console.log(prev.hasOwnProperty(pre)
It writes true
So I don't know why at the end it shows "false"
Arnis Jaundzeikars
@SangSatori
Nov 04 2015 15:09
@jpjenkins: You need both ZeroMQ as well as Jupyter and Jupyter kernel for JavaScript.
Esteban
@fr0gs
Nov 04 2015 15:10
as all values are sepparately verified to be true , when I reduce them with and I get false
Jason Wood
@catapixel
Nov 04 2015 15:10
@fr0gs try wrapping both conditions inside parentheses
Cameron Bass
@cameronbass
Nov 04 2015 15:12

var Bike = function() {

// Only change code below this line.

this.speed = 100;

function addUnit(value) {
return value + "KM/H";
}

getSpeed = function () {
return addUnit(speed);
};

};

See if you can keep myBike.speed and myBike.addUnit private, while making myBike.getSpeed publicly accessible.
I don't understand what this wants?
jpjenkins
@jpjenkins
Nov 04 2015 15:14
@SangSatori I don't understand, I have everything install - python, ipython, zmq, jupyter and hydrogen
Esteban
@fr0gs
Nov 04 2015 15:14
@catapixel nothing. I can do it with a simple for loop but I kinda annoys me, Thanks anyway
CamperBot
@camperbot
Nov 04 2015 15:14
fr0gs sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 563 | @catapixel | http://www.freecodecamp.com/catapixel
Abhisek Pattnaik
@abhisekp
Nov 04 2015 15:15
@cameronbass
function ABC() {
    var xyz = 'something'; // private
    this.cad = 'something'; // public
}
var pqr = new ABC();
// xyz is inaccessible from outside
console.log(pqr.cad); // cad accessible from outside
jpjenkins
@jpjenkins
Nov 04 2015 15:15
how do I actually get it to work though? I have my code open, is there keybind I need to press to activate hydrogen or should it just work?
Cameron Bass
@cameronbass
Nov 04 2015 15:15
@abhisekp Thanks!
CamperBot
@camperbot
Nov 04 2015 15:15
cameronbass sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 823 | @abhisekp | http://www.freecodecamp.com/abhisekp
Roger K.
@misterhtmlcss
Nov 04 2015 15:18

Hi Guys, I’m trying my FCC skills (making up my own exercises basically). Trying to do a function, maybe an object too. I’d like to build a calculator (eventually) that I can use to calculate accumulated value from dividend stocks I own (so you know the goal).


var myLIQ = function(stockPrice, divYield, keepTime) {
    this.stockPrice = stockPrice;
    this.divYield = divYield;
    this.keepTime = keepTime;
}
stockPrice = prompt("What is the stock price? " + "");
divYield = prompt("How many shares do you get granted? " + "");
keepTime = prompt("What time period will you hold these shares? " + "");
var totalReturn = myLIQ((stockPrice * divYield) * keepTime); 
document.write(totalReturn);
Basically I had written it where it was like this too:
var myLIQ = function(stockPrice, divYield, keepTime) {
    this.stockPrice =  prompt("What is the stock price? " + "");
    this.divYield = prompt("How many shares do you get granted? " + "");
    this.keepTime = prompt("What time period will you hold these shares? " + "");
}
var totalReturn = myLIQ((stockPrice * divYield) * keepTime); 
document.write(totalReturn);

I thought I was on the write track with both (I failed and moved to the other and I had a couple more failures before this I can’t even remember - been at it a 2 hours :worried:((( - your help is appreciated).

All I am trying to achieve at this time is a prompt for each variable e.g. stockPrice and I’d like to do it as part of a Object and squeeze in as much fucntionality within the object… that’s the best way right? Layer in related functions within an object right? I believe this is a dataset and functionality I’d like in a single related Object if I was to code correctly, right?

Thanks for your help in advance!
Roger

Roma
@NPrayder
Nov 04 2015 15:19
jQuery task 13 please say what I must do
Roger K.
@misterhtmlcss
Nov 04 2015 15:20
@NPrayder tell us exactly what you don’t understand and we can help you to understand otherwise you won’t learn.
Roma
@NPrayder
Nov 04 2015 15:21
thay code, what false there
$(document).ready(function() {
$("#target1").parent().css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#left-well").parent().css("background-color","red");
});
Amal Farah
@afarah2
Nov 04 2015 15:22
I am on waypoint: use conditional logic with If and Else statements but I can not get the correct code. can someone work it out with me?
Cameron Bass
@cameronbass
Nov 04 2015 15:25

var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();

Add an engines property with a number value to the myCar instance.
I'm confused
Roger K.
@misterhtmlcss
Nov 04 2015 15:27
Hi @NPrayder not sure what you mean by False. THere is no Boolean question in that jQuery lesson
@cameronbass what you need to know in order to answer is what this.wheels is
Cameron Bass
@cameronbass
Nov 04 2015 15:28
@NPrayder Thanks!
CamperBot
@camperbot
Nov 04 2015 15:28
cameronbass sends brownie points to @nprayder :sparkles: :thumbsup: :sparkles:
:star: 124 | @nprayder | http://www.freecodecamp.com/nprayder
jpjenkins
@jpjenkins
Nov 04 2015 15:28
can someone give me a little advice: I'm running the atom editor and it pops up with 'no javascript kernel detected'. I have javascript kernels installed but don't know how to start them in atom
Isaac Maposa
@izemaps
Nov 04 2015 15:28
Am in the same predicament with you @afarah2 , need help on if and else statements
jpjenkins
@jpjenkins
Nov 04 2015 15:28
I presumed it would have just picked them up automatically
Roger K.
@misterhtmlcss
Nov 04 2015 15:30

@cameronbass
Here is an expansion on the topic from Mozilla…I’ve also pasted in the key part below the link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript

The property (object attribute)

Properties are variables contained in the class; every instance of the object has those properties. Properties are set in the constructor (function) of the class so that they are created on each instance.

The keyword this, which refers to the current object, lets you work with properties from within the class. Accessing (reading or writing) a property outside of the class is done with the syntax: InstanceName.Property. (Inside the class the syntax this.Property is used to get or set the property's value.)

In the example below, we define the firstName property for the Person class at instantiation:

var Person = function (firstName) {
  this.firstName = firstName;
  console.log('Person instantiated');
};

var person1 = new Person('Alice');
var person2 = new Person('Bob');

// Show the firstName properties of the objects
console.log('person1 is ' + person1.firstName); // logs "person1 is Alice"
console.log('person2 is ' + person2.firstName); // logs "person2 is Bob”

Let me know if you are still confused. Ok? If not then I’ll assume you figured it out.

@afarah2 can you drop me the URL and paste in your code? Use these (```) top left corner of your keyboard to surround your code above and below. Then I can help you.
Amal Farah
@afarah2
Nov 04 2015 15:35
Gladly, do you want me to surround the url with that?
Roger K.
@misterhtmlcss
Nov 04 2015 15:36
@jpjenkins what OS are you running? Also if it’s by chance on a MacOS and on a laptop I’d use a different program. Most people are experiencing battery issues on their laptops due to massive CPU usage on the current version. My Air went from 6+ hours to 2.5 with it running.
@afarah2 just the code. Thanks for double checking though.
CamperBot
@camperbot
Nov 04 2015 15:36
pythonlabsstudent sends brownie points to @afarah2 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for afarah2
Amal Farah
@afarah2
Nov 04 2015 15:36

```var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;

function myFunction() {

// Only change code below this line.
if (1 === 0) {

return heads;

} else ()=>{

return tails;

}

// Only change code above this line.

}

var result = myFunction();if(typeof(flip) !== "undefined" && typeof(flip) === "number" && typeof(result) !== "undefined" && typeof(result) === "string"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}```

Isaac Maposa
@izemaps
Nov 04 2015 15:37

```var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;

function myFunction() {

// Only change code below this line.

if(result === 0){
    Flip = Heads;

}else(result =! 0);{
    Flip = Tails;

}```
jpjenkins
@jpjenkins
Nov 04 2015 15:37
I'm running arch linux
it's stable for me
I don't understand this kernel issue though
'no javascript kernel installed' ... but there is!
Amal Farah
@afarah2
Nov 04 2015 15:40
it is still telling me that tails is not defined
Cameron Bass
@cameronbass
Nov 04 2015 15:41
var myCar = new Car();
jpjenkins
@jpjenkins
Nov 04 2015 15:41
return ('tails');
Cameron Bass
@cameronbass
Nov 04 2015 15:41
how do I add a engines property to this?
jpjenkins
@jpjenkins
Nov 04 2015 15:42
@afarah2
taheriyazdi
@taheriyazdi
Nov 04 2015 15:42
i want to select second elements in well class. i wrote ".well:nth-child(2)" but it's not valid. i don't know what my fail is
Amal Farah
@afarah2
Nov 04 2015 15:43
thank you @izemaps @pythonlabsstudent @jpjenkins !
CamperBot
@camperbot
Nov 04 2015 15:43
afarah2 sends brownie points to @izemaps and @pythonlabsstudent and @jpjenkins :sparkles: :thumbsup: :sparkles:
:star: 183 | @izemaps | http://www.freecodecamp.com/izemaps
:star: 190 | @pythonlabsstudent | http://www.freecodecamp.com/pythonlabsstudent
:star: 202 | @jpjenkins | http://www.freecodecamp.com/jpjenkins
Roger K.
@misterhtmlcss
Nov 04 2015 15:43
@afarah2 the issue is a couple things:
if (flip === 0) {
return "heads";
} 
  else {
return "tails";
}
first it’s not 1 === 0 , because that’s always wrong right?
Then it says STRING and heads without “” is a variable not a String. Right?
Cameron Bass
@cameronbass
Nov 04 2015 15:43
var myCar = new Car();
Dustin Frank
@DustInCompetent
Nov 04 2015 15:44
why not
return ["tails", "heads"][(flip===0)+0];:smile:
Cameron Bass
@cameronbass
Nov 04 2015 15:44
how do I add Engine property to this?
Roger K.
@misterhtmlcss
Nov 04 2015 15:44
Still struggling @cameronbass ?
@DustInCompetent no idea man. I’m not a pro… Sorry :(
Cameron Bass
@cameronbass
Nov 04 2015 15:45
@pythonlabsstudent yeah, just can't figure out what this one wants.
Roger K.
@misterhtmlcss
Nov 04 2015 15:45
@cameronbass send me the link to your Waypoint please and I’ll help you
Markus Kiili
@Masd925
Nov 04 2015 15:47
@cameronbass If you want to add it to this one car only use myCar.engines = 5;
Roger K.
@misterhtmlcss
Nov 04 2015 15:47
@cameronbass exactly.
var Car = function() {
   this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();
 myCar.engines = 250;
Cameron Bass
@cameronbass
Nov 04 2015 15:48
@pythonlabsstudent @Masd925 Thank you!
CamperBot
@camperbot
Nov 04 2015 15:48
cameronbass sends brownie points to @pythonlabsstudent and @masd925 :sparkles: :thumbsup: :sparkles:
:star: 172 | @masd925 | http://www.freecodecamp.com/masd925
:star: 191 | @pythonlabsstudent | http://www.freecodecamp.com/pythonlabsstudent
Markus Kiili
@Masd925
Nov 04 2015 15:49
@cameronbass For all cars use Car.prototype.engines = 5;
Abhisek Pattnaik
@abhisekp
Nov 04 2015 15:50
@DustInCompetent I think this will also work. Right?
return ["tails", "heads"][+(flip===0)];:smile:
Roger K.
@misterhtmlcss
Nov 04 2015 15:50
@cameronbass the issue and what they want to emphasize is that the first function var Car = function() has this.wheels = 4 as part of it. Now you have a new function that you want to create, but they want you to use var Car e.g.
See from the top of the instructions:
Sometimes you'll want to be able to easily create many copies of an objects that all share the same methods.
So for your NEW function you use myCar.engines so that it’s specific to that object
@cameronbass I don’t know prototype. sorry. I am reading about on that Mozilla page too ;)
Isaac Maposa
@izemaps
Nov 04 2015 15:54
@pythonlabsstudent thanks!
CamperBot
@camperbot
Nov 04 2015 15:54
izemaps sends brownie points to @pythonlabsstudent :sparkles: :thumbsup: :sparkles:
Markus Kiili
@Masd925
Nov 04 2015 15:54
@cameronbass The first three lines of the above code is a prototype that can make cars. Last two lines make a car and add engines to it. The other way is to add engines to the prototype first and then all cars will have engines.
CamperBot
@camperbot
Nov 04 2015 15:54
:star: 192 | @pythonlabsstudent | http://www.freecodecamp.com/pythonlabsstudent
Amal Farah
@afarah2
Nov 04 2015 15:55
thank you all
CamperBot
@camperbot
Nov 04 2015 15:55
if you want to thank someone, put an @ before their name!
taheriyazdi
@taheriyazdi
Nov 04 2015 15:57
i'm stuck in [Waypoint: Target a Specific Child of an Element Using jQuery] (http://www.freecodecamp.com/challenges/waypoint-target-a-specific-child-of-an-element-using-jquery) , i wrote '$(".well:nth-child(2)").addClass("bounce");' but it doesn't work.
Gulshan Saini
@gulshansainis
Nov 04 2015 15:59
@taheriyazdi as given in example - you should use $(".target:nth-child(2)")
This message was deleted
nth-child selector
Description: Selects all elements that are the nth-child of their parent.
taheriyazdi
@taheriyazdi
Nov 04 2015 16:02
@gulshansainis i used $(".target:nth-child(2)"), but it does not work!
Tanmay
@tanmaywagh17
Nov 04 2015 16:04
I am going to ask millions of questions please help
Gulshan Saini
@gulshansainis
Nov 04 2015 16:07
@taheriyazdi try this
$(".target:nth-child(2)").addClass("animated bounce");
may be you can compare what yu are missing
taheriyazdi
@taheriyazdi
Nov 04 2015 16:09
@gulshansainis thanks. it works. i missed the "animated" class, however it asked to add bounce.
CamperBot
@camperbot
Nov 04 2015 16:09
taheriyazdi sends brownie points to @gulshansainis :sparkles: :thumbsup: :sparkles:
:star: 184 | @gulshansainis | http://www.freecodecamp.com/gulshansainis
James
@jjowen
Nov 04 2015 16:10
Stuck!
Waypoint: Learn how Script Tags and Document Ready Work
This is my code
<script>
$(document).ready(function() {
});
</script>
Click run tests and it wont let me go any further.
James Kim
@jameskim1980
Nov 04 2015 16:11
I'm stuck here

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

<h2CatPhotoApp</h2>

thats my code
says my h2 element should be blue
what am i doing wrong here?
Gulshan Saini
@gulshansainis
Nov 04 2015 16:13
@jjowen i do not see any issue with your code
it should work
James Kim
@jameskim1980
Nov 04 2015 16:13
Yeah maybe I should reset and try again
Gulshan Saini
@gulshansainis
Nov 04 2015 16:14
@jameskim1980 you have not closed the starting h2 tag
you are missing >
James
@jjowen
Nov 04 2015 16:14
same here. doesn't event give me the red X or green checkmarks
Gulshan Saini
@gulshansainis
Nov 04 2015 16:14
@jjowen try this
<script>
$(document).ready(function() {});
</script>
mostafaElbana
@mostafaElbana
Nov 04 2015 16:14
😊
James
@jjowen
Nov 04 2015 16:15
no luck. Thanks! @gulshansainis for trying
CamperBot
@camperbot
Nov 04 2015 16:16
jjowen sends brownie points to @gulshansainis :sparkles: :thumbsup: :sparkles:
:star: 185 | @gulshansainis | http://www.freecodecamp.com/gulshansainis
James Kim
@jameskim1980
Nov 04 2015 16:16
where am i missing it at @gulshansainis
Gulshan Saini
@gulshansainis
Nov 04 2015 16:16
<h2CatPhotoApp</h2>
it should be <h2>CatPhotoApp</h2>
James Kim
@jameskim1980
Nov 04 2015 16:17
Thanks @gulshansainis you rock
CamperBot
@camperbot
Nov 04 2015 16:17
jameskim1980 sends brownie points to @gulshansainis :sparkles: :thumbsup: :sparkles:
:star: 186 | @gulshansainis | http://www.freecodecamp.com/gulshansainis
Gulshan Saini
@gulshansainis
Nov 04 2015 16:17
I hope you can see difference betwen these two
you are welcome
ScousaJay
@ScousaJay
Nov 04 2015 16:19

hi all, just wondering if someone could point me in the right direction, im at stage (http://www.freecodecamp.com/challenges/waypoint-use-an-id-attribute-to-style-an-element) and i have added the style element

 #cat-photo-element {
    background-color: green;
  }

but in not sure how to give my form a green background without any class or style attributes. any help appreciated !

jpjenkins
@jpjenkins
Nov 04 2015 16:20
create some parameters in the 'style' section linking to your id
ah
id = "cat-photo-element"
Gulshan Saini
@gulshansainis
Nov 04 2015 16:20
@ScousaJay add id to form element having value "cat-photo-element"
jpjenkins
@jpjenkins
Nov 04 2015 16:20
might be the wrong syntax, but put that in with your form element
<form id=...
ScousaJay
@ScousaJay
Nov 04 2015 16:21
so far, my form element is as follows
<form action="/submit-cat-photo" id="cat-photo-form">
  <label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
  <label><input type="checkbox" name="personality" checked> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Energetic</label>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>
jpjenkins
@jpjenkins
Nov 04 2015 16:21
<form action="/submit-cat-photo" id="cat-photo-form" id= ...>
ah you have it
ScousaJay
@ScousaJay
Nov 04 2015 16:22
oh, so i could use a second id= and this time with a #cat-photo-element ?
Tanmay
@tanmaywagh17
Nov 04 2015 16:22
How to uncomment
Gulshan Saini
@gulshansainis
Nov 04 2015 16:22
@ScousaJay nope - you have to change value of existing one
jpjenkins
@jpjenkins
Nov 04 2015 16:23
no sorry, that was a typo
James
@jjowen
Nov 04 2015 16:23
jpjenkins
@jpjenkins
Nov 04 2015 16:23
I didn't read it enough
ScousaJay
@ScousaJay
Nov 04 2015 16:23
oh lol :)
jpjenkins
@jpjenkins
Nov 04 2015 16:23
:P
ScousaJay
@ScousaJay
Nov 04 2015 16:24
oh, i get it, thanks for your help @gulshansainis @jpjenkins
CamperBot
@camperbot
Nov 04 2015 16:24
scousajay sends brownie points to @gulshansainis and @jpjenkins :sparkles: :thumbsup: :sparkles:
:star: 203 | @jpjenkins | http://www.freecodecamp.com/jpjenkins
:star: 187 | @gulshansainis | http://www.freecodecamp.com/gulshansainis
jpjenkins
@jpjenkins
Nov 04 2015 16:24
a pleasure
ScousaJay
@ScousaJay
Nov 04 2015 16:32
ok, so i have tried that solution, and it doesnt seem to like it, instead of 3 green ticks, and one X, i now got 3 X and 1 green, it says that the form element must remain```
id="cat-photo-form"
Gulshan Saini
@gulshansainis
Nov 04 2015 16:35
@ScousaJay can you post your solution
ScousaJay
@ScousaJay
Nov 04 2015 16:35
<form id="cat-photo-element" 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>
it has make the back ground green, but now the other 3 requirements are X's
the only one that is ticked in the Do not give your form any class or style attributes.
Gulshan Saini
@gulshansainis
Nov 04 2015 16:37
@ScousaJay as per the requirement
you need to define #cat-photo-form with background green
as below

cat-photo-form{background-color:green;}

ScousaJay
@ScousaJay
Nov 04 2015 16:39
i already have that in the style
jpjenkins
@jpjenkins
Nov 04 2015 16:39
@ScousaJay are you sure?
Gulshan Saini
@gulshansainis
Nov 04 2015 16:39
now replace existing id of form from “cat-photo-element” TO "cat-photo-form"
jpjenkins
@jpjenkins
Nov 04 2015 16:39
yeah I was about to say...
Michael
@Msd1391
Nov 04 2015 16:39
Hi guys. I'm having a bit of trouble running one of the bits of code. Specifically the one when you first get introduced to font size. It won't register the text in the <p> element but specifies everything else is good. Has anyone else ran into this bug?
jpjenkins
@jpjenkins
Nov 04 2015 16:39
you copied and pasted from the side, cat-photo-element is in the example, cat-photo-form is the assignment ;)
or perhaps it was the other way around :)
ScousaJay
@ScousaJay
Nov 04 2015 16:42
ok, i got it, i just had to rename the style to #cat-photo-form { background-color: green; } i thought it needed to be element lol, my bad, thanks for your help again guys @jpjenkins @gulshansainis
CamperBot
@camperbot
Nov 04 2015 16:42
scousajay sends brownie points to @jpjenkins and @gulshansainis :sparkles: :thumbsup: :sparkles:
:warning: scousajay already gave jpjenkins points
:warning: scousajay already gave gulshansainis points
Matt Leonard
@matty22
Nov 04 2015 16:42
@Msd1391 Can you show us your code?
jpjenkins
@jpjenkins
Nov 04 2015 16:43
any time
Gulshan Saini
@gulshansainis
Nov 04 2015 16:43
np
Michael
@Msd1391
Nov 04 2015 16:43
@matty22 I'm new, how do I post it to chat?
jpjenkins
@jpjenkins
Nov 04 2015 16:43
It's always worth double checking if everything in style matches what you're putting in the tags
Matt Leonard
@matty22
Nov 04 2015 16:43
explain format
CamperBot
@camperbot
Nov 04 2015 16:43

:point_right: code format [wiki]

Inline code

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

Code Block

``` ⇦ Type 3 backticks and then press [shift + enter ⏎]

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

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

How to Code

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

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

jpjenkins
@jpjenkins
Nov 04 2015 16:43
Easy mistake to make
Cameron Bass
@cameronbass
Nov 04 2015 16:43

var array = [1,2,3,4,5,6,7];

// Only change code below this line.

var array = new array.reverse

// Only change code above this line.

(function() {return array;})();
Whats wrong with my code?

jpjenkins
@jpjenkins
Nov 04 2015 16:44
missing ();
and the rest ;)
Matt Leonard
@matty22
Nov 04 2015 16:44
@cameronbass .reverse()
Cameron Bass
@cameronbass
Nov 04 2015 16:45
@jpjenkins @matty22 Thanks!
CamperBot
@camperbot
Nov 04 2015 16:45
cameronbass sends brownie points to @jpjenkins and @matty22 :sparkles: :thumbsup: :sparkles:
Matt Leonard
@matty22
Nov 04 2015 16:45
You've also declared your variable twice with the var keyword. You don't need to do that. Every time after the initialization, you can just use the variable name and not var
CamperBot
@camperbot
Nov 04 2015 16:45
:star: 204 | @jpjenkins | http://www.freecodecamp.com/jpjenkins
:star: 221 | @matty22 | http://www.freecodecamp.com/matty22
jpjenkins
@jpjenkins
Nov 04 2015 16:45
reverse is the function, you need to add the parameters too
that link's really comprehensive, definitely worth a read
@cameronbass you'll want to read the article on .sort too, to understand the difference between numbers and letters when organising them in an array
the mozilla website has a good explanation for that too
Cameron Bass
@cameronbass
Nov 04 2015 16:47
will do @jpjenkins
jpjenkins
@jpjenkins
Nov 04 2015 16:48
ignore what I said about the parameters in .reverse there, I was getting confused with sort
Michael
@Msd1391
Nov 04 2015 16:48

```<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 class="red-text">Kitty ipsum dolor sit amet </p>

jpjenkins
@jpjenkins
Nov 04 2015 16:49
explain format
CamperBot
@camperbot
Nov 04 2015 16:49

:point_right: code format [wiki]

Inline code

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

Code Block

``` ⇦ Type 3 backticks and then press [shift + enter ⏎]

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

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

How to Code

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

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

Michael
@Msd1391
Nov 04 2015 16:49
@matty22 that's my code and everything is right but it won't register the last paragraph
jpjenkins
@jpjenkins
Nov 04 2015 16:50
what is the direction again?
What waypoint are you working on @Msd1391 ?
Michael
@Msd1391
Nov 04 2015 16:51
@jpjenkins The one when you first get introduced to font size. The system says everything including the classes is wrong but it won't register the start of the text in my second paragraph.
@jpjenkins I'm using Google chrome as my browser also.
shebabeth
@shebabeth
Nov 04 2015 16:52
hey guys whats wrong with this p element? <p>Hello paragragh</p>
jpjenkins
@jpjenkins
Nov 04 2015 16:52
@Msd1391 the second text is wrong
make sure you copy the text from the side as it's different, tripped me up too
It should pass after that
oh
success?
Michael
@Msd1391
Nov 04 2015 16:54
@jpjenkins I just copied it straight from the phone and still no dice. Bug with the website maybe?
jpjenkins
@jpjenkins
Nov 04 2015 16:54
@shebabeth nothing by the looks of it, what's the problem?
unlikely
maybe you've got a stray invisible character in your code
worth to try and reset and do it again
shebabeth
@shebabeth
Nov 04 2015 16:55
I can't move to the next step
jpjenkins
@jpjenkins
Nov 04 2015 16:56
make sure you put the exact text in as it does check
'Hello Paragraph'
shebabeth
@shebabeth
Nov 04 2015 16:56
I've done that....reset and trying it again but still nothing
ScousaJay
@ScousaJay
Nov 04 2015 16:56
capital P is needed i think
jpjenkins
@jpjenkins
Nov 04 2015 16:56
the p is a capital letter ;)
shebabeth
@shebabeth
Nov 04 2015 16:56
let me try that
thank you @jpjenkins @ScousaJay
CamperBot
@camperbot
Nov 04 2015 16:58
shebabeth sends brownie points to @jpjenkins and @scousajay :sparkles: :thumbsup: :sparkles:
:star: 50 | @scousajay | http://www.freecodecamp.com/scousajay
:star: 205 | @jpjenkins | http://www.freecodecamp.com/jpjenkins
Matt Leonard
@matty22
Nov 04 2015 16:58
@Msd1391 What do the instructions say to do? Change all of the text to red or just some of it?
jpjenkins
@jpjenkins
Nov 04 2015 16:58
you're welcome
the instruction is to add a second paragraph with the provided text and change all to text-size 16
so far everything checks out except the text in the paragraph, I think he has it
Michael
@Msd1391
Nov 04 2015 16:59
@jpjenkins @matty22 I reset the code and retyped everything out, but it still won't let me move on.
It keeps on saying I need the first few words of the kitty ipsum text but no matter how much or how little I put, it refuses to aknowledge it's complete.
jpjenkins
@jpjenkins
Nov 04 2015 17:01
ah
you've not put the text-size class in your p element
<p class="red-text text-size">
font-size sorry
Cailyn Rodriguez
@cailynerodriguez
Nov 04 2015 17:02
i am trying to add a class "thick-green-border" to my image element but it keeps coming back wrong. any help? heres my code-
Matt Leonard
@matty22
Nov 04 2015 17:02
No, he's put the font-size in the p{} element in the CSS. It isn't a class.
Michael
@Msd1391
Nov 04 2015 17:02
no that's not it because I have a checkmark next to the bit about giving anything in a <p> element a font size of 16px. I had to declare it in the style section.
Cailyn Rodriguez
@cailynerodriguez
Nov 04 2015 17:02
<img class="smaller-image" class="thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
Matt Leonard
@matty22
Nov 04 2015 17:03
Make sure you've included ALL of the Kitty Ipsum text that they provide in the instructions in that second <p>
Cailyn Rodriguez
@cailynerodriguez
Nov 04 2015 17:03
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
}
jpjenkins
@jpjenkins
Nov 04 2015 17:03
ah, apologies
indeed, even the punctuation
Matt Leonard
@matty22
Nov 04 2015 17:03
@cailynerodriguez no need for two class="" just combine them.
jpjenkins
@jpjenkins
Nov 04 2015 17:03
don't be missing the full-stop
<img class="smaller-mage thick-green-border"
ScousaJay
@ScousaJay
Nov 04 2015 17:04
@cailynerodriguez you can remove the second class= and just have "smaller-image" "thick-green-border"
Cailyn Rodriguez
@cailynerodriguez
Nov 04 2015 17:04
ahh thank you all! i got it.
CamperBot
@camperbot
Nov 04 2015 17:04
if you want to thank someone, put an @ before their name!
jpjenkins
@jpjenkins
Nov 04 2015 17:04
@cailynerodriguez but not separately
all in one " .. "
Michael
@Msd1391
Nov 04 2015 17:04
@matty22 I copied the whole thing again and took away the red text class but still nothing so that rules out adding an unnecessary class.
h4r1m4u
@h4r1m4u
Nov 04 2015 17:05
something for inspiration, guys: http://codepen.io/r4ms3s/full/gajVBG/. done in pure HTML and CSS (not my work)
ScousaJay
@ScousaJay
Nov 04 2015 17:05
thats cool :)
jpjenkins
@jpjenkins
Nov 04 2015 17:05
:D
h4r1m4u
@h4r1m4u
Nov 04 2015 17:06
:) pretty insane
jpjenkins
@jpjenkins
Nov 04 2015 17:06
anyone else getting the blurry zoomed in battle destroyers zipping past though?
Michael
@Msd1391
Nov 04 2015 17:07
I gotta go guys but @jpjenkins @matty22 thank you both for your help. I have a funny feeling that when I log back in it'll work for some reason lol.
CamperBot
@camperbot
Nov 04 2015 17:07
msd1391 sends brownie points to @jpjenkins and @matty22 :sparkles: :thumbsup: :sparkles:
:star: 222 | @matty22 | http://www.freecodecamp.com/matty22
:star: 206 | @jpjenkins | http://www.freecodecamp.com/jpjenkins
jpjenkins
@jpjenkins
Nov 04 2015 17:08
no doubt @Msd1391 :)
you're welcome
Matt Leonard
@matty22
Nov 04 2015 17:08

In your second <p> make sure you have no classes or anything else, just:

<p>Kitty ipsum......</p>

Or what ever the provided text is in the question
ScousaJay
@ScousaJay
Nov 04 2015 17:09
@jpjenkins yea i see that, some seem large and up close, some further back in the distance, but still blurry non the less
jpjenkins
@jpjenkins
Nov 04 2015 17:09
how do I close the code pen once it's started?
t1melord
@t1melord
Nov 04 2015 17:10
<script>
  $(document).ready(function() {
$("button").addClass(animated);
$(".btn").addClass(shake);
    $("#target1").addClass(btn-primary);
  });
</script>

<!-- Only change code above this line. -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <h4>#left-well</h4>
      <div class="well" id="left-well">
        <button class="btn btn-default target" id="target1">#target1</button>
        <button class="btn btn-default target" id="target2">#target2</button>
        <button class="btn btn-default target" id="target3">#target3</button>
      </div>
    </div>
    <div class="col-xs-6">
      <h4>#right-well</h4>
      <div class="well" id="right-well">
        <button class="btn btn-default target" id="target4">#target4</button>
        <button class="btn btn-default target" id="target5">#target5</button>
        <button class="btn btn-default target" id="target6">#target6</button>
      </div>
    </div>
  </div>
</div>
the problem that will not go away is "Your #target1 element should have the classes animated‚ shake and btn-primary."
can anyone help
ScousaJay
@ScousaJay
Nov 04 2015 17:11
@jpjenkins i opened in new tab, but i see the return function doesnt seem to work on the code pen in this chat window :)
h4r1m4u
@h4r1m4u
Nov 04 2015 17:11
@t1melord .addClass(btn-primary) the class needs to be wrapped in double quotes
"btn-primary"
if you don't wrap it in quotes, it's a variable and if the variable is not defined, it'll fail
t1melord
@t1melord
Nov 04 2015 17:13
thanks @h4r1m4u
CamperBot
@camperbot
Nov 04 2015 17:13
t1melord sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 517 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
t1melord
@t1melord
Nov 04 2015 17:13
i got it
Pranay Kothapalli
@kotAPI
Nov 04 2015 17:17
Hey guys, can anyone tell me whats being supplied to a and b?
var numbers = [4, 2, 5, 1, 3];
numbers.sort(function(a, b) {
  return a - b;
});
console.log(numbers);
h4r1m4u
@h4r1m4u
Nov 04 2015 17:18
the elements of the array @kotAPI
Pranay Kothapalli
@kotAPI
Nov 04 2015 17:19
so this sorts in increasing order right?
What's supplied? I can't get my head around how the callback works
h4r1m4u
@h4r1m4u
Nov 04 2015 17:21
correct, it sorts the number ascendingly. the sort function iterates over the array and compares two neighboring elements. depending on the result of the callback function, it'll either swap them or keep them in the same order
i'll iterate over the array until the whole array is sorted
Pranay Kothapalli
@kotAPI
Nov 04 2015 17:22
so it's some effecient algorithm that's being used?
Rex Schrader
@SaintPeter
Nov 04 2015 17:22
@kotAPI The above image is how quicksort works. It compares a bunch of things and you are providing the comparison algorithim
@kotAPI That's how sort in Javascript works
Pranay Kothapalli
@kotAPI
Nov 04 2015 17:22
Ohh..
thanks @SaintPeter @h4r1m4u
CamperBot
@camperbot
Nov 04 2015 17:23
kotapi sends brownie points to @saintpeter and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 518 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
:star: 1388 | @saintpeter | http://www.freecodeca