24th
Nov 2015
iccomq
@iccomq
Nov 24 2015 00:00
@orkist so you are supposed to filter out all that is greater than five. You need to return just values that are lower or equal to five.
Derek Frankel
@TuvyaYis
Nov 24 2015 00:03
For some reason the Waypoint: Iterate over Arrays with map won't let me pass while JS bin gives me the correct results. Does anyone see what's wrong here? And what purpose does the var newArray = oldArray; serve?

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

// Only change code below this line.

var newArray = oldArray;

var addThree = oldArray.map(function(val) {

return val + 3;

});


Den McHenry
@denmch
Nov 24 2015 00:04
Probably to avoid mutating values.
Derek Frankel
@TuvyaYis
Nov 24 2015 00:04

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

// Only change code below this line.

var newArray = oldArray;

var addThree = oldArray.map(function(val) {

return val + 3;

});


Den McHenry
@denmch
Nov 24 2015 00:05
Put your back ticks on separate lines
Derek Frankel
@TuvyaYis
Nov 24 2015 00:05
var oldArray = [1,2,3,4,5];

// Only change code below this line.

var newArray = oldArray;

var addThree = oldArray.map(function(val) {

return val + 3;
});
Den McHenry
@denmch
Nov 24 2015 00:06
Let's say you were writing a more complex piece of code, or part of a larger project, and didn't foresee that oldArray would be needed elsewhere. If you didn't put its value into newArray in order to work on it here, you could break or get unexpected results elsewhere.
iccomq
@iccomq
Nov 24 2015 00:06
thats becouse you need to actually save that to variable, as map method does not modify the array that it is used on. And you need to assign it in newArray, becouse function below what you can change expects result from variable newArray
you can make it like that
var newArray = oldArray.map(function(val){return val+3;});
Derek Frankel
@TuvyaYis
Nov 24 2015 00:09
It works perfectly in my JSbin. And ive commented out var newArray = oldArray
iccomq
@iccomq
Nov 24 2015 00:10

so if there was no

(function() {return newArray;})();

you could just write

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

but it will not work, as i said function at the bottom expect newArray

FBWes
@FBWes
Nov 24 2015 00:11
can any one help me?
$("well").addClass("animated shake"); is this line okay? Alexander Køpke @alexanderkopke Nov 24 2015 00:13 Is well a class ? Derek Frankel @TuvyaYis Nov 24 2015 00:13 @iccomq thx CamperBot @camperbot Nov 24 2015 00:13 tuvyayis sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles: :star: 114 | @iccomq | http://www.freecodecamp.com/iccomq Derek Frankel @TuvyaYis Nov 24 2015 00:14 @denmch thx CamperBot @camperbot Nov 24 2015 00:14 tuvyayis sends brownie points to @denmch :sparkles: :thumbsup: :sparkles: :star: 402 | @denmch | http://www.freecodecamp.com/denmch iccomq @iccomq Nov 24 2015 00:15 @FBWes which waypoint is that? FBWes @FBWes Nov 24 2015 00:15 yeah so it needs a . lol got it guys.. iccomq @iccomq Nov 24 2015 00:15 :) Alexander Køpke @alexanderkopke Nov 24 2015 00:15 :+1: FBWes @FBWes Nov 24 2015 00:16 but button didn't that's what threw me... iccomq @iccomq Nov 24 2015 00:16 button is an element so you dont put a dot in there also, its pretty easy to get lost in all that$'.'$.(.'). jQuery syntax at the begining :D Cornita Pinchinat @orkist Nov 24 2015 00:20 @iccomq I have tried changing my return statement to return val < 6; I get the correct output but it is not correct according to what FCC is trying to teach me. What do mean by changing the callback function? I was thinking that the filtering should be done in the function and not in the return --- Im so confused now M Used @mildused Nov 24 2015 00:20 Anyone want to work on an existing open source project with me? It's an operating system for schools in underdeveloped countries. Tech stack includes front end HTML, CSS, JS and Python is appreciated Prakash Natarajan @prakashn27 Nov 24 2015 00:24 Hi Guys I am in Waypoint: Target a Specific Child of an Element Using jQuery i want to know why this answer is not working$(".well:nth-child(2)").addClass("animated bounce");
iccomq
@iccomq
Nov 24 2015 00:24
@orkist so .filter is a method used on array, it takes an argument which is a function that compares each value and return those that are true, so return (comparison here) is either true or flalse for each element.
that function passed to a filter method, is called callback function
FBWes
@FBWes
Nov 24 2015 00:25

... ok 114 i even googled it <script>
$(document).ready(function(){$("button").addClass(shake);
$(".btn").addClass(animated shake);$("#target1").addClass(animated shake,shake,btn-primary);

});
</script> and i get
missing ) after argument list

iccomq
@iccomq
Nov 24 2015 00:26
you can think of this that way, filter takes parts of array and feed them to a callback function, and that function gives back part of the array that are true for comparison inside @orkist
Ian Walker
@tonesfrommars
Nov 24 2015 00:26
@FBWes you've got to wrap your class names in quotes.
$(".btn").addClass("animated shake"); iccomq @iccomq Nov 24 2015 00:27 @orkist you are on the right track with that comparison, quite frankly it should work in my opinion Ian Walker @tonesfrommars Nov 24 2015 00:27 and only spaces between classnames, no commas :-) millerA17 @millerA17 Nov 24 2015 00:27 hey ya'lllll...I'm back for more help. Form controls = mucho confused ;P iccomq @iccomq Nov 24 2015 00:28 @orkist return val <= 5; is what i put in my callback function in that exercise Den McHenry @denmch Nov 24 2015 00:29 @prakashn27 Put a space before the colon. FBWes @FBWes Nov 24 2015 00:29 thans guys you rock thanks* Prakash Natarajan @prakashn27 Nov 24 2015 00:29 @denmch : figured it out :) thanks CamperBot @camperbot Nov 24 2015 00:29 prakashn27 sends brownie points to @denmch :sparkles: :thumbsup: :sparkles: :star: 403 | @denmch | http://www.freecodecamp.com/denmch Den McHenry @denmch Nov 24 2015 00:30 It's a little counter-intuitive, because it actually refers to siblings. Prakash Natarajan @prakashn27 Nov 24 2015 00:30 how come both target and well gives me same behaviour in my code both of them is accepted?? Den McHenry @denmch Nov 24 2015 00:32 It should work with .well then a space then :nth-child or .target:nth-child (no space). Prakash Natarajan @prakashn27 Nov 24 2015 00:33 is it like the dom tree thinks all .well is same as .target when constructed? just curious to know how it works inside Den McHenry @denmch Nov 24 2015 00:33 The space says that the style applies to children of .well, and without the space it applies to instances of .target that are children of the same parent. Does that make sense? The space is a descendent selector. Prakash Natarajan @prakashn27 Nov 24 2015 00:34 wow. Thanks again. It makes sense now. :) Den McHenry @denmch Nov 24 2015 00:35 No problem :) @prakashn27 The best answer is actually to use the direct child selector: $(".well > :nth-child(2)").addClass("animated bounce");
If you just use a space and the direct children also have children, the style applies to them as well. By using the right angle bracket it's limited to the direct descendants.
niveditasiri
@niveditasiri
Nov 24 2015 00:47
I need help:
This is the code:

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

// Only change code below this line.

var myCar = function(){
this.wheels = 4;
this.engines = 1;
this.seats = 1;
this.myCar.nickName = "nivi";
};

This is the challenge:
The property wheels of myCar should equal 4.
The property nickname of myCar should be a string.
iccomq
@iccomq
Nov 24 2015 00:49
could you say which waypoint is that?
crystala814
@crystala814
Nov 24 2015 00:50

I need halppp, I know this is probably very easy and I'm just not seeing the problem, but here it is. I can't figure out how to change the h2 element to blue. <style>

h2 {color: blue;}

</style>

<style>

h2 {color: blue;}

</style>
Rory Smith
@alanbuchanan
Nov 24 2015 00:50
@crystala814 you only need one style section
niveditasiri
@niveditasiri
Nov 24 2015 00:50
third point in object oriented and functional programming @iccomq
iccomq
@iccomq
Nov 24 2015 00:51
so @niveditasiri you should make a myCar right?
niveditasiri
@niveditasiri
Nov 24 2015 00:51
yep
iccomq
@iccomq
Nov 24 2015 00:52

so you need to declare it, we have

var myCar =

so far

niveditasiri
@niveditasiri
Nov 24 2015 00:52
okay
iccomq
@iccomq
Nov 24 2015 00:52
and now look at the Car above
niveditasiri
@niveditasiri
Nov 24 2015 00:53
var myCar = function(){
this.wheels = 4;
this.engines = 1;
this.seats = 1;
this.myCar.nickName = "nivi";
};
iccomq
@iccomq
Nov 24 2015 00:53
it is a constructor function, it makes new elements
niveditasiri
@niveditasiri
Nov 24 2015 00:53
i did this, where am I wrong? @iccomq
iccomq
@iccomq
Nov 24 2015 00:53
with a set attributes and values attached to them
stay with me
crystala814
@crystala814
Nov 24 2015 00:53
@alanbuchanan I didn't mean to include it twice, but this is what it looks like right now.
<style>

h2 {color: blue;}

</style>
niveditasiri
@niveditasiri
Nov 24 2015 00:53
okay
I am following you, go on @iccomq
iccomq
@iccomq
Nov 24 2015 00:54
@niveditasiri when you use constructor function in here, the constructor already knows what are attributes and values attached to them
niveditasiri
@niveditasiri
Nov 24 2015 00:54
tell me what am I doing wrong?
okay @iccomq
iccomq
@iccomq
Nov 24 2015 00:55
so when you want a constructor function to make a an object for you named a Car
you dont define wheels and all that
niveditasiri
@niveditasiri
Nov 24 2015 00:55
okay
iccomq
@iccomq
Nov 24 2015 00:55
you just call it
it makes that new element called myCar, with a properties of a Car
niveditasiri
@niveditasiri
Nov 24 2015 00:56
oh okay
iccomq
@iccomq
Nov 24 2015 00:56
so
var myCar = new Car();
niveditasiri
@niveditasiri
Nov 24 2015 00:57
okay
iccomq
@iccomq
Nov 24 2015 00:57
here you basically tell: "hey Car make for me new object, named myCar, with attributes and values i gave you before"
Prakash Natarajan
@prakashn27
Nov 24 2015 00:57
@denmch Thanks for the headup will look into it :)
CamperBot
@camperbot
Nov 24 2015 00:57
prakashn27 sends brownie points to @denmch :sparkles: :thumbsup: :sparkles:
:warning: prakashn27 already gave denmch points
Ian Walker
@tonesfrommars
Nov 24 2015 00:57
its an object stored in a variable. yes
iccomq
@iccomq
Nov 24 2015 00:57
you call constructor functions(the ones tat make elements) with a syntax 'new'
Ian Walker
@tonesfrommars
Nov 24 2015 00:58
probably better to call them objects
niveditasiri
@niveditasiri
Nov 24 2015 00:58
okay @iccomq
iccomq
@iccomq
Nov 24 2015 00:59
so now @niveditasiri you just have to add new property to a Car. exercise tells you exactly how.
niveditasiri
@niveditasiri
Nov 24 2015 00:59
okay @iccomq
Let me try this @iccomq
iccomq
@iccomq
Nov 24 2015 01:00
its also important for you to understand how objects work, there are links in left side, use them, as time goes by you will need to research on your own more and more
as problems you will encounter will get complex pretty fast,
niveditasiri
@niveditasiri
Nov 24 2015 01:01
okay @iccomq
iccomq
@iccomq
Nov 24 2015 01:02
ask, if you have further questions.
Kaye
@KayeZZ
Nov 24 2015 01:02
I need a little help with one of the Jquery waypoints
iccomq
@iccomq
Nov 24 2015 01:03
@KayeZZ which one?
Kaye
@KayeZZ
Nov 24 2015 01:03
Waypoint: Target the same element with Multiple jQuery selectors
It looks to me that I'm doing it right but .-.
niveditasiri
@niveditasiri
Nov 24 2015 01:03
I'm stuck at nick name property @iccomq . I'm going to ask you some questions. Thank you so much @iccomq
CamperBot
@camperbot
Nov 24 2015 01:03
niveditasiri sends brownie points to @iccomq and @iccomq :sparkles: :thumbsup: :sparkles:
:star: 115 | @iccomq | http://www.freecodecamp.com/iccomq
:star: 115 | @iccomq | http://www.freecodecamp.com/iccomq
iccomq
@iccomq
Nov 24 2015 01:03
also @tonesfrommars yes it would be better if i stayed with correct, constant names,
Ian Walker
@tonesfrommars
Nov 24 2015 01:04
Agreed, wasn't taking issue at all, but I find it helpful to reinforce terminology for more clarity when I'm wrapping my brain around a bunch of new ideas at once. :)
iccomq
@iccomq
Nov 24 2015 01:04
@KayeZZ remember that every element selected needs just one class added in there.
Kaye
@KayeZZ
Nov 24 2015 01:05
well, it should have?
iccomq
@iccomq
Nov 24 2015 01:05
@niveditasiri write me, how would you set a new property called nickname for an object myCar
@KayeZZ yes, thats a little hint from me :) read exercise description carefully 3 times :D
niveditasiri
@niveditasiri
Nov 24 2015 01:06
@iccomq
myCar.nickName = "nickname";
Kaye
@KayeZZ
Nov 24 2015 01:06
$("button").addClass(animated);$(".btn").addClass(shake);
$("#target1").addClass(btn-primary); I mean that's what jQuery is supposed to look like yeah? Jelani Thompson @JelaniThompson Nov 24 2015 01:07 Guys, is FCC loading for anyone else? iccomq @iccomq Nov 24 2015 01:07 @KayeZZ you forgot to wrap your classed you add in ' ' addClass('shake'); etc Kaye @KayeZZ Nov 24 2015 01:07 oooh .-. thanks. iccomq @iccomq Nov 24 2015 01:08 @niveditasiri that seems correct niveditasiri @niveditasiri Nov 24 2015 01:08 hmm yeah, but it isnt accepting. @iccomq iccomq @iccomq Nov 24 2015 01:08 @niveditasiri did you make sure you are setting this property AFTER you made myCar? @niveditasiri paste your code in here with  at the begining and  at the end of code lets see what a mistake is Kaye @KayeZZ Nov 24 2015 01:09 ok so it's still has the problem that #target1 doesn't have all the classes... which makes no sense because they're right there Anthony Guru @mrguru2016 Nov 24 2015 01:10 <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"> <style> .red-text { color: red; } h2 { font-family: Lobster, Monospace; } p { font-size: 16px; font-family: Monospace; } .thick-green-border { border-color: green; border-width: 10px; border-style: solid; border-radius: 50%; } .smaller-image { width: 100px; } .gray-background { background-color: gray; } </style> <h2 class="red-text">CatPhotoApp</h2> <p>Click here for <a href="#">cat photos</a>.</p> <a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a> <div class="gray-background"> <p>Things cats love:</p> <ul> <li>cat nip</li> <li>laser pointers</li> <li>lasagna</li> </ul> <p>Top 3 things cats hate:</p> <ol> <li>flea treatment</li> <li>thunder</li> <li>other cats</li> </ol> </div> <form 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> How to Give your form element the id cat-photo-form. ?? Michael Cheung @m6cheung Nov 24 2015 01:10 <form id='cat-photo-form'> add an id to the form right now it has an action attribute, now give it an id attribute as well @mrguru2016 niveditasiri @niveditasiri Nov 24 2015 01:11 var Car = function() { this.wheels = 4; this.engines = 1; this.seats = 1; }; // Only change code below this line. var myCar = new Car(); myCar.nickName = "nivi"; @iccomq Kaye @KayeZZ Nov 24 2015 01:12 now it suddenly worked??? I didn't do anything different??? lol iccomq @iccomq Nov 24 2015 01:13 try to change nickName to nickname @niveditasiri its probably case sensitive niveditasiri @niveditasiri Nov 24 2015 01:13 let me try @iccomq it worked when removed the cap N. Thank you @iccomq CamperBot @camperbot Nov 24 2015 01:14 niveditasiri sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles: :warning: niveditasiri already gave iccomq points iccomq @iccomq Nov 24 2015 01:16 youre welcome :) make sure you understand objects though! it may be beneficial to jump and find some basic youtube videos educating about them. its important! Anthony Guru @mrguru2016 Nov 24 2015 01:16 @m6cheung Thats the part im confused at where? do I call another form entry or enter it in the already made form iccomq @iccomq Nov 24 2015 01:19 @mrguru2016 think about all that 'action' and 'alt' and 'id' as attributes you can add to a tag, you separate them with a space. so when you have <form action='blabla' alt='blabla' id='blabla'> you stick a notes that browser can read and associate them with element. Anthony Guru @mrguru2016 Nov 24 2015 01:20 @iccomq right did that at first still deemed wrong attempt again thanks CamperBot @camperbot Nov 24 2015 01:20 mrguru2016 sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles: :star: 116 | @iccomq | http://www.freecodecamp.com/iccomq iccomq @iccomq Nov 24 2015 01:21 also alt is in there thrown just for a sake of an example, i dont think that form accepts an alt, or i dont know, just dont quote me on that particular thing Anthony Guru @mrguru2016 Nov 24 2015 01:21 def <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"> <style> .red-text { color: red; } h2 { font-family: Lobster, Monospace; } p { font-size: 16px; font-family: Monospace; } .thick-green-border { border-color: green; border-width: 10px; border-style: solid; border-radius: 50%; } .smaller-image { width: 100px; } .gray-background { background-color: gray; } </style> <h2 class="red-text">CatPhotoApp</h2> <p>Click here for <a href="#">cat photos</a>.</p> <a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a> <div class="gray-background"> <p>Things cats love:</p> <ul> <li>cat nip</li> <li>laser pointers</li> <li>lasagna</li> </ul> <p>Top 3 things cats hate:</p> <ol> <li>flea treatment</li> <li>thunder</li> <li>other cats</li> </ol> </div> <form action="/submit-cat-photo" id="cat-photo-app"> <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> As such? @iccomq @m6cheung iccomq @iccomq Nov 24 2015 01:24 that seems about right Anthony Guru @mrguru2016 Nov 24 2015 01:24 Waypoint: Set the ID of an Element iccomq @iccomq Nov 24 2015 01:24 still having a problem? Anthony Guru @mrguru2016 Nov 24 2015 01:24 still incorrect iccomq @iccomq Nov 24 2015 01:25 becouse you dont read right :D id should be cat-photo-form! not cat-photo-app Anthony Guru @mrguru2016 Nov 24 2015 01:26 correct i copied the one i used as a example iccomq @iccomq Nov 24 2015 01:27 just remember that examples given are always a little different, literally always, so after copying you need to change a few things its easy to confuse an example with what they actually want you to copy-paste. As with kitty ipsum and all that little things Anthony Guru @mrguru2016 Nov 24 2015 01:29 @iccomq hey thanks for the reminder, help and judgement of what i missed :clap: lol CamperBot @camperbot Nov 24 2015 01:29 mrguru2016 sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles: :warning: mrguru2016 already gave iccomq points iccomq @iccomq Nov 24 2015 01:30 youre welcome :) Joseph @revisualize Nov 24 2015 01:33 Greetings, Can I get a little help? iccomq @iccomq Nov 24 2015 01:34 @revisualize sure, describe a problem tell us what waypoint are you stuck at Joseph @revisualize Nov 24 2015 01:35 I just completed "2h Object Oriented and Functional Programming " 5. Waypoint: Make Object Properties Private ... I completed it. But, I don't understand it. Is there any way that I can get more explanation of this Waypoint? var Bike = function() { // Only change code below this line. this.getGear = function() { } this.setGear = function(gear) { return gear; } // Only change code above this line. }; That's what I did. But, I don't understand how or why that worked. iccomq @iccomq Nov 24 2015 01:36 you need to read about scope, Joseph @revisualize Nov 24 2015 01:37 scope? iccomq @iccomq Nov 24 2015 01:39 variable scope, basically every variable has its scope, the place from where it can be accessed if you make that object, and then want to print in console its value you will be greeted with undefined Joseph @revisualize Nov 24 2015 01:39 Should I be googling "javascript variable scope" or "javascript scope" ? iccomq @iccomq Nov 24 2015 01:40 first one will do thats becouse that variable you made in there (var speed) lives in object it can be modified by a methods you put in there Joseph @revisualize Nov 24 2015 01:41 I'm going to watch a couple videos. iccomq @iccomq Nov 24 2015 01:41 it can me accessed by a method that returns its value Varun Mangalick @varunm22 Nov 24 2015 01:42 Can I have some advice on Bonfire: Check for Palindrome? iccomq @iccomq Nov 24 2015 01:42 @varunm22 sure RoadtoMastery @RoadtoMastery Nov 24 2015 01:42 @varunm22 post your code and someone will look at it Varun Mangalick @varunm22 Nov 24 2015 01:42 well, I've got the palindrome check figured out all except removing punctuation/spaces iccomq @iccomq Nov 24 2015 01:43 but in that actual bonfire, all the links provided with help suggest how you should proceed with your code you need to use reduce method and filter out that things, research about regex Bill @kirah1314 Nov 24 2015 01:44 help regex CamperBot @camperbot Nov 24 2015 01:44 :point_right: js regex resources [wiki] Links to useful RegEx resources. See also: :clipboard: Tutorials | :syringe: Testing | :soccer: Games | :newspaper: Blogs | :package: Software Bill @kirah1314 Nov 24 2015 01:44 @varunm22 :point_up: Varun Mangalick @varunm22 Nov 24 2015 01:44 ok, makes sense, thanks @kirah1314 @camperbot and @iccomq CamperBot @camperbot Nov 24 2015 01:44 varunm22 sends brownie points to @kirah1314 and @camperbot and @iccomq :sparkles: :thumbsup: :sparkles: :star: 117 | @iccomq | http://www.freecodecamp.com/iccomq :star: 600 | @camperbot | http://www.freecodecamp.com/camperbot :star: 406 | @kirah1314 | http://www.freecodecamp.com/kirah1314 iccomq @iccomq Nov 24 2015 01:45 whoah i need to get used to that bot Bill @kirah1314 Nov 24 2015 01:45 campberbot has a lot of resources :) iccomq @iccomq Nov 24 2015 01:45 help sendmebeer CamperBot @camperbot Nov 24 2015 01:45 no wiki entry for: sendmebeer :pencil: click here to create one now!after creating your page type update to reload it here iccomq @iccomq Nov 24 2015 01:45 its useless :D RoadtoMastery @RoadtoMastery Nov 24 2015 01:46 lol iccomq @iccomq Nov 24 2015 01:46 help closure CamperBot @camperbot Nov 24 2015 01:46 :point_right: js closures [wiki] Closures are functions that refer to independent (free) variables. In other words, the function defined in the closure 'remembers' the environment in which it was created. function init() { var name = "Mozilla"; // name is a local variable created by init function displayName() { // displayName() is the inner function, a closure alert(name); // use variable declared in the parent function } displayName(); }; init(); See MDN tags: closure, javascript, js :pencil: read more about js closures on the FCC Wiki iccomq @iccomq Nov 24 2015 01:48 yup, still can't use them effectively thanks a lot camperbot, making complicated things seem easy and all, only to crush my soul later on RoadtoMastery @RoadtoMastery Nov 24 2015 01:52 help arrays CamperBot @camperbot Nov 24 2015 01:52 :point_right: bonfire diff two arrays [wiki] Explanation: Check two arrays and return a new array that contains only the items that are not in either of the original arrays. Dan Stockham @DanStockham Nov 24 2015 01:52 I have question about DPI Joseph @revisualize Nov 24 2015 01:53 help scope CamperBot @camperbot Nov 24 2015 01:53 :point_right: js scope [wiki] The current context of execution. The context in which values and expressions are "visible," or can be referenced. If a variable or other expression is not "in the current scope," then it is unavailable for use. Scopes can also be layered in a hierarchy, so that child scopes have access to parent scopes, but not vice versa. See also: :arrow_heading_up: Links :pencil: read more about js scope on the FCC Wiki RoadtoMastery @RoadtoMastery Nov 24 2015 01:53 not what i was looking for. time to look at the wiki entries Patrick McWilliams @patrickmac110 Nov 24 2015 01:54 http://codepen.io/patrcikmac110/pen/pjdxZq?editors=101 Why won't my stop interval timer work when I click my timer after its started? iccomq @iccomq Nov 24 2015 01:54 @RoadtoMastery somehow i dont think you need a reminder what an array is :D Patrick McWilliams @patrickmac110 Nov 24 2015 01:54 see line 42 in my javascript console RoadtoMastery @RoadtoMastery Nov 24 2015 01:55 @iccomq lol. just checking how in depth it is. i know what it is. just not enough info about how to apply it. thinking about doing codeacademy and youtube videos and such before continuing on with the bonfires :smiley_cat: Chris @krstfrcee Nov 24 2015 01:55 hello all! im having an issue could anyone help me out with a challenge RoadtoMastery @RoadtoMastery Nov 24 2015 01:56 @krstfrcee hi. feel free to post your question/ code Chris @krstfrcee Nov 24 2015 01:56 well here's the line in question I believe RoadtoMastery @RoadtoMastery Nov 24 2015 01:56 this room is for waypoints. there is also a room for bonfires iccomq @iccomq Nov 24 2015 01:57 @RoadtoMastery i can tell you that FFC is a lot more indepth than codeacademy Chris @krstfrcee Nov 24 2015 01:58 <p class="red-text"> view more<a href='http://www.freecatphotoapp.com'> cat photos </a> </p> RoadtoMastery @RoadtoMastery Nov 24 2015 01:58 @iccomq been told that. did all the waypoints but i want to know more about them :smile: Chris @krstfrcee Nov 24 2015 01:59 and here's the issue im told that "Your p element should have the text "View more " (with a space after it)." iccomq @iccomq Nov 24 2015 01:59 FCC gives incetive to research on your own, ask and talk to people. That makes you learn faster and better. RoadtoMastery @RoadtoMastery Nov 24 2015 01:59 @iccomq agree. thanks. maybe you should help ^ CamperBot @camperbot Nov 24 2015 01:59 roadtomastery sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles: :star: 118 | @iccomq | http://www.freecodecamp.com/iccomq Rory Smith @alanbuchanan Nov 24 2015 02:00 @krstfrcee in that case your paragraph is ending too late Chris @krstfrcee Nov 24 2015 02:01 ending too late? like to far down the page? Solms Dykman @solms Nov 24 2015 02:01 Hey everyone! Would love some help. I'm trying to make a person object, but the bonfire keeps failing me because my object has 8 keys, in stead of 6. It looks like so: var Person = function(firstAndLast) { // Properties this.first_name = (firstAndLast.split(' '))[0]; this.last_name = (firstAndLast.split(' '))[1]; // Getters this.getFullName = function(){ return (this.first_name+' '+this.last_name); }; this.getLastName = function(){ return this.last_name; }; this.getFirstName = function(){ return this.first_name; }; // Setters this.setFirstName = function(name){ this.first_name = name; }; this.setLastName = function(surname){ this.last_name = surname; }; this.setFullName = function(firstAndLast){ this.first_name = (firstAndLast.split(' '))[0]; this.last_name = (firstAndLast.split(' '))[1]; }; }; Is there a way to make the object initialise via the setter methods, so that the properties aren't seen as keys? Or am I missing something important here? CamperBot @camperbot Nov 24 2015 02:02 type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom iccomq @iccomq Nov 24 2015 02:02 <p class="red-text"> view more</p><a href='http://www.freecatphotoapp.com'> cat photos </a> @krstfrcee Rory Smith @alanbuchanan Nov 24 2015 02:02 @krstfrcee your paragraph contains more text than the instructions specify Chris @krstfrcee Nov 24 2015 02:02 oh ok Rory Smith @alanbuchanan Nov 24 2015 02:02 @iccomq i don't think answers should be posted besides, the space needs to go afterwards :) iccomq @iccomq Nov 24 2015 02:03 i actually fully support that attitude @alanbuchanan i guess i am just tired for today, should go to sleep ages ago Rory Smith @alanbuchanan Nov 24 2015 02:04 @iccomq well you have been providing much assistance, it's tiring work :) RoadtoMastery @RoadtoMastery Nov 24 2015 02:04 full time job-like lol :smile: Solms Dykman @solms Nov 24 2015 02:05 bonfire make a person CamperBot @camperbot Nov 24 2015 02:05 :fire:Bonfire: Make a Person :link: var Person = function(firstAndLast) { return firstAndLast; }; var bob = new Person('Bob Ross'); bob.getFullName(); Fill in the object constructor with the methods specified in the tests. more info: bf details | bf links | hint Chris @krstfrcee Nov 24 2015 02:05 thanks @iccomq @alanbuchanan CamperBot @camperbot Nov 24 2015 02:05 krstfrcee sends brownie points to @iccomq and @alanbuchanan :sparkles: :thumbsup: :sparkles: :star: 518 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan :star: 119 | @iccomq | http://www.freecodecamp.com/iccomq iccomq @iccomq Nov 24 2015 02:05 the funniest bit is when you try to explain a thing but you are not sure if you understand it correctly RoadtoMastery @RoadtoMastery Nov 24 2015 02:06 @iccomq that's the best way to know if you really understand something. from what i've read. iccomq @iccomq Nov 24 2015 02:06 my motto is "accept callback comparisons within .sort as a given, accept them like a jesus in your heart" "dont try to understand how .sort runs under the hood, it needs to understand you" RoadtoMastery @RoadtoMastery Nov 24 2015 02:07 why not both? iccomq @iccomq Nov 24 2015 02:08 you cant eat a cake and have a cake unless you are acheater and have 2 cakes cheaters shall burn in for loops iterating forloops within for loops RoadtoMastery @RoadtoMastery Nov 24 2015 02:09 lol. in that case that's true. unless you have a time machine then you can have your cake and eat it too. but this is really off topic lol :smile: Robert Richey @0x0936 Nov 24 2015 02:09 This message was deleted iccomq @iccomq Nov 24 2015 02:10 thats not really a nice cake @0x0936 id expect better from you, brownies looked super nice though Robert Richey @0x0936 Nov 24 2015 02:10 lol RoadtoMastery @RoadtoMastery Nov 24 2015 02:10 @0x0936 did you just happen to have that image handy? Robert Richey @0x0936 Nov 24 2015 02:11 no. i did a search and grabbed it. looked funny jkidunot @jkidunot Nov 24 2015 02:11 has anyone else had problems with losing all of their code when moving onto the next waypoint? it keeps happening to me periodically and is really annoying RoadtoMastery @RoadtoMastery Nov 24 2015 02:11 lol. still very quick @jkidunot wat's up. when i refresh the code is still there. when i go back to look at older waypoints and click the original one instead of my solution it shows up incomplete sometimes though jkidunot @jkidunot Nov 24 2015 02:13 @RoadtoMastery every so often when i complete a Waypoint and go to the next, everything is gone and i have to return to the list and go back to the one i just completed and try to move on again and then it picks everything up... iccomq @iccomq Nov 24 2015 02:14 @jkidunot did you try to just reset code with a button? Whiley Ifthenelse @rafster Nov 24 2015 02:15 Change the button with id target4 by italicizing its text. RoadtoMastery @RoadtoMastery Nov 24 2015 02:15 @jkidunot click on your fcc profile to see which waypoints you have completed. click on any of the completed ones and "see my solution" and see if the code is there. if not then this is a much bigger issue. @iccomq ^ could be that too. @rafster what do you have written so far? jkidunot @jkidunot Nov 24 2015 02:16 @iccomq I just tried that this time and it did work, i was scared it would set me back further Isaac Calvo @Icalvo1 Nov 24 2015 02:16 Hello everyone, I'm having problems with this one: palindrome("0_0 (: /-\ :) 0-0") Robert Richey @0x0936 Nov 24 2015 02:17 @Icalvo1 need to also replace all underscores with an empty string iccomq @iccomq Nov 24 2015 02:17 @RoadtoMastery it shows full code for me, tried like 5 different ones RoadtoMastery @RoadtoMastery Nov 24 2015 02:17 @Icalvo1 post your code although your question should be in https://gitter.im/FreeCodeCamp/HelpBonfires CamperBot @camperbot Nov 24 2015 02:17 type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom iccomq @iccomq Nov 24 2015 02:17 @Icalvo1 you need to use replace method and filter out those pesky things. research about regex Isaac Calvo @Icalvo1 Nov 24 2015 02:18  function palindrome(str) { string = str.replace(/\W/gi,"").toLowerCase(); //removes punctuation and whitespace from string and lower cases it str_rev = string.split("").reverse().join(""); //reverses the string if(string !== str_rev){ return false; }else{ return true; } } palindrome("eye"); RoadtoMastery @RoadtoMastery Nov 24 2015 02:18 @iccomq hmm. at least it's not a global issue (global meaning affecting everyone and we need to notify an admin about it) iccomq @iccomq Nov 24 2015 02:19 @RoadtoMastery it may still be beneficial to issue that matter RoadtoMastery @RoadtoMastery Nov 24 2015 02:19 @iccomq true. will make a note. @Icalvo1 do you know how regex works? niveditasiri @niveditasiri Nov 24 2015 02:20 var oldArray = [1,2,3,4,5]; // Only change code below this line. var newArray = oldArray; // Only change code above this line. (function() {return newArray;})(); var timesThree = oldArray.map(function(val) { return val * 3; }); I should add three to each value in the array, what am I doing wrong here? iccomq @iccomq Nov 24 2015 02:20 @niveditasiri for a start you multiply them by 3 niveditasiri @niveditasiri Nov 24 2015 02:21 okay @iccomq Isaac Calvo @Icalvo1 Nov 24 2015 02:21 yes, but in the instructions it says to remove all punctuation. problem is the last test is all punctuation. RoadtoMastery @RoadtoMastery Nov 24 2015 02:21 @Icalvo1 use this site: http://www.regexr.com/. the expression box on the very top of the screen can be edited to see what gets omitted. Rory Smith @alanbuchanan Nov 24 2015 02:21 @Icalvo1 numbers are? RoadtoMastery @RoadtoMastery Nov 24 2015 02:21 you are missing the _ in the last one i think @Icalvo1 Isaac Calvo @Icalvo1 Nov 24 2015 02:21 would I need a separate conditional with a different regex for the last part Robert Richey @0x0936 Nov 24 2015 02:22 @Icalvo1 need to also replace all underscores with an empty string RoadtoMastery @RoadtoMastery Nov 24 2015 02:22 @Icalvo1 you can combine all omissions in one //g iccomq @iccomq Nov 24 2015 02:24 OR do it the hard way like real men do: replace(/[,.:;\"\'\-\_\{\}\/\s]/g,""); RoadtoMastery @RoadtoMastery Nov 24 2015 02:25 lol that works too. Robert Richey @0x0936 Nov 24 2015 02:25 @Icalvo1 \W doesn't match underscores because it's the same as writing [^a-zA-Z0-9_] notice the underscore there? those are all values that will not be matched niveditasiri @niveditasiri Nov 24 2015 02:25 @iccomq well I didn't get anything RoadtoMastery @RoadtoMastery Nov 24 2015 02:26 @niveditasiri the requirement says to add 3. so you probably know what to do now. make sure you understand what is happening in the code though 0x0936 @0x0936 notices the real way to do regex... rm -rf /* and becomes a gardener iccomq @iccomq Nov 24 2015 02:27 @niveditasiri listen, the map method takes function as an argument, and applies that function to every element in array, right now it returns value*3 which is not what you should do right? niveditasiri @niveditasiri Nov 24 2015 02:27 hmm Rory Smith @alanbuchanan Nov 24 2015 02:28 @niveditasiri other clue: you shouldn't ignore the comment that says // Only change code above this line. iccomq @iccomq Nov 24 2015 02:28 @0x0936 notices the real way to do regex... rm -rf /* and becomes a gardener what does that even mean why its purple Robert Richey @0x0936 Nov 24 2015 02:29 @iccomq terminal command to format the hard drive iccomq @iccomq Nov 24 2015 02:29 nooo, the gardener thing RoadtoMastery @RoadtoMastery Nov 24 2015 02:29 i didn't write that. dont know why that is there ^. the purple text under my post above Rory Smith @alanbuchanan Nov 24 2015 02:29 @iccomq i think he was making a joke :) iccomq @iccomq Nov 24 2015 02:29 he just told he didnt write that! im confused Robert Richey @0x0936 Nov 24 2015 02:30 @iccomq garderner was a random profession, far away as possible from programming kirah1314 @kirah1314 confused too... Robert Richey @0x0936 Nov 24 2015 02:30 @iccomq to get purple text, /me is bestest evar 0x0936 @0x0936 is bestest evar iccomq @iccomq Nov 24 2015 02:30 ahh whatever i hate you for confusing my poor brain RoadtoMastery @RoadtoMastery Nov 24 2015 02:31 lol. almost time to call it another night. iccomq @iccomq Nov 24 2015 02:31 figuratively, not literally Isaac Calvo @Icalvo1 Nov 24 2015 02:31 "00 (: /-\ :) 0-0".replace(/[^a-zA-Z0-9]/gi,"").toLowerCase(); returns "0_000" but on regexr it works RoadtoMastery @RoadtoMastery Nov 24 2015 02:32 @Icalvo1 you are trying to get "0000" hint: Isaac Calvo @Icalvo1 Nov 24 2015 02:32 duh forgot underscore again xD [^a-zA-Z0-9] == win thanks @RoadtoMastery @0x0936 CamperBot @camperbot Nov 24 2015 02:34 icalvo1 sends brownie points to @roadtomastery and @0x0936 :sparkles: :thumbsup: :sparkles: :star: 391 | @0x0936 | http://www.freecodecamp.com/0x0936 :star: 227 | @roadtomastery | http://www.freecodecamp.com/roadtomastery Robert Richey @0x0936 Nov 24 2015 02:34 @Icalvo1 cool :) RoadtoMastery @RoadtoMastery Nov 24 2015 02:35 :) Robert Richey @0x0936 Nov 24 2015 02:35 @Icalvo1 so, the shorter way of writing that, if you're interested, is /\W|_/gi muzikmoe @muzikmoe Nov 24 2015 02:37 what does it mean: Cannot read property 'length' of null. RoadtoMastery @RoadtoMastery Nov 24 2015 02:37 @0x0936 what does the i after the g do? isn't the format //g? @Jinser you are trying to find the length of undefined i think Robert Richey @0x0936 Nov 24 2015 02:37 @RoadtoMastery it's one of three flags for regex. i is for ignoring case Rory Smith @alanbuchanan Nov 24 2015 02:38 @RoadtoMastery g = global, i = ignores case (and m = multiline) RoadtoMastery @RoadtoMastery Nov 24 2015 02:38 @0x0936 @alanbuchanan thanks. noted CamperBot @camperbot Nov 24 2015 02:38 roadtomastery sends brownie points to @0x0936 and @alanbuchanan :sparkles: :thumbsup: :sparkles: :star: 519 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan :star: 392 | @0x0936 | http://www.freecodecamp.com/0x0936 muzikmoe @muzikmoe Nov 24 2015 02:38 thanks @RoadtoMastery CamperBot @camperbot Nov 24 2015 02:38 jinser sends brownie points to @roadtomastery :sparkles: :thumbsup: :sparkles: :star: 228 | @roadtomastery | http://www.freecodecamp.com/roadtomastery iccomq @iccomq Nov 24 2015 02:38 good night guys! Rory Smith @alanbuchanan Nov 24 2015 02:38 @iccomq night :sleeping: Robert Richey @0x0936 Nov 24 2015 02:39 night @iccomq ! muzikmoe @muzikmoe Nov 24 2015 02:39 It's noon now Here RoadtoMastery @RoadtoMastery Nov 24 2015 02:39 @iccomq night :smiley: 9:39pm here muzikmoe @muzikmoe Nov 24 2015 02:39 10:39am here Rory Smith @alanbuchanan Nov 24 2015 02:39 02:39 here :) RoadtoMastery @RoadtoMastery Nov 24 2015 02:40 @alanbuchanan am or pm? Rory Smith @alanbuchanan Nov 24 2015 02:40 02:39 not 14:39 :) Robert Richey @0x0936 Nov 24 2015 02:40 the leading 0 usually means 24 hour format. 2 39am RoadtoMastery @RoadtoMastery Nov 24 2015 02:40 lol i see. didn't notice the 0 at first. wow. that's late Rory Smith @alanbuchanan Nov 24 2015 02:41 i keep forgetting some people dont use 24hr time RoadtoMastery @RoadtoMastery Nov 24 2015 02:41 @alanbuchanan just not used to seeing it written with a 0 in front. Rory Smith @alanbuchanan Nov 24 2015 02:41 i see 0x0936 @0x0936 needs brownies RoadtoMastery @RoadtoMastery Nov 24 2015 02:45 @alanbuchanan @0x0936 thanks lol. one a day though. takes a whole day to bake them i think :D CamperBot @camperbot Nov 24 2015 02:45 roadtomastery sends brownie points to @alanbuchanan and @0x0936 :sparkles: :thumbsup: :sparkles: :warning: roadtomastery already gave alanbuchanan points :warning: roadtomastery already gave 0x0936 points muzikmoe @muzikmoe Nov 24 2015 02:45 $(document).ready(function() {
$("button").addClass("animated shake");$(".btn").addClass("animated shake btn-primary");
$("#target1").addClass("animated shake 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> > Robert Richey @0x0936 Nov 24 2015 02:46 @RoadtoMastery thanks! CamperBot @camperbot Nov 24 2015 02:46 0x0936 sends brownie points to @roadtomastery :sparkles: :thumbsup: :sparkles: muzikmoe @muzikmoe Nov 24 2015 02:46 sorry, I still cannot find the error: <Cannot read property 'length' of null> CamperBot @camperbot Nov 24 2015 02:46 :star: 229 | @roadtomastery | http://www.freecodecamp.com/roadtomastery RoadtoMastery @RoadtoMastery Nov 24 2015 02:46 hmmm. this one again. any takers :smile: Robert Richey @0x0936 Nov 24 2015 02:46 @Jinser post your code please muzikmoe @muzikmoe Nov 24 2015 02:47 the code is above RoadtoMastery @RoadtoMastery Nov 24 2015 02:49 $(document).ready(function() {
$("button").addClass("animated shake");$(".btn").addClass("animated shake btn-primary");
$("#target1").addClass("animated shake btn-primary"); }); notice anything wrong here @Jinser Robert Richey @0x0936 Nov 24 2015 02:50 @Jinser I don't see anywhere in your code that length is being used. The error doesn't make sense for the code you posted. RoadtoMastery @RoadtoMastery Nov 24 2015 02:51 @Jinser which waypoint/bonfire is that? muzikmoe @muzikmoe Nov 24 2015 02:51 Robert Richey @0x0936 Nov 24 2015 02:53 Add the animated class to all elements with type button. Add the shake class to all the buttons with class .btn. Add the btn-primary class to the button with id #target1. Only add one class with each of your three selectors. katiemfrank @katiemfrank Nov 24 2015 02:54 heyas i'm lost on functions! waypoint 160 RoadtoMastery @RoadtoMastery Nov 24 2015 02:54 @katiemfrank post your code or where you are stuck and someone will help katiemfrank @katiemfrank Nov 24 2015 02:54 how do you return a random decimal function myFunction() {} // Only change code below this line. // Only change code above this line. (function(){return myFunction();})(); RoadtoMastery @RoadtoMastery Nov 24 2015 02:55 @katiemfrank see the instructions on the left. should be math.random(). Robert Richey @0x0936 Nov 24 2015 02:55 @Jinser to help get you started, here is what one line should look like: $("button").addClass("animated");
katiemfrank
@katiemfrank
Nov 24 2015 02:55
oops that isnt how youre supposed to do it lol sorry!
but thats it?
i'm making it harder than it needs to be..
muzikmoe
@muzikmoe
Nov 24 2015 02:56
yes I have done it @0x0936
Nov 24 2015 02:56
@katiemfrank yes. just follow the instructions exactly and you should clear it. make sure that you understand the code though. dont't forget the ; at the end.
Robert Richey
@0x0936
Nov 24 2015 02:57
@Jinser please paste your code again, just the jquery part
muzikmoe
@muzikmoe
Nov 24 2015 02:57
  $(document).ready(function() {$("button").addClass("animated");
$(".btn").addClass("animated shake");$("#target1").addClass("animated shake btn-primary");
});
</script>
Nov 24 2015 02:57
@katiemfrank try not to overthink the waypoints too much.
katiemfrank
@katiemfrank
Nov 24 2015 02:58
yeah no im not getting it
Robert Richey
@0x0936
Nov 24 2015 02:58

@Jinser OK great. Next is to do this:

Add the shake class to all the buttons with class .btn.

@Jinser just shake, not animated and shake
katiemfrank
@katiemfrank
Nov 24 2015 02:58
i stopped for days b/c i got stuck on this
muzikmoe
@muzikmoe
Nov 24 2015 02:58
ok done
Nov 24 2015 02:59
@katiemfrank hmmm. there could a part two to that one. i just answer what you asked.
Robert Richey
@0x0936
Nov 24 2015 02:59

@Jinser last step

Add the btn-primary class to the button with id #target1.

again, just btn-primary, not animated, not shake
Nov 24 2015 03:00
@katiemfrank nvm. it should work unless you changed some of the other code
muzikmoe
@muzikmoe
Nov 24 2015 03:00
ok Thank for your help very much. I did not obey the tip fully, so the error came out. Thanks again @0x0936
CamperBot
@camperbot
Nov 24 2015 03:00
jinser sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 393 | @0x0936 | http://www.freecodecamp.com/0x0936
Robert Richey
@0x0936
Nov 24 2015 03:00
@Jinser awesome :)
Boomer
@boomer1204
Nov 24 2015 03:00

I'm working on one of the front end projects and i'm using this line of code to pass the article title and link but it is passing it multipe times into my html. Any assistance?? Here is the line of code $('.meta' + i).prepend("<a href='" + headline + "'>" + metaData + "</a>"); and here is the codepen http://codepen.io/boomer1204/pen/QjYjQo muzikmoe @muzikmoe Nov 24 2015 03:01 I am weak in English, some times Just guess what the tips @0x0936 katiemfrank @katiemfrank Nov 24 2015 03:01 i'm sorry, i don't even know how to send it correctly RoadtoMastery @RoadtoMastery Nov 24 2015 03:01 @katiemfrank you may want to reset the code: the default should look like the following: function myFunction() { // Only change code below this line. return 0; // Only change code above this line. } (function(){return myFunction();})(); Robert Richey @0x0936 Nov 24 2015 03:02 @Jinser I understand. I noticed you're profile says that you are in China. You are doing great to learn programming and in a non-native language katiemfrank @katiemfrank Nov 24 2015 03:02 ohhh i thought if i reset it i would have to go back to the first waypoint :P RoadtoMastery @RoadtoMastery Nov 24 2015 03:02 @katiemfrank wiki format takes a while to get used to. nope just that one :smile: katiemfrank @katiemfrank Nov 24 2015 03:02 omg @RoadtoMastery thats gotta be the issue phewwww here goes nothin! RoadtoMastery @RoadtoMastery Nov 24 2015 03:03 @katiemfrank try not to change anything you didn't add to the code unless you have to. katiemfrank @katiemfrank Nov 24 2015 03:05 good call. okay i should be able to figure this out RoadtoMastery @RoadtoMastery Nov 24 2015 03:05 @katiemfrank you got this :smile: katiemfrank @katiemfrank Nov 24 2015 03:06 @RoadtoMastery at last!!!!!! thank you thank you thank you i almost quit (sorta) RoadtoMastery @RoadtoMastery Nov 24 2015 03:07 @katiemfrank gl with the rest. remember not to change anything that you have no idea what will happen. the return command prints the result of a function. Matthew Brown @barakisbrown Nov 24 2015 03:07 @katiemfrank that happens to us all. We just have to learn to pick ourselves up and start again .. Joseph @revisualize Nov 24 2015 03:08 bonfire CamperBot @camperbot Nov 24 2015 03:08 we're talking about bonfire :fire: Bonfire: Mutations Joseph @revisualize Nov 24 2015 03:08 help bonfire CamperBot @camperbot Nov 24 2015 03:08 :point_right: bonfire arguments optional [wiki] Explanation: It can be quite complicated to understand what needs to be done. There is always many ways to do something when coding but regardless of the algorithm used, we have to create a program that does the following: • It has to add two numbers passed as parameters and return the sum. • It has to check if any of the numbers are actual numbers, otherwise return undefined and stop the program right there. • It has to check if it has one or two arguments passed. More re ignored. • If it has only one then it has to return a function that used that number and expects another one, to then add it. Joseph @revisualize Nov 24 2015 03:09 grrr.. Robert Richey @0x0936 Nov 24 2015 03:09 while (fellDown) { getUp(); count++; } console.log(count); // error: stack overflow Matthew Brown @barakisbrown Nov 24 2015 03:10 @0x0936 LOL so true RoadtoMastery @RoadtoMastery Nov 24 2015 03:10 @0x0936 nice way to put it Robert Richey @0x0936 Nov 24 2015 03:10 heh :) muzikmoe @muzikmoe Nov 24 2015 03:12 Luckily, I have gotten lots of help from your nice friends :smile: RoadtoMastery @RoadtoMastery Nov 24 2015 03:13 Good Night all. Happy Coding :smile: 10:12pm est here @Jinser :satellite: :smile: muzikmoe @muzikmoe Nov 24 2015 03:14 I am going to have a lunch :smile: Tristan J @tsjones08 Nov 24 2015 03:16 How do you solve the 4th question in 114 jQuery Joseph @revisualize Nov 24 2015 03:16 I'm confused:  function factorialize(num) { if (num === 0) { return 1; } for (var i = 1; i > num; i++) { num *= num - 1; } return num; } factorialize(5); // 120 factorialize(10); // 3628800 factorialize(20); // 2432902008176640000 factorialize(0); // 1 ... I'm not sure why that is. Shouldn't it be 0? Matthew Brown @barakisbrown Nov 24 2015 03:17 @revisualize its recursion Joseph @revisualize Nov 24 2015 03:17 Recursion? Calling itself over again? Matthew Brown @barakisbrown Nov 24 2015 03:17 @revisualize nvm .. my bad .. @revisualize what are you confused about? muzikmoe @muzikmoe Nov 24 2015 03:18 in math It's like this N! Matthew Brown @barakisbrown Nov 24 2015 03:18 yup Joseph @revisualize Nov 24 2015 03:18 I don't understand the math. I don't know what N! means. Matthew Brown @barakisbrown Nov 24 2015 03:18 5! = 5 4 3 2 1 muzikmoe @muzikmoe Nov 24 2015 03:18 1 2 3*4 = 4! Matthew Brown @barakisbrown Nov 24 2015 03:18 grr 5! == 5 times 4 times 3 time 2 times 1 Joseph @revisualize Nov 24 2015 03:19 okay. I don't get it. num *= num - 1 wait. that doesn't work. crap. Matthew Brown @barakisbrown Nov 24 2015 03:20 num = num * (num - 1) is the same as num * = num - 1 muzikmoe @muzikmoe Nov 24 2015 03:20 num = num * (num-1) Robert Richey @0x0936 Nov 24 2015 03:21 5 * factorialize(4) 5 * 4 * factorialize(3) 5 * 4 * 3 * factorialize(2) 5 * 4 * 3 * 2 * factorialize(1) 5 * 4 * 3 * 2 * 1 = 120 muzikmoe @muzikmoe Nov 24 2015 03:21 and there are the similar like =+ -= %= Joseph @revisualize Nov 24 2015 03:22 @0x0936 so, it wants me to call the function again to process the maths. Robert Richey @0x0936 Nov 24 2015 03:22 @revisualize ah, woops. the code you posted isn't the recursive version. sorry Matthew Brown @barakisbrown Nov 24 2015 03:22 @0x0936 that was my bad too when he first posted. I initialy though this was a recursion version too .. DOH Joseph @revisualize Nov 24 2015 03:23 I don't even understand what the hell I'm doing. Robert Richey @0x0936 Nov 24 2015 03:23 @revisualize you can solve it however you want. recursion is common for factorials, but you can also use a loop Joseph @revisualize Nov 24 2015 03:23 These waypoints haven't ever covered recursion. I don't know what you mean. Meh. I'm not really sure how it's supposed to help. Maybe I need to go take math classes before I can complete this. Robert Richey @0x0936 Nov 24 2015 03:25 @revisualize don't stress. it's intended that you seek external sources to learn - which may slow you down a lot at times Ang Li @woleizihan Nov 24 2015 03:27 does freecodecamp have protection against infinite loop? Robert Richey @0x0936 Nov 24 2015 03:27 @revisualize if you want to, I can help break down the problem step by step, using a loop. don't even need to think about recursion @woleizihan not that I'm aware of Ang Li @woleizihan Nov 24 2015 03:28 and it remembers the code you entered so if you enter some infinite loop Robert Richey @0x0936 Nov 24 2015 03:28 yes. that's when you'd need to clear your browser's local cache wiki storage CamperBot @camperbot Nov 24 2015 03:28 :point_right: clear your browser's local storage [wiki] Removing all your locally stored challenges will solve many problems related to the browser crashing on FreeCodeCamp In Chrome: • On 'freecodecamp.com' open your console • Windows: Ctrl + Shift + J • Mac OS: Cmd + Opt + J • Go to resources tab(chrome). • There click on the localStorage link in the nav bar on the right. • Delete all the entries on the right side. • See if this solves your issue Alternatively, if you are having issues with a specific challenge freezing your browser, find the name of that challenge in local storage and delete just that one. :pencil: read more about clear your browsers local storage on the FCC Wiki Ang Li @woleizihan Nov 24 2015 03:28 ah so that's the only way Robert Richey @0x0936 Nov 24 2015 03:29 the only way I'm aware of Ang Li @woleizihan Nov 24 2015 03:31 thx! :sparkles: McCoy @mtbuck24 Nov 24 2015 03:32 When programming is there ever a logical explanation example: firstName[firstName.length - 1] chooses the last letter of first name. Is there a way to look at that code and know that IS what it is doing? I guess I mean to say a logical explanation put into simple english haha Robert Richey @0x0936 Nov 24 2015 03:34 @mtbuck24 it's intuitive after a while. the characters in a string have an index position that starts at 0. So, a word that has a length of 8 will have an index range of 0 - 7. thus, word[word.length - 1] will always select the last character, or last element if you prefer McCoy @mtbuck24 Nov 24 2015 03:36 awesome! Thanks @0x0936 that helps! CamperBot @camperbot Nov 24 2015 03:36 mtbuck24 sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles: :star: 394 | @0x0936 | http://www.freecodecamp.com/0x0936 Robert Richey @0x0936 Nov 24 2015 03:36 cool :) McCoy @mtbuck24 Nov 24 2015 03:48 I understand an array, but what is a nested array and what can it be used for? example [["bulls", 23]] My biggest thing is finding real life application or what it could be like when you actually use it in your code for a certain project/ app Robert Richey @0x0936 Nov 24 2015 03:50 nested arrays are useful for things like grids, or state machines Anthony Guru @mrguru2016 Nov 24 2015 03:50 I need a refresh on creating a h1 element with the text Hello World McCoy @mtbuck24 Nov 24 2015 03:51 haha okay that helps clear my confusion! So a typical app deveoper would probably not use this? - @0x0936 Robert Richey @0x0936 Nov 24 2015 03:51 var grid = [ [1, 0, 0, 1], // row 0 [0, 0, 1, 0], // row 1 [1, 0, 1, 1] // row 2, etc ]; McCoy @mtbuck24 Nov 24 2015 03:51 @mrguru2016 hit reset to refresh Robert Richey @0x0936 Nov 24 2015 03:52 @mtbuck24 depends on the purpose of the app. web dev can get into cs, but relates mostly to information management shang-yu @chiang-shang-yu Nov 24 2015 03:53 Your p element should contain the first few words of the provided kitty ipsum text. what means? Anthony Guru @mrguru2016 Nov 24 2015 03:53 @mtbuck24 lol you misunderstood Robert Richey @0x0936 Nov 24 2015 03:54 @mrguru2016 <h1>Hello World</h1> like that? Anthony Guru @mrguru2016 Nov 24 2015 03:54 @mtbuck24 Im on this portion Waypoint: Inherit Styles from the Body Element McCoy @mtbuck24 Nov 24 2015 03:54 Okay so when it is double brackets it essentially can hold a multiple rows of data with in the first set of brackets? @0x0936 Robert Richey @0x0936 Nov 24 2015 03:55 @mtbuck24 right. it's much more common to see hierarchical objects than multi-dimensional arrays though McCoy @mtbuck24 Nov 24 2015 03:55 oh lol just got that @mrguru2016 . Yep just like @0x0936 suggested is how you would do it Awesome that helps! Thanks @0x0936 CamperBot @camperbot Nov 24 2015 03:55 mtbuck24 sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles: :warning: mtbuck24 already gave 0x0936 points Anthony Guru @mrguru2016 Nov 24 2015 03:56 <style> body { background-color: black; } <h1> hello World <h1> </style> This is where im needing refreshing on really just lost my grasp on adding elements Huan Zhao @huanzhaoca Nov 24 2015 03:57 Here is an example of using sort with a compare function that will sort the elements from smallest to largest number: var array = [1, 12, 21, 2]; array.sort(function(a, b) { return a - b; }); Anyone knows why return a - b sorts the array from small to large? @mrguru2016 you need to close your tag </h1> shang-yu @chiang-shang-yu Nov 24 2015 03:58 Your p element should contain the first few words of the provided kitty ipsum text. how to code this ? Anthony Guru @mrguru2016 Nov 24 2015 03:58 @huanzhaoca done Robert Richey @0x0936 Nov 24 2015 03:58 @mrguru2016 keep styles rules separate from html content. <style> body { background-color: black; } </style> <h1>Hello World</h1> Anthony Guru @mrguru2016 Nov 24 2015 03:59 @0x0936 thanks i figured CamperBot @camperbot Nov 24 2015 03:59 mrguru2016 sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles: :star: 396 | @0x0936 | http://www.freecodecamp.com/0x0936 melric @melric Nov 24 2015 03:59 hi all! how can I solve this please? :) var myFirstName = "melric"; var mylastName = "dejucos"; // Only change code above this line. if(typeof("myFirstName") !== "undefined" && typeof(myLastName) !== "undefined"){(function(){return myFirstName + ', ' + myLastName;})();} Robert Richey @0x0936 Nov 24 2015 04:00 @chiang-shang-yu which waypoint are you working on? Joseph @revisualize Nov 24 2015 04:00 function factorialize(num) { if (num === 0) { return 1; } for (var i = 1; i <= num; i++) { num = num * (num - i); } return num; } factorialize(0); // 1 ... I'm not sure why that is. Shouldn't it be 0? factorialize(5); // 120 melric @melric Nov 24 2015 04:00 String Variables shang-yu @chiang-shang-yu Nov 24 2015 04:00 Fill in the Blank with Placeholder Text Joseph @revisualize Nov 24 2015 04:01 That isn't going to work. GRRR. shang-yu @chiang-shang-yu Nov 24 2015 04:01 @0x0936 HI,my waypoint is Fill in the Blank with Placeholder Text Robert Richey @0x0936 Nov 24 2015 04:01 @huanzhaoca it's the magic of how sort works. if the result from the operation is negative, a is sorted before b. if it's 0, sort order remains unchanged, and if the result of the operation is positive, a is sorted after b Hans van Riet @hansinla Nov 24 2015 04:01 @revisualize factorialize(0); // 1 ... I'm not sure why that is. Shouldn't it be 0? No per definition. Joseph @revisualize Nov 24 2015 04:02 @hansinla okay. McCoy @mtbuck24 Nov 24 2015 04:02 Is this right? var ourArray = [3,2,1]; ourArray[0] = 1; // equals [1,2,1] Joseph @revisualize Nov 24 2015 04:02 I always though 0 * 0 = 0 Anthony Guru @mrguru2016 Nov 24 2015 04:02 <style> body { background-color: black; } </style> <h1> hello World </h1> Then, let's give all elements on your page the color of green by adding color: green; to your body element's style declaration. Finally, give your body element the font-family of Monospace by adding font-family: Monospace; to your body element's style declaration. Robert Richey @0x0936 Nov 24 2015 04:03 @chiang-shang-yu it wants you to replace the text in the p element with text given in the description. Replace the text inside your p element with the first few words of this kitty ipsum 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. Hans van Riet @hansinla Nov 24 2015 04:03 @hansinla as for your for loop; let’s assume that i == num, then num-i = 0 and you’re multiplying by 0 melric @melric Nov 24 2015 04:03 chiang-shang-yu okay McCoy @mtbuck24 Nov 24 2015 04:03 Wouldn't this be equals[1,1,1] since the value of 0 is being modified to equal 1? Huan Zhao @huanzhaoca Nov 24 2015 04:03 @0x0936 Thanks a lot. one more question for you: where can I find the document regarding this explanation? CamperBot @camperbot Nov 24 2015 04:03 huanzhaoca sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles: :star: 397 | @0x0936 | http://www.freecodecamp.com/0x0936 Robert Richey @0x0936 Nov 24 2015 04:04 shang-yu @chiang-shang-yu Nov 24 2015 04:04 @0x0936 oh i thought it's need some style haha @0x0936 thanks CamperBot @camperbot Nov 24 2015 04:04 chiang-shang-yu sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles: :star: 398 | @0x0936 | http://www.freecodecamp.com/0x0936 Alexander Køpke @alexanderkopke Nov 24 2015 04:05 @mtbuck24 [0] is the index position. Which starts at 0. Huan Zhao @huanzhaoca Nov 24 2015 04:05 @0x0936 thanks again :D CamperBot @camperbot Nov 24 2015 04:05 huanzhaoca sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles: :warning: huanzhaoca already gave 0x0936 points Alexander Køpke @alexanderkopke Nov 24 2015 04:05 So it changes only the value in the first position of the array McCoy @mtbuck24 Nov 24 2015 04:06 @alexanderkopke so if I understand correctly. Would 1 be replacing index positions 0,1, and 2? Robert Richey @0x0936 Nov 24 2015 04:06 @huanzhaoca you're welcome! :) McCoy @mtbuck24 Nov 24 2015 04:06 Oh gotcha! Thank you @alexanderkopke CamperBot @camperbot Nov 24 2015 04:06 mtbuck24 sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles: :star: 258 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke McCoy @mtbuck24 Nov 24 2015 04:06 Don't know how I missed that haha Alexander Køpke @alexanderkopke Nov 24 2015 04:06 :+1: Takes some getting used to McCoy @mtbuck24 Nov 24 2015 04:08 @alexanderkopke Definitely and I appreciate it! Was totally reading it wrong Robert Richey @0x0936 Nov 24 2015 04:12 // broken code, nothing to see here Anthony @vanillakernel Nov 24 2015 04:16 Im not sure where to file a bug report for investigation, but I believe there is a typo in the fourth test on Waypoint: Specify How Fonts Should Degrade: "Be sure to close your comment by deleting all trailing comment tags, i.e. -->." It should read something like "Be sure to close your comment by adding -->." Robert Richey @0x0936 Nov 24 2015 04:19 @revisualize it was easier for me to think about it like this function factorialize(num) { for (var i = num, product = 1; i > 1; i--) { product *= i; } return product; } Johnathon Sykes @seesykescode Nov 24 2015 04:20 Im nearly there on this "Confirm the ending" bonfire but need a bit of guidance...Was successfully able to get nearly all tests to pass, except 2. It seems that anything that's pulling more than 2 characters and it suppose to return false blows up in my face. I've been trying to play with the str.substr length but can't seem to get the exact results. A bit confused as to how to nail the arguments for substr and still have it pass for all tests. function end(str, target) { lastChar = str.substr(-1); console.log(lastChar); if (lastChar === target){ return true; } else { return false; } } end("Bastian", "n"); Robert Richey @0x0936 Nov 24 2015 04:20 @vanillakernel there is a blue button on the left called 'Bug' you can click to file a bug report Johnathon Sykes @seesykescode Nov 24 2015 04:20 bonfire confirm the ending CamperBot @camperbot Nov 24 2015 04:21 :fire:Bonfire: Confirm the Ending :link: function end(str, target) { // "Never give up and good luck will find you." // -- Falcor return str; } end('Bastian', 'n'); Check if a string (first argument) ends with the given target string (second argument). more info: bf details | bf links | hint Anthony @vanillakernel Nov 24 2015 04:21 Sweet, thanks @0x0936 CamperBot @camperbot Nov 24 2015 04:21 vanillakernel sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles: :star: 399 | @0x0936 | http://www.freecodecamp.com/0x0936 Robert Richey @0x0936 Nov 24 2015 04:23 @johndsykes86 instead of hard coding -1 as the argument to substr(), what you really want is the end of the string with length of target. does this help? Johnathon Sykes @seesykescode Nov 24 2015 04:28 yea, that's what I thought, but from reading the documentation -1 would be the end of the string no? or am I going about it wrong @0x0936 and I cant put a negative length... Robert Richey @0x0936 Nov 24 2015 04:29 -1 gives you the last character. you want the ending string with length of target. so, if target is arbitrarily 'ing' it has a length of 3 and substr could be passed a -3. but don't hard code it Johnathon Sykes @seesykescode Nov 24 2015 04:30 oh oh oh i think the lightbulb went off. Robert Richey @0x0936 Nov 24 2015 04:30 yeah great! wisekrish @wisekrish Nov 24 2015 04:35 how do you nest a text input element within a form element. sorry, I'm a new to this and just started today! Robert Richey @0x0936 Nov 24 2015 04:37 @wisekrish like this? and, don't apologize. we're all learning here <form> <input type="text"> </form> Johnathon Sykes @seesykescode Nov 24 2015 04:42 Thanks @0x0936 Got it nailed with your suggestion, thanks to you. it never occured to me not to hardcode it. Live and learn I guess. oops. probably shouldn't have posted the answer though (derp) TheRealCoder @TheRealCoder Nov 24 2015 04:43 i need helping puttting an image in html with img-responsive Robert Richey @0x0936 Nov 24 2015 04:44 @johndsykes86 cool :) @TheRealCoder is this a waypoint? if so, which one? James @Andrale Nov 24 2015 04:46 Quick question. How do you write CSS classes? I can't remember Robert Richey @0x0936 Nov 24 2015 04:47 @Andrale .className { property : value; } Hans van Riet @hansinla Nov 24 2015 04:47 This message was deleted SoKawaiii @SoKawaiii Nov 24 2015 04:48 what's the proper way to give an element an ID? Hans van Riet @hansinla Nov 24 2015 04:48 @SoKawaiii id=“id_name" Joseph @revisualize Nov 24 2015 04:49 Thanks @0x0936 CamperBot @camperbot Nov 24 2015 04:49 revisualize sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles: :star: 400 | @0x0936 | http://www.freecodecamp.com/0x0936 James @Andrale Nov 24 2015 04:49 @0x0936 Then how would I assign it to lets say a h1 element? lucypeony @lucypeony Nov 24 2015 04:49 I type <h2>CatPhotoApp</h2>? Robert Richey @0x0936 Nov 24 2015 04:50 @revisualize I think the recursive version is a lot easier to read and understand, if you want a PM Isaac Calvo @Icalvo1 Nov 24 2015 04:50 <h1 id="myid"></h1> lucypeony @lucypeony Nov 24 2015 04:50 and there is error$ is not defined?
Robert Richey
@0x0936
Nov 24 2015 04:50
@Icalvo1 class, not an id
Joseph
@revisualize
Nov 24 2015 04:50
@0x0936 Recursion isn't explained in the previous Waypoints.
Hans van Riet
@hansinla
Nov 24 2015 04:50
@lucypeony show your code
lucypeony
@lucypeony
Nov 24 2015 04:51
the code

<h1>Hello World</h1>

<h2>CatPhotoApp</h2>

i run tests:and the response is : $is not defined Robert Richey @0x0936 Nov 24 2015 04:51 @revisualize feel free to break out of the box a little. these waypoints and bonfires accept ES6 syntax as well, but only teach ES5. That doesn't mean you shouldn't consider ES6 Hans van Riet @hansinla Nov 24 2015 04:51 @lucypeony there must be more code? SoKawaiii @SoKawaiii Nov 24 2015 04:52 @hansinla I understand but for some reason I'm not getting it right lucypeony @lucypeony Nov 24 2015 04:52 no ,i am on waypoint :Headline with the h2 element i use chrome browser Isaac Calvo @Icalvo1 Nov 24 2015 04:52 not sure why the function is failing works in mdn console  function titleCase(str) { //split string into array of words string = str.split(" "); //return index of the first letter in each word using charAt() string.map(function(val){ val = val.replace(val.charAt(0), val.charAt(0).toUppercase()); // tim.replace(tim.charAt(0), tim.charAt(0).toUpperCase()); }); //make the letter uppercase return str; } titleCase("I'm a little tea pot"); SoKawaiii @SoKawaiii Nov 24 2015 04:53 How do I paste code into here Joseph @revisualize Nov 24 2015 04:53 @0x0936 I'm learning basic JS. Is there really a difference from ES5 and ES6 from what I've already learned? SoKawaiii @SoKawaiii Nov 24 2015 04:53 like that ^ Hans van Riet @hansinla Nov 24 2015 04:53 @SoKawaiii show what you have SoKawaiii @SoKawaiii Nov 24 2015 04:53 How? James @Andrale Nov 24 2015 04:53 How can I add a class to a h1 element? Hans van Riet @hansinla Nov 24 2015 04:53 This message was deleted Bill @kirah1314 Nov 24 2015 04:53 @Icalvo1 you're missing the rest of the strings Joseph @revisualize Nov 24 2015 04:53 <h1 class="classname">text</h1> Hans van Riet @hansinla Nov 24 2015 04:54 wiki format CamperBot @camperbot Nov 24 2015 04:54 :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 ⏎] See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics Mags Prescott @magsprescott Nov 24 2015 04:54 please Joseph @revisualize Nov 24 2015 04:54 WO! Mags Prescott @magsprescott Nov 24 2015 04:54 please.. Joseph @revisualize Nov 24 2015 04:54 WOW! Look at the time Bill @kirah1314 Nov 24 2015 04:54 @Icalvo1 and strings are immutable so if you return str you're gonna return the original str since you didn't change str Johnathon Sykes @seesykescode Nov 24 2015 04:55 @magsprescott what exactly do you need help with. Hans van Riet @hansinla Nov 24 2015 04:55 @magsprescott what’s your question? SoKawaiii @SoKawaiii Nov 24 2015 04:55 <form action="/submit-cat-photo"> <label><input type="radio" name="indoor-outdoor" checked> Indoor</label> <label><input type="radio" name="indoor-outdoor"> Outdoor</label> <label><input type="checkbox" name="personality" checked> Loving</label> <label><input type="checkbox" name="personality"> Lazy</label> <label><input type="checkbox" name="personality"> Energetic</label> <input type="text" placeholder="cat photo URL" required> <button type="submit">Submit</button> </form> Robert Richey @0x0936 Nov 24 2015 04:55 @revisualize you're probably fine for now, but the world is shifting to ES6. I predict within a year all of these challenges will be updated to show only ES6 syntax Joseph @revisualize Nov 24 2015 04:55 Sure. SoKawaiii @SoKawaiii Nov 24 2015 04:55 how do I give this form element an ID Hans van Riet @hansinla Nov 24 2015 04:55 @SoKawaiii <form id=“id_name”> Joseph @revisualize Nov 24 2015 04:55 @0x0936 However, where I'm currently at is all ES5 and ES6. Mags Prescott @magsprescott Nov 24 2015 04:56 "Use the jQuery addClass() function to give the classes animated and bounce to your button elements" SoKawaiii @SoKawaiii Nov 24 2015 04:56 <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> oh wait Joseph @revisualize Nov 24 2015 04:56 @0x0936 I've worked my way from the top down and I'm now on Bonfire number 4. Mags Prescott @magsprescott Nov 24 2015 04:57 wait nevermind i think i got it SoKawaiii @SoKawaiii Nov 24 2015 04:57 <form id="cat-photo-app"> <form action="/submit-cat-photo"> <label><input type="radio" name="indoor-outdoor" checked> Indoor</label> <label><input type="radio" name="indoor-outdoor"> Outdoor</label> <label><input type="checkbox" name="personality" checked> Loving</label> <label><input type="checkbox" name="personality"> Lazy</label> <label><input type="checkbox" name="personality"> Energetic</label> <input type="text" placeholder="cat photo URL" required> <button type="submit">Submit</button> Hans van Riet @hansinla Nov 24 2015 04:57 @magsprescott so here is a hint .addClass(“bounce”); SoKawaiii @SoKawaiii Nov 24 2015 04:57 neither way works ;_; Robert Richey @0x0936 Nov 24 2015 04:57 @revisualize yep that's fine. I'm not pushing it. just keep it in mind is all. Hans van Riet @hansinla Nov 24 2015 04:57 @SoKawaiii your have two <form> tags now, you should only have one Mags Prescott @magsprescott Nov 24 2015 04:58 dont you need a hashtag? or not.. i forgot.. SoKawaiii @SoKawaiii Nov 24 2015 04:58 oh thanks Hans van Riet @hansinla Nov 24 2015 04:58 @magsprescott you add a class by name Mags Prescott @magsprescott Nov 24 2015 04:58 okay okay Rishav Kumar @rishav171 Nov 24 2015 04:59 i am not able to go to next map after completing Joseph @revisualize Nov 24 2015 04:59 @0x0936 Thanks for your help. I'm off to bed now. It is 9pm and 430am comes early. CamperBot @camperbot Nov 24 2015 04:59 revisualize sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles: :warning: revisualize already gave 0x0936 points Hitesh Aloney @Hitesh0413 Nov 24 2015 04:59 @breadstickguy I used this code$("#target4").html("<i>#target4</i>"); inside the script tag.
Hans van Riet
@hansinla
Nov 24 2015 04:59
@SoKawaiii you dont have a closing </form> tag at the end of your code
Robert Richey
@0x0936
Nov 24 2015 04:59
good night @revisualize
Rishav Kumar
@rishav171
Nov 24 2015 05:00
after completing one map ..coreectly it keeps loading and does not goes to next browser
Mags Prescott
@magsprescott
Nov 24 2015 05:00
i still cant do the "Use the jQuery addClass() function to give the classes animated and bounce to your button elements."
goodness
ok let me take a 1 minute break
Hans van Riet
@hansinla
Nov 24 2015 05:01
@magsprescott how would you select the button?
Robert Richey
@0x0936
Nov 24 2015 05:01
@rishav171 which one are you stuck on?
Rishav Kumar
@rishav171
Nov 24 2015 05:01
$("button").addClass("animated bounce") use this code mags SoKawaiii @SoKawaiii Nov 24 2015 05:02 @hansinla yeah I understand thanks for the help Robert Richey @0x0936 Nov 24 2015 05:02 @rishav171 which waypoint is that? Rishav Kumar @rishav171 Nov 24 2015 05:02 i ma stuck in jquery Jquery - 1 Mags Prescott @magsprescott Nov 24 2015 05:02 are you kidding me all i had to do was copy paste? that makes me angry Rishav Kumar @rishav171 Nov 24 2015 05:03 yes .!!:) @0x0936 is there issue with browser? Robert Richey @0x0936 Nov 24 2015 05:04 sorry @rishav171 I'm having a hard time understanding. If your code is causing an infinite loop, the best way to fix that is to clear your browser's storage wiki storage CamperBot @camperbot Nov 24 2015 05:04 :point_right: clear your browser's local storage [wiki] Removing all your locally stored challenges will solve many problems related to the browser crashing on FreeCodeCamp In Chrome: • On 'freecodecamp.com' open your console • Windows: Ctrl + Shift + J • Mac OS: Cmd + Opt + J • Go to resources tab(chrome). • There click on the localStorage link in the nav bar on the right. • Delete all the entries on the right side. • See if this solves your issue Alternatively, if you are having issues with a specific challenge freezing your browser, find the name of that challenge in local storage and delete just that one. :pencil: read more about clear your browsers local storage on the FCC Wiki SoKawaiii @SoKawaiii Nov 24 2015 05:11 .green-box { background-color: green; padding: 40px 20px 20x 40px; } oh wait nvm Boris @boris-in-london Nov 24 2015 05:12 lol Farshid Palad @Capriano Nov 24 2015 05:13 Guys I got a problem with "Target the same element with multiple jQuery Selectors waypoint" Isaac Calvo @Icalvo1 Nov 24 2015 05:14 got it thanks @kirah1314 forgot to string.join(" "); I was trying to do this within the call back function and it was failing CamperBot @camperbot Nov 24 2015 05:14 icalvo1 sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles: :star: 409 | @kirah1314 | http://www.freecodecamp.com/kirah1314 Farshid Palad @Capriano Nov 24 2015 05:14 This is my code$("button").addClass("animated bounce");
$(".btn").addClass("animated shake");$("#target1").addClass("btn-primary");
but it gives error that Only add one class with each of your three selectors
anyone face same issues?
Isaac Calvo
@Icalvo1
Nov 24 2015 05:16

Add the animated class to all elements with type button.

Add the shake class to all the buttons with class .btn.

Add the btn-primary class to the button with id #target1.

• bounce from first -shake from second last looks fine
@Capriano
Nov 24 2015 05:17
so how should I change my code you think?
Isaac Calvo
@Icalvo1
Nov 24 2015 05:18
each .addClass should only add 1 class in that waypoint
@Capriano
Nov 24 2015 05:18
well ... do I have more than one? I am new to javascript
Isaac Calvo
@Icalvo1
Nov 24 2015 05:18
$("button").addClass("animated"); etc etc Robert Richey @0x0936 Nov 24 2015 05:19 .addClass("animated bounce"); is adding two classes Farshid Palad @Capriano Nov 24 2015 05:19 oh i see let me seeif i can fix it thanks Isaac Calvo @Icalvo1 Nov 24 2015 05:19 np Farshid Palad @Capriano Nov 24 2015 05:20 duh when you know its so simple Dan Kuenneke @DanKuenneke Nov 24 2015 05:27 need help with "truncate a string" exercise Mags Prescott @magsprescott Nov 24 2015 05:28 need help.. Dan Kuenneke @DanKuenneke Nov 24 2015 05:28 yes Mags Prescott @magsprescott Nov 24 2015 05:28 <script>$(document).ready(function() {
$("button").addClass(animated);$(".btn").addcClass(shake);
$("#target1").addClass(btn-primary); }); </script> Your #target1 element should have the classes animated‚ shake and btn-primary. Cannot read property 'length' of null @Capriano how did you do it Isaac Calvo @Icalvo1 Nov 24 2015 05:32 well i just found out you can run a call back function within a call back function... cool stuff lol Nik Kotov @pnw-io Nov 24 2015 05:32 There's an extra C in the .btn class TheRealCoder @TheRealCoder Nov 24 2015 05:47 my image wont pop up on html Alem @alemneh Nov 24 2015 05:47 my pageId variable is coming up undefined???? http://codepen.io/alemneh/pen/dYEWpe?editors=001 TheRealCoder @TheRealCoder Nov 24 2015 05:47 when im using the src im putting src=http://bit.ly/fcc-running-cats." and closing it and all that but the image wont pop up on phone do i need to do somehting with href and if so can someone help me with what href is exactly? Alexander Køpke @alexanderkopke Nov 24 2015 05:50 @TheRealCoder the url in quotes TheRealCoder @TheRealCoder Nov 24 2015 05:51 put the url in quotes? under src or href? Rohan @Rohan2018 Nov 24 2015 05:52 I'm stuck at #163. I appear to have completed the code differently than the lesson intended me to but somehow ended up with the proper output. I thought I had hit all the right notes, but the debug is telling me I haven't hit any of them. Can someone help? I would super appreciate it :) if (flip === 1){ return "tales"; } else { return "heads"; } Bill @kirah1314 Nov 24 2015 05:56 @Rohan2018 "tails" @Rohan2018 and reread the instructions :) the answer is there Rohan @Rohan2018 Nov 24 2015 05:58 haha, wow... I'm speechless. that was bad Thanks, I'll see if I can figure it out LJ Roos @bluegoon Nov 24 2015 05:59 HTML problem, is there anything wrong with this statement? <button type='btn btn-primary'><i class='fa fa-paper-plane'>Submit</i></button> Bill @kirah1314 Nov 24 2015 06:00 @bluegoon I think you mean class='btn btn-primary' LJ Roos @bluegoon Nov 24 2015 06:00 @kirah1314 You're my hero, thank you! CamperBot @camperbot Nov 24 2015 06:00 bluegoon sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles: :star: 411 | @kirah1314 | http://www.freecodecamp.com/kirah1314 Bill @kirah1314 Nov 24 2015 06:01 @bluegoon glad to help :) mgarcell @mgarcell Nov 24 2015 06:04 hey guys I'm on lesson 172 "Waypoint: Make Unique Objects by Passing Parameters to our Constructor" and while I continue to complete the lessons, I feel like I am more-so following the format of the given example rather than retaining what I am being taught. Should I be concerned about this? Any advice? Maybe upcoming lessons will build upon this and test my knowledge? Bill @kirah1314 Nov 24 2015 06:07 @mgarcell I'm not so sure we have a lesson 172 haha mgarcell @mgarcell Nov 24 2015 06:07 Oops Well that's the number in the top right corner Bill @kirah1314 Nov 24 2015 06:07 @mgarcell ahh that's your brownie points help brownie points CamperBot @camperbot Nov 24 2015 06:07 :point_right: brownie points [wiki] The number beside your picture on Free Code Camp tells you how many Brownie Points you have. There are three ways you can get Brownie Points: 1. Complete challenges - you get one point per challenge you complete 2. Post relevant links on Camper News - you get 1 point for posting a link, and another point for each upvote your link gets 3. Help other campers in chat - each time you help another camper and they thank you (by typing "thanks @yourname"), you will get a point Brownie Points help you look like the kind of person who codes a lot, shares relevant links, and helps people. They also add to your Streak. :pencil: read more about brownie points on the FCC Wiki mgarcell @mgarcell Nov 24 2015 06:08 @kirah1314 Thanks! Didn't know that CamperBot @camperbot Nov 24 2015 06:08 mgarcell sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles: :star: 413 | @kirah1314 | http://www.freecodecamp.com/kirah1314 Bill @kirah1314 Nov 24 2015 06:08 @mgarcell you're welcome, I'm looking at the waypoint now. It's a new one so I didn't even finish it mgarcell @mgarcell Nov 24 2015 06:09 I just happened to pause there for the moment to ask this in the chat But I've felt this way since about the time I started learning arrays Bill @kirah1314 Nov 24 2015 06:11 @mgarcell ok so you solved it right? and you want to know what's going on? mgarcell @mgarcell Nov 24 2015 06:12 Haven't looked at that one yet But basically from arrays up until this point Bill @kirah1314 Nov 24 2015 06:13 @mgarcell well think of waypoints as basically a hand-holding process mgarcell @mgarcell Nov 24 2015 06:13 I guess what I am asking is: Is this crucial stuff that maybe I should go back and look at again, or just keep going and it will make more sense later, etc? Bill @kirah1314 Nov 24 2015 06:13 @mgarcell the instructions are simplified and there are examples which you just change something minor and you get the answer mgarcell @mgarcell Nov 24 2015 06:14 Cause I am to complete the tasks, but not fully "getting it" Bill @kirah1314 Nov 24 2015 06:14 if you're new to programming then it's like you're learning a new language, most of this stuff won't stick 100% until you actually use it which you'll get the chance when you're at the bonfires and ziplines and even then there's still a ton of new things to learn about lol mgarcell @mgarcell Nov 24 2015 06:15 ok that's what I was thinking might be the case I saw those things with coming up with huge number of hours So I'll just keep it going until I get there and try to take in all of this as best as possible Bill @kirah1314 Nov 24 2015 06:16 @mgarcell just remember as much as you can from waypoints and read up if you need to but you still have to keep moving on to bonfires @mgarcell yes, exactly mgarcell @mgarcell Nov 24 2015 06:16 perfect @kirah1314 thanks again! CamperBot @camperbot Nov 24 2015 06:16 mgarcell sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles: :warning: mgarcell already gave kirah1314 points Rishav Kumar @rishav171 Nov 24 2015 06:20 how much months it can take to complete full programs (if i dedicate 4 hours daily ) Farshid Palad @Capriano Nov 24 2015 06:26 really depends on the nonprofit projects and if you do them or not the rest of the stuff training and challenges, shouldn't take more than 6 months with 4 hours daily (also given past programing experiences somewhat) what you should focus on is improving everyday and coding everyday, the rest will follow, don't try to 'get it done and move on' same with everything in life, just improve 1% daily Rishav Kumar @rishav171 Nov 24 2015 06:28 thanks so much i have changed the html tag using jquery . But it says Make sure the text is otherwise unchanged . what does it mean? Bill @kirah1314 Nov 24 2015 06:30 @rishav171 post your codes and we could take a look? Ian Walker @tonesfrommars Nov 24 2015 06:31 Hi all. I just completed "Bonfire: Title Case a Sentence" and was wondering. Is there a smooth way to do it without splitting the string into an array? The challenge brings up the question of mutability of strings in js, which I'm now a wee bit confused about. Rishav Kumar @rishav171 Nov 24 2015 06:31 <script>$(document).ready(function() {
$("#target1").css("color", "red");$("#target4").html("<i>Jquery</i>");
});
</script>

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

Rohan
@Rohan2018
Nov 24 2015 06:34
Sorry guys, still stuck on the coin game even after reading the instructions over and over again. From what I understand, the variable 'flip' is pre-coded on the first line and generates a random number between 0 and 1. I'm supposed to return the string "heads" if flip = 0 and tails otherwise (If flip is 1) using if and else statements. So in the body of myFunction I tell the computer that if the variable flip === 0 then return string "heads" else return string "tails". Sorry if my question is really long winded, but I'm just trying to grasp everything so I really understand. I know the answer is probably going to be something simple.
Bill
@kirah1314
Nov 24 2015 06:36
@rishav171 $("#target4").html("<i>Jquery</i>"); Did the waypoint ask for the text of Jquery? Rishav Kumar @rishav171 Nov 24 2015 06:46 no it did not ask for any text what should i do ?$("#target4").html("<i>J</i>"); @kirah1314
Markus Kiili
@Masd925
Nov 24 2015 06:47
@Rohan2018 If you still have a question, post your code and ask a specific question.
Rishav Kumar
@rishav171
Nov 24 2015 06:48
@kirah1314 it asks for -Italicize the text in your target4 button by adding HTML tags
Rohan
@Rohan2018
Nov 24 2015 06:48
@Masd925 should I include the lesson code that was already there?
Rishav Kumar
@rishav171
Nov 24 2015 06:49
hey @kirah1314 i got it.was making a silly misatke
Rohan
@Rohan2018
Nov 24 2015 06:49
@Masd925 or just my code?
Akira Laine
@AkiraLaine
Nov 24 2015 06:49
@rishav171 You need to make the text "#target4"
Markus Kiili
@Masd925
Nov 24 2015 06:49
@Rohan2018 whole code please.
Rohan
@Rohan2018
Nov 24 2015 06:49

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

function myFunction() {

// Only change code below this line.

if (flip === 0){
return "tails";
}
else {
}
// 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);}

Only heads and tails are somehow switched

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

function myFunction() {

// Only change code below this line.

if (flip === 0){
}
else {
return "tales";
}
// 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);}

Markus Kiili
@Masd925
Nov 24 2015 06:55
@Rohan2018 What is the name of the exercise?
Rohan
@Rohan2018
Nov 24 2015 06:56
@Masd925 Use Conditional Logic with If and Else Statements
Markus Kiili
@Masd925
Nov 24 2015 06:57
@Rohan2018 use "tails" not "tales"
Rohan
@Rohan2018
Nov 24 2015 06:58
second time I've done that
Alexander
@gwartney21
Nov 24 2015 06:59
has any one thats on worked on the calculator zip line i have a question
Rohan
@Rohan2018
Nov 24 2015 06:59
@Masd925 Fixed that typo, still doesn't change anything though
Markus Kiili
@Masd925
Nov 24 2015 07:00
@Rohan2018 It works, I checked.
Rohan
@Rohan2018
Nov 24 2015 07:01
@Masd925 Must be a bug, I'll try refreshing the lesson
@Masd925 Awesome :) Thanks Masd925! It worked after refreshing.
CamperBot
@camperbot
Nov 24 2015 07:02
rohan2018 sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star: 305 | @masd925 | http://www.freecodecamp.com/masd925
Den McHenry
@denmch
Nov 24 2015 07:03
@gwartney21 I did that one a while back.
Markus Kiili
@Masd925
Nov 24 2015 07:03
@Rohan2018 You're wellcome.
Austin Teshak
@Ateshak
Nov 24 2015 07:28
So i'm stuck on one.. early levels im really new to it just trying to learn. I cant seem to create a class for changing my h1 text to pink

<style>
h1 {
color:pink

}
body {
background-color: black;
font-family: Monospace;
color: green;
}
</style>

<h1>
<class>
Hello World!</h1>

Help would be appreciated

Den McHenry
@denmch
Nov 24 2015 07:30
@Ateshak First you can go ahead and delete <class>.
Alexander
@gwartney21
Nov 24 2015 07:30
@Ateshak you then want to add something h1 class="color"
to select it through a class directly
Den McHenry
@denmch
Nov 24 2015 07:30
The bits in angle brackets are elements, and class isn't an element. It's an attribute, which goes inside the element.
Alexander
@gwartney21
Nov 24 2015 07:31
@Ateshak like so <h1 class="color"></color>
Den McHenry
@denmch
Nov 24 2015 07:31
So like @gwartney21 describes in the <h1> element.
The definition of the class goes between the <style> tags.
Classes are referenced within style tags or stylesheets by a dot.
Alexander
@gwartney21
Nov 24 2015 07:32
which would look like .color {color:pink}
Den McHenry
@denmch
Nov 24 2015 07:32
.pink-text { color: pink; }
Alexander
@gwartney21
Nov 24 2015 07:32
or what ever you name your class
Austin Teshak
@Ateshak
Nov 24 2015 07:34

<style>
.pink-text { color: pink ; }
body {
background-color: black;
font-family: Monospace;
color: green;
}
</style>

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

Sorry im really new to this, just giving it a go
Den McHenry
@denmch
Nov 24 2015 07:34
@Ateshak You'll get the hang of it :)
Alexander
@gwartney21
Nov 24 2015 07:35
@Ateshak takes time just keep at it and yea that looks right
Jim Withington
@jwithington
Nov 24 2015 07:35
hey @Ateshak if you want your code to show up all pretty in chat you can type three backticks (which is the ) to get it to format
See?
<style>
.pink-text { color: pink ; }
body {
background-color: black;
font-family: Monospace;
color: green;
}
</style>
<h1 class="pink-text" Hello World! </h1>
Den McHenry
@denmch
Nov 24 2015 07:36
This message was deleted
Austin Teshak
@Ateshak
Nov 24 2015 07:37
thanks for the help all. Appreciated
Alexander
@gwartney21
Nov 24 2015 07:38
Trevor Murphy
@summerfr33ze
Nov 24 2015 07:39
it's telling me my p element doesn't have the text "View more" in it but it does. What am I doing wrong.
 <p>View more <a href="http://www.freecatphotoapp.com">cat photos</a> </p>
Den McHenry
@denmch
Nov 24 2015 07:43
Which Waypoint is that?
Bill
@kirah1314
Nov 24 2015 07:43
@summerfr33ze modify the <p> under <h2> and don't add a new line of code
Trevor Murphy
@summerfr33ze
Nov 24 2015 07:44
ok i'll try that
ok thanks that worked. I just didn't read the directions right
Bjorn Keyser
@bjornkeyser
Nov 24 2015 08:23
thanks @bjornkeyser
CamperBot
@camperbot
Nov 24 2015 08:23
sorry bjornkeyser, you can't send brownie points to yourself! :sparkles: :sparkles:
Henrikmr
@Henrikmr
Nov 24 2015 08:23
Your text input element should have the required attribute.
what to do?
Sam
@slibre2
Nov 24 2015 08:23

@summerfr33ze Hi all I m tryibg to pass a code but it is refused even the one in Wiki Guides . So what is wrong here please : var gear = 100; // private

this.getGear = function () { // public
};this.setGear= function (){
};

Henrikmr
@Henrikmr
Nov 24 2015 08:23
<form action="/submit-cat-photo">

<input type="required" placeholder="cat photo URL">
<input type="required" required>
<button type="submit">Submit</button>
</form>
Bjorn Keyser
@bjornkeyser
Nov 24 2015 08:23
someone say thanks bjornkeyser
Fridox
@deniz946
Nov 24 2015 08:26
brownie points hunter
Sam
@slibre2
Nov 24 2015 08:28
@bjornkeyser Hi all I m tryibg to pass a code but it is refused even the one in Wiki Guides . So what is wrong here please : var gear = 100; // private
this.getGear = function () { // public
};this.setGear= function (){
};
@bjornkeyser Hoi !
srinivas
@srinivasdasu
Nov 24 2015 08:30
Sam
@slibre2
Nov 24 2015 08:30
@srinivasdasu Waypoint: Make Object Properties Private
srinivas
@srinivasdasu
Nov 24 2015 08:32
gear value should be in 1-4 @slibre2
var gear;
this.getGear=function(){
gear=2;
};
this.setGear=function(){
gear=gear+2;
};
@slibre2
Sam
@slibre2
Nov 24 2015 08:33
@srinivasdasu why 1-4 ?
@SaintPeter
Nov 24 2015 08:33
@srinivasdasu Your this.setGear function must accept a parameter.
@srinivasdasu Look at the addStyle function in the example code.
Sam
@slibre2
Nov 24 2015 08:34
@srinivasdasu WON !! Thanks a lot
CamperBot
@camperbot
Nov 24 2015 08:34
slibre2 sends brownie points to @srinivasdasu :sparkles: :thumbsup: :sparkles:
:star: 279 | @srinivasdasu | http://www.freecodecamp.com/srinivasdasu
srinivas
@srinivasdasu
Nov 24 2015 08:34
Every vehicle will have gears up to 1-5 up to my knowledge@slibre2
Sam
@slibre2
Nov 24 2015 08:34
@SaintPeter thanks Saint Peter as well !
CamperBot
@camperbot
Nov 24 2015 08:34
slibre2 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1649 | @saintpeter | http://www.freecodecamp.com/saintpeter
srinivas
@srinivasdasu
Nov 24 2015 08:34
but it got passed for me @SaintPeter
Sam
@slibre2
Nov 24 2015 08:35
@srinivasdasu oh yes ! you're right ! I m stupid !
@srinivasdasu sometimes I can't find the solution only because of the way it is written !
srinivas
@srinivasdasu
Nov 24 2015 08:36
its ok @slibre2
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 08:50
Waypoint: Make Unique Objects by Passing Parameters to our Constructor
Could anyone suggest me what I am doing wrong with this code:

'''
var Car = function() {
//Change this constructor
this.wheels = 4;
this.seats = 1;
this.engines = 1;
};

//Try it out here
var myCar =new Car();{
//Change this constructor
myCar.wheels = 3;
myCar.seats = 1;
myCar.engines = 2;
}

// Only change code above this line

(function() {return JSON.stringify(myCar);})();
'''

CamperBot
@camperbot
Nov 24 2015 08:51
:bulb: to format code use backticks!  more info
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 08:51
var Car = function() {
//Change this constructor
this.wheels = 4;
this.seats = 1;
this.engines = 1;
};

//Try it out here
var myCar =new Car();{
//Change this constructor
myCar.wheels = 3;
myCar.seats = 1;
myCar.engines = 2;
}

// Only change code above this line

(function() {return JSON.stringify(myCar);})();
In the above code following not worked:
Calling new Car(3,1,2) should produce an object with a wheels property of 3, a seats property of 1, and an engines property of 2.
iccomq
@iccomq
Nov 24 2015 08:52
hey @ohid1986 lets talk about that,
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 08:53
@iccomq ok could you tell where is the problem?
iccomq
@iccomq
Nov 24 2015 08:53
@ohid1986 so you have a function(constructor) that makes elements, it makes them with attributes that are already set right?
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 08:54
@iccomq
ok
iccomq
@iccomq
Nov 24 2015 08:54
so when you declare a new variable myCar and tell a constructor :"hey make object JUST like that"
BUT
with this many wheels,seats and engines
you should pass to the Car function how many of them you need
you dont need to tell that there should be wheels, seats, and engines becouse constructor function already expects that there should be some
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 08:56
Then should I pass only numeric values in the car function
iccomq
@iccomq
Nov 24 2015 08:56
*To the Car function, thats right
in parenthesis
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 08:58
@iccomq
var myCar =new Car(3,1,2);{
//Change this constructor

}
iccomq
@iccomq
Nov 24 2015 08:58
that is a good syntax :)
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 08:58
it doesn't work @iccomq , I think something more needed
raw1211
@raw1211
Nov 24 2015 08:59
@ohid1986 u dont need brackets
iccomq
@iccomq
Nov 24 2015 08:59
@ohid1986 yea you dont need them my bad
and its not working becouse
your constructor is written a little wrong
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 09:00
var myCar =new Car(3,1,2);
still not working.
iccomq
@iccomq
Nov 24 2015 09:00
but @ohid1986 tell me which waypoint are you at exactly
so we wont do silly things
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 09:01
Waypoint: Make Unique Objects by Passing Parameters to our Constructor
iccomq
@iccomq
Nov 24 2015 09:01
that particular line is correct
@ohid1986 so lets take a look at constructor function at the top
raw1211
@raw1211
Nov 24 2015 09:01
@ohid1986 u need 3 parameters in your constructor
iccomq
@iccomq
Nov 24 2015 09:02
we need to make this function expect that values,
var Car = function(wheels, seats, engines)
raw1211
@raw1211
Nov 24 2015 09:02

@ohid1986 
var Car = function(wheels,seats,engines) {
//Change this constructor
this.wheels = wheels;
this.seats = seats;
this.engines = engines;
};



iccomq
@iccomq
Nov 24 2015 09:02

and then when you use,

this.parameter

this will refer to that parameter, the one specified in brackets

well @raw1211 i wanted to avoid posting just answer :D
raw1211
@raw1211
Nov 24 2015 09:04
@iccomq i think he was not able to get the hint so i just showed him the syntax
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 09:04
@raw1211 @iccomq yes this work now
iccomq
@iccomq
Nov 24 2015 09:04
@raw1211 we would get there eventually :D
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 09:04
@raw1211 @iccomq thanks
CamperBot
@camperbot
Nov 24 2015 09:04
ohid1986 sends brownie points to @raw1211 and @iccomq :sparkles: :thumbsup: :sparkles:
:star: 138 | @iccomq | http://www.freecodecamp.com/iccomq
:star: 250 | @raw1211 | http://www.freecodecamp.com/raw1211
raw1211
@raw1211
Nov 24 2015 09:05
@iccomq have u started working on your first zipline
iccomq
@iccomq
Nov 24 2015 09:05
its on there in my brain, its actually pretty easy as im familiar with bootstrap
i think ill make it today
raw1211
@raw1211
Nov 24 2015 09:06
@iccomq so u have been online since our last chat
iccomq
@iccomq
Nov 24 2015 09:07
could you remind exactly what we talked about last time?
bonfire Where do i belong?
CamperBot
@camperbot
Nov 24 2015 09:07

:fire:Bonfire: Where do I belong :link:

function where(arr, num) {
// Find my place in this sorted array.
return num;
}

where([40, 60], 50);

Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument).

more info:  bf details | bf links | hint

iccomq
@iccomq
Nov 24 2015 09:07
hey bot go away :P
raw1211
@raw1211
Nov 24 2015 09:07
@iccomq yes ...but we had a bit more chat after that
@iccomq i went offline then because it was time to sleep...it was 5am here
iccomq
@iccomq
Nov 24 2015 09:09
oh man i feel bad i seem to not remember what we were talkin about, i actually really need coffee
@raw1211 man refresh my memory so i will stop feeling bad about that
i mean i will feel just a little less bad about it but its something right?:D
raw1211
@raw1211
Nov 24 2015 09:11
@iccomq everyone has forgetting problem
iccomq
@iccomq
Nov 24 2015 09:13
@raw1211 i mean yea, im talking to a lot of people behind avatars that i was really unfamiliar with a few days ago, still feels kinda shitty to tell someone you dont remember last conversation that well
raw1211
@raw1211
Nov 24 2015 09:16
@iccomq change the conversation topic with people when u have forgotten about your previous conversation with them
iccomq
@iccomq
Nov 24 2015 09:17
@raw1211 well, i'm not really pressured to keep myself all set and smiling in here, can admit i do not remember ;p
raw1211
@raw1211
Nov 24 2015 09:17
why do i have 2 followers
Mags Prescott
@magsprescott
Nov 24 2015 09:17
hi guys i need help
"Italicize the text in your target4 button by adding HTML tags."
raw1211
@raw1211
Nov 24 2015 09:18
@magsprescott post ur code
Mags Prescott
@magsprescott
Nov 24 2015 09:18
  $("target4").html(""); raw1211 @raw1211 Nov 24 2015 09:18 @magsprescott use have to use <i> </i> tag inside .html class Mags Prescott @magsprescott Nov 24 2015 09:19 $("target4").html("<i> </i>");
raw1211
@raw1211
Nov 24 2015 09:19
@magsprescott and add #target4 in between
iccomq
@iccomq
Nov 24 2015 09:19

your

 $("target4") needs # if its class Mags Prescott @magsprescott Nov 24 2015 09:19 oh yesss thanks you guys raw1211 @raw1211 Nov 24 2015 09:19 @magsprescott its #target4 Mags Prescott @magsprescott Nov 24 2015 09:20 when i added the hashtag, the "Make sure the text is otherwise unchanged." went red iccomq @iccomq Nov 24 2015 09:20 @magsprescott the rule of a thumb is that when you add or remove class or id you dont use # and . But when you select them you do. Mags Prescott @magsprescott Nov 24 2015 09:21 $("#target4").html("<i> </i>");
so whats wrong with it...
raw1211
@raw1211
Nov 24 2015 09:21
$("#target4").html("<i> #target4</i>"); try this Mags Prescott @magsprescott Nov 24 2015 09:21 doesnt work.. iccomq @iccomq Nov 24 2015 09:22 what @raw1211 said, ir just put a text you have in target4 between <i> tags inside Mags Prescott @magsprescott Nov 24 2015 09:22 $("#target4").html("<i>#target</i>");
i did..
iccomq
@iccomq
Nov 24 2015 09:23
try target4
raw1211
@raw1211
Nov 24 2015 09:23
@magsprescott its target4 not target
inside <i> tag
Mags Prescott
@magsprescott
Nov 24 2015 09:24
 $("target4").html("<i>#target4</i>"); raw1211 @raw1211 Nov 24 2015 09:24 @magsprescott$("#target4").html("<i>#target4</i>");
Mags Prescott
@magsprescott
Nov 24 2015 09:24
lol i forgot the hastag
hashtag*
thanks guys it worked
raw1211
@raw1211
Nov 24 2015 09:24
@magsprescott np ..
iccomq
@iccomq
Nov 24 2015 09:25
nice thumbs up
raw1211
@raw1211
Nov 24 2015 09:25
i want brownies
iccomq
@iccomq
Nov 24 2015 09:25
thank you @raw1211
CamperBot
@camperbot
Nov 24 2015 09:25
iccomq sends brownie points to @raw1211 :sparkles: :thumbsup: :sparkles:
:star: 251 | @raw1211 | http://www.freecodecamp.com/raw1211
raw1211
@raw1211
Nov 24 2015 09:25
@iccomq lol..thanks
CamperBot
@camperbot
Nov 24 2015 09:25
raw1211 sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles:
:star: 139 | @iccomq | http://www.freecodecamp.com/iccomq
raw1211
@raw1211
Nov 24 2015 09:25
thanks @raw1211
CamperBot
@camperbot
Nov 24 2015 09:26
sorry raw1211, you can't send brownie points to yourself! :sparkles: :sparkles:
raw1211
@raw1211
Nov 24 2015 09:26
bot
CamperBot
@camperbot
Nov 24 2015 09:26

Hi, I'm CamperBot! I can help you in this chatroom :smile:

Basic Commands:

• find TOPIC find all entries about topic. ex: find js
• wiki TOPIC show contents of topic page
• thanks @username send brownie points to another user
• about @username shows info on that user
• bonfire BONFIRENAME info on a bonfire

:speech_balloon: meet CamperBot in this room!

iccomq
@iccomq
Nov 24 2015 09:26
ohhh and i bet camper botsends them to himself when noone is looking
raw1211
@raw1211
Nov 24 2015 09:27
yeah...yesterday when he was down i lost many brownies
Rishav Kumar
@rishav171
Nov 24 2015 09:27
want to remove element in jquery . here i sthe code -$("#target4").remove("target4"); wats wrong? Mags Prescott @magsprescott Nov 24 2015 09:27 where are you guys at im still doing jQuery raw1211 @raw1211 Nov 24 2015 09:28 @rishav171$("#target4").remove();
Rishav Kumar
@rishav171
Nov 24 2015 09:28
oh cool!
Mags Prescott
@magsprescott
Nov 24 2015 09:28
lol i was just doing that
raw1211
@raw1211
Nov 24 2015 09:29
@magsprescott got to ziplines but not started yet
Rishav Kumar
@rishav171
Nov 24 2015 09:29
wats with these brownies .. m completely new here
iccomq
@iccomq
Nov 24 2015 09:29

@rishav171 remember that first part

$("#target4") is the part you already call method for Akira Laine @AkiraLaine Nov 24 2015 09:29 wiki brownie CamperBot @camperbot Nov 24 2015 09:29 :point_right: brownie points [wiki] The number beside your picture on Free Code Camp tells you how many Brownie Points you have. There are three ways you can get Brownie Points: 1. Complete challenges - you get one point per challenge you complete 2. Post relevant links on Camper News - you get 1 point for posting a link, and another point for each upvote your link gets 3. Help other campers in chat - each time you help another camper and they thank you (by typing "thanks @yourname"), you will get a point Brownie Points help you look like the kind of person who codes a lot, shares relevant links, and helps people. They also add to your Streak. :pencil: read more about brownie points on the FCC Wiki Akira Laine @AkiraLaine Nov 24 2015 09:29 @rishav171 iccomq @iccomq Nov 24 2015 09:29 @rishav171 it basically means "select element with id target4" raw1211 @raw1211 Nov 24 2015 09:30 @rishav171 Brownie Points help you look like the kind of person who codes a lot, shares relevant links, and helps people. Rishav Kumar @rishav171 Nov 24 2015 09:30 oh okey .. iccomq @iccomq Nov 24 2015 09:30 the truth is, the more brownies, the more empty you are inside, feeling a lust just for more brownies raw1211 @raw1211 Nov 24 2015 09:31 @iccomq more brownies=more cool Rishav Kumar @rishav171 Nov 24 2015 09:31 "thanks @raw1211 CamperBot @camperbot Nov 24 2015 09:31 rishav171 sends brownie points to @raw1211 :sparkles: :thumbsup: :sparkles: :star: 252 | @raw1211 | http://www.freecodecamp.com/raw1211 raw1211 @raw1211 Nov 24 2015 09:31 @rishav171 yw Mags Prescott @magsprescott Nov 24 2015 09:32 thanks @raw1211 CamperBot @camperbot Nov 24 2015 09:32 magsprescott sends brownie points to @raw1211 :sparkles: :thumbsup: :sparkles: :star: 253 | @raw1211 | http://www.freecodecamp.com/raw1211 Rishav Kumar @rishav171 Nov 24 2015 09:32 still in jquery.. lng way to go! Mags Prescott @magsprescott Nov 24 2015 09:33 me too rishav171 we can do this Rishav Kumar @rishav171 Nov 24 2015 09:34 we will Mags Prescott @magsprescott Nov 24 2015 09:49 2 more to go and im done with jQuery heeheh iccomq @iccomq Nov 24 2015 09:52 @magsprescott don't do them to just get that green bubble to make you feel all warm inside :D The links provided in help section in exercise is a gold mine and will help you understand what yo are doing better. jQuery section is pretty short and depanding on what you want you may not need to dive deep into jQuery that deep. But that tip will keep being very relevant a little later on. Mags Prescott @magsprescott Nov 24 2015 09:53 thanks @iccomq CamperBot @camperbot Nov 24 2015 09:53 magsprescott sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles: :star: 140 | @iccomq | http://www.freecodecamp.com/iccomq Mags Prescott @magsprescott Nov 24 2015 09:54 i dont know what links you're talking about.. :/ iccomq @iccomq Nov 24 2015 09:55 they should be on a left side below your exercise description, didn't do jQuery waypoints myself as was already familiar with it before, they may not be there they are in later sections though KofiAkorli @KofiAkorli Nov 24 2015 09:59 hey guys, i have a quick question, if i declare a variable globally and I make changes to it within a function, will accessing the global variable outside the function be the originally declared value or the modified one? var number = 7;$("#add").click(function(){
number = number + 5;
});

console.log(number);  // 7 or 12?
iccomq
@iccomq
Nov 24 2015 10:01
@KofiAkorli you are modyfying global variable here
KofiAkorli
@KofiAkorli
Nov 24 2015 10:03
@iccomq ... I don't understand what you mean ...
iccomq
@iccomq
Nov 24 2015 10:04
when you will access that variable outside of function, after firing out your functiond(clickind element with id add) it will spit out that number = 12
KofiAkorli
@KofiAkorli
Nov 24 2015 10:06
@iccomq okay, thanks
CamperBot
@camperbot
Nov 24 2015 10:06
kofiakorli sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles:
:star: 141 | @iccomq | http://www.freecodecamp.com/iccomq
iccomq
@iccomq
Nov 24 2015 10:12
to clarify @KofiAkorli
var scope = 'global';  // declaring global variable
function checkscope() {
scope = 'changed';   // changing global variable
var local = 'localvar';
}
document.write(scope); // will print 'changed';
document.write(local);  // will spit out undefined
KofiAkorli
@KofiAkorli
Nov 24 2015 10:16
@iccomq great illustration, thank you, but why is local undefined?
CamperBot
@camperbot
Nov 24 2015 10:16
kofiakorli sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles:
:warning: kofiakorli already gave iccomq points
Mags Prescott
@magsprescott
Nov 24 2015 10:16
do you need to know maths to be good at this
iccomq
@iccomq
Nov 24 2015 10:17
@KofiAkorli becouse variable local 'lives ' in that function
it's scope is that function, it is accessible only there
you can make function return it or assign to other variable to access it from outside
lets call a bot
help scope
CamperBot
@camperbot
Nov 24 2015 10:18

:point_right: js scope [wiki]

The current context of execution. The context in which values and expressions are "visible," or can be referenced. If a variable or other expression is not "in the current scope," then it is unavailable for use. Scopes can also be layered in a hierarchy, so that child scopes have access to parent scopes, but not vice versa.

:pencil: read more about js scope on the FCC Wiki

MoaTh Khozyem
@moathkhozyem
Nov 24 2015 10:20
Morining mates
iccomq
@iccomq
Nov 24 2015 10:21
morning @jOkes7
MoaTh Khozyem
@moathkhozyem
Nov 24 2015 10:21
how is everything
iccomq
@iccomq
Nov 24 2015 10:22
ah morning coffess procrastination, and that feeling you have to do things you know
MoaTh Khozyem
@moathkhozyem
Nov 24 2015 10:24
i know that feeling bro
KofiAkorli
@KofiAkorli
Nov 24 2015 10:24
@iccomq great! thanks! exactly what i needed, I've been reading about scopes all day but it just got so overwhelming i got confused you've simplified it for me.
CamperBot
@camperbot
Nov 24 2015 10:24
kofiakorli sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles:
:warning: kofiakorli already gave iccomq points
iccomq
@iccomq
Nov 24 2015 10:24
glad it helped :)
Elliott McNary
@bighitbiker3
Nov 24 2015 10:25
Hey guys...i'm having a hell of time looping through an array with objects...can someone help?
function where(collection, source) {
var arr = [];
var x = source;
var prop = Object.keys(x).toString();

for `