These are chat archives for FreeCodeCamp/Help

24th
Nov 2015
iccomq
@iccomq
Nov 24 2015 00:00 UTC
@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 UTC
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 UTC
Probably to avoid mutating values.
Derek Frankel
@TuvyaYis
Nov 24 2015 00:04 UTC

```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 UTC
Put your back ticks on separate lines
Derek Frankel
@TuvyaYis
Nov 24 2015 00:05 UTC
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 UTC
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 UTC
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 UTC
It works perfectly in my JSbin. And ive commented out var newArray = oldArray
iccomq
@iccomq
Nov 24 2015 00:10 UTC

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 UTC
can any one help me?
$("well").addClass("animated shake"); is this line okay?
Alexander Køpke
@alexanderkopke
Nov 24 2015 00:13 UTC
Is well a class ?
Derek Frankel
@TuvyaYis
Nov 24 2015 00:13 UTC
@iccomq thx
CamperBot
@camperbot
Nov 24 2015 00:13 UTC
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 UTC
@denmch thx
CamperBot
@camperbot
Nov 24 2015 00:14 UTC
tuvyayis sends brownie points to @denmch :sparkles: :thumbsup: :sparkles:
:star: 402 | @denmch | http://www.freecodecamp.com/denmch
iccomq
@iccomq
Nov 24 2015 00:15 UTC
@FBWes which waypoint is that?
FBWes
@FBWes
Nov 24 2015 00:15 UTC
yeah so it needs a .
lol got it guys..
iccomq
@iccomq
Nov 24 2015 00:15 UTC
:)
Alexander Køpke
@alexanderkopke
Nov 24 2015 00:15 UTC
:+1:
FBWes
@FBWes
Nov 24 2015 00:16 UTC
but button didn't that's what threw me...
iccomq
@iccomq
Nov 24 2015 00:16 UTC
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 UTC
@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 UTC
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 UTC
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 UTC
@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 UTC

... 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 UTC
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 UTC
@FBWes you've got to wrap your class names in quotes.
$(".btn").addClass("animated shake");
iccomq
@iccomq
Nov 24 2015 00:27 UTC
@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 UTC
and only spaces between classnames, no commas :-)
millerA17
@millerA17
Nov 24 2015 00:27 UTC
hey ya'lllll...I'm back for more help. Form controls = mucho confused ;P
iccomq
@iccomq
Nov 24 2015 00:28 UTC
@orkist
return val <= 5; is what i put in my callback function in that exercise
Den McHenry
@denmch
Nov 24 2015 00:29 UTC
@prakashn27 Put a space before the colon.
FBWes
@FBWes
Nov 24 2015 00:29 UTC
thans guys you rock
thanks*
Prakash Natarajan
@prakashn27
Nov 24 2015 00:29 UTC
@denmch : figured it out :) thanks
CamperBot
@camperbot
Nov 24 2015 00:29 UTC
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 UTC
It's a little counter-intuitive, because it actually refers to siblings.
Prakash Natarajan
@prakashn27
Nov 24 2015 00:30 UTC
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 UTC
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 UTC
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 UTC
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 UTC
wow. Thanks again. It makes sense now. :)
Den McHenry
@denmch
Nov 24 2015 00:35 UTC
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 UTC
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 UTC
could you say which waypoint is that?
crystala814
@crystala814
Nov 24 2015 00:50 UTC

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 UTC
@crystala814 you only need one style section
niveditasiri
@niveditasiri
Nov 24 2015 00:50 UTC
third point in object oriented and functional programming @iccomq
iccomq
@iccomq
Nov 24 2015 00:51 UTC
so @niveditasiri you should make a myCar right?
niveditasiri
@niveditasiri
Nov 24 2015 00:51 UTC
yep
iccomq
@iccomq
Nov 24 2015 00:52 UTC

so you need to declare it, we have

var myCar =

so far

niveditasiri
@niveditasiri
Nov 24 2015 00:52 UTC
okay
iccomq
@iccomq
Nov 24 2015 00:52 UTC
and now look at the Car above
niveditasiri
@niveditasiri
Nov 24 2015 00:53 UTC
var myCar = function(){
this.wheels = 4;
this.engines = 1;
this.seats = 1;
this.myCar.nickName = "nivi";
};
iccomq
@iccomq
Nov 24 2015 00:53 UTC
it is a constructor function, it makes new elements
niveditasiri
@niveditasiri
Nov 24 2015 00:53 UTC
i did this, where am I wrong? @iccomq
iccomq
@iccomq
Nov 24 2015 00:53 UTC
with a set attributes and values attached to them
stay with me
crystala814
@crystala814
Nov 24 2015 00:53 UTC
@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 UTC
okay
I am following you, go on @iccomq
iccomq
@iccomq
Nov 24 2015 00:54 UTC
@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 UTC
tell me what am I doing wrong?
okay @iccomq
iccomq
@iccomq
Nov 24 2015 00:55 UTC
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 UTC
okay
iccomq
@iccomq
Nov 24 2015 00:55 UTC
you just call it
it makes that new element called myCar, with a properties of a Car
niveditasiri
@niveditasiri
Nov 24 2015 00:56 UTC
oh okay
iccomq
@iccomq
Nov 24 2015 00:56 UTC
so
var myCar = new Car();
niveditasiri
@niveditasiri
Nov 24 2015 00:57 UTC
okay
iccomq
@iccomq
Nov 24 2015 00:57 UTC
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 UTC
@denmch Thanks for the headup will look into it :)
CamperBot
@camperbot
Nov 24 2015 00:57 UTC
prakashn27 sends brownie points to @denmch :sparkles: :thumbsup: :sparkles:
:warning: prakashn27 already gave denmch points
Ian Walker
@tonesfrommars
Nov 24 2015 00:57 UTC
its an object stored in a variable. yes
iccomq
@iccomq
Nov 24 2015 00:57 UTC
you call constructor functions(the ones tat make elements) with a syntax 'new'
Ian Walker
@tonesfrommars
Nov 24 2015 00:58 UTC
probably better to call them objects
niveditasiri
@niveditasiri
Nov 24 2015 00:58 UTC
okay @iccomq
iccomq
@iccomq
Nov 24 2015 00:59 UTC
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 UTC
okay @iccomq
Let me try this @iccomq
iccomq
@iccomq
Nov 24 2015 01:00 UTC
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 UTC
okay @iccomq
iccomq
@iccomq
Nov 24 2015 01:02 UTC
ask, if you have further questions.
Kaye
@KayeZZ
Nov 24 2015 01:02 UTC
I need a little help with one of the Jquery waypoints
iccomq
@iccomq
Nov 24 2015 01:03 UTC
@KayeZZ which one?
Kaye
@KayeZZ
Nov 24 2015 01:03 UTC
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 UTC
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 UTC
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 UTC
also @tonesfrommars yes it would be better if i stayed with correct, constant names,
Ian Walker
@tonesfrommars
Nov 24 2015 01:04 UTC
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 UTC
@KayeZZ remember that every element selected needs just one class added in there.
Kaye
@KayeZZ
Nov 24 2015 01:05 UTC
well, it should have?
iccomq
@iccomq
Nov 24 2015 01:05 UTC
@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 UTC
@iccomq
myCar.nickName = "nickname";
Kaye
@KayeZZ
Nov 24 2015 01:06 UTC
$("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 UTC
Guys, is FCC loading for anyone else?
iccomq
@iccomq
Nov 24 2015 01:07 UTC
@KayeZZ you forgot to wrap your classed you add in ' '
addClass('shake'); etc
Kaye
@KayeZZ
Nov 24 2015 01:07 UTC
oooh .-. thanks.
iccomq
@iccomq
Nov 24 2015 01:08 UTC
@niveditasiri that seems correct
niveditasiri
@niveditasiri
Nov 24 2015 01:08 UTC
hmm yeah, but it isnt accepting.
@iccomq
iccomq
@iccomq
Nov 24 2015 01:08 UTC
@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 UTC
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 UTC
<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 UTC
<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 UTC

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 UTC
now it suddenly worked??? I didn't do anything different??? lol
iccomq
@iccomq
Nov 24 2015 01:13 UTC
try to change nickName to nickname @niveditasiri its probably case sensitive
niveditasiri
@niveditasiri
Nov 24 2015 01:13 UTC
let me try @iccomq
it worked when removed the cap N. Thank you @iccomq
CamperBot
@camperbot
Nov 24 2015 01:14 UTC
niveditasiri sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles:
:warning: niveditasiri already gave iccomq points
iccomq
@iccomq
Nov 24 2015 01:16 UTC
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 UTC
@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 UTC
@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 UTC
@iccomq right did that at first still deemed wrong attempt again thanks
CamperBot
@camperbot
Nov 24 2015 01:20 UTC
mrguru2016 sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles:
:star: 116 | @iccomq | http://www.freecodecamp.com/iccomq
iccomq
@iccomq
Nov 24 2015 01:21 UTC
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 UTC
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 UTC
that seems about right
Anthony Guru
@mrguru2016
Nov 24 2015 01:24 UTC
Waypoint: Set the ID of an Element
iccomq
@iccomq
Nov 24 2015 01:24 UTC
still having a problem?
Anthony Guru
@mrguru2016
Nov 24 2015 01:24 UTC
still incorrect
iccomq
@iccomq
Nov 24 2015 01:25 UTC
becouse you dont read right :D
id should be cat-photo-form!
not cat-photo-app
Anthony Guru
@mrguru2016
Nov 24 2015 01:26 UTC
correct i copied the one i used as a example
iccomq
@iccomq
Nov 24 2015 01:27 UTC
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 UTC
@iccomq hey thanks for the reminder, help and judgement of what i missed :clap: lol
CamperBot
@camperbot
Nov 24 2015 01:29 UTC
mrguru2016 sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles:
:warning: mrguru2016 already gave iccomq points
iccomq
@iccomq
Nov 24 2015 01:30 UTC
youre welcome :)
Joseph
@revisualize
Nov 24 2015 01:33 UTC
Greetings, Can I get a little help?
iccomq
@iccomq
Nov 24 2015 01:34 UTC
@revisualize sure, describe a problem tell us what waypoint are you stuck at
Joseph
@revisualize
Nov 24 2015 01:35 UTC
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 UTC
you need to read about scope,
Joseph
@revisualize
Nov 24 2015 01:37 UTC
scope?
iccomq
@iccomq
Nov 24 2015 01:39 UTC
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 UTC
Should I be googling "javascript variable scope" or "javascript scope" ?
iccomq
@iccomq
Nov 24 2015 01:40 UTC
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 UTC
I'm going to watch a couple videos.
iccomq
@iccomq
Nov 24 2015 01:41 UTC
it can me accessed by a method that returns its value
Varun Mangalick
@varunm22
Nov 24 2015 01:42 UTC
Can I have some advice on Bonfire: Check for Palindrome?
iccomq
@iccomq
Nov 24 2015 01:42 UTC
@varunm22 sure
RoadtoMastery
@RoadtoMastery
Nov 24 2015 01:42 UTC
@varunm22 post your code and someone will look at it
Varun Mangalick
@varunm22
Nov 24 2015 01:42 UTC
well, I've got the palindrome check figured out all except removing punctuation/spaces
iccomq
@iccomq
Nov 24 2015 01:43 UTC
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 UTC
help regex
CamperBot
@camperbot
Nov 24 2015 01:44 UTC

:point_right: js regex resources [wiki]

Links to useful RegEx resources.

See also: :clipboard: Tutorials | :syringe: Testing | :soccer: Games | :newspaper: Blogs | :package: Software

:pencil: read more about js regex resources on the FCC Wiki

Bill
@kirah1314
Nov 24 2015 01:44 UTC
@varunm22 :point_up:
Varun Mangalick
@varunm22
Nov 24 2015 01:44 UTC
ok, makes sense, thanks @kirah1314 @camperbot and @iccomq
CamperBot
@camperbot
Nov 24 2015 01:44 UTC
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 UTC
whoah i need to get used to that bot
Bill
@kirah1314
Nov 24 2015 01:45 UTC
campberbot has a lot of resources :)
iccomq
@iccomq
Nov 24 2015 01:45 UTC
help sendmebeer
CamperBot
@camperbot
Nov 24 2015 01:45 UTC
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 UTC
its useless
:D
RoadtoMastery
@RoadtoMastery
Nov 24 2015 01:46 UTC
lol
iccomq
@iccomq
Nov 24 2015 01:46 UTC
help closure
CamperBot
@camperbot
Nov 24 2015 01:46 UTC

: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 UTC
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 UTC
help arrays
CamperBot
@camperbot
Nov 24 2015 01:52 UTC

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

:pencil: read more about bonfire diff two arrays on the FCC Wiki

Dan Stockham
@DanStockham
Nov 24 2015 01:52 UTC
I have question about DPI
Joseph
@revisualize
Nov 24 2015 01:53 UTC
help scope
CamperBot
@camperbot
Nov 24 2015 01:53 UTC

: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 UTC
not what i was looking for. time to look at the wiki entries
Patrick McWilliams
@patrickmac110
Nov 24 2015 01:54 UTC
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 UTC
@RoadtoMastery somehow i dont think you need a reminder what an array is :D
Patrick McWilliams
@patrickmac110
Nov 24 2015 01:54 UTC
see line 42 in my javascript console
RoadtoMastery
@RoadtoMastery
Nov 24 2015 01:55 UTC
@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 UTC
hello all! im having an issue could anyone help me out with a challenge
RoadtoMastery
@RoadtoMastery
Nov 24 2015 01:56 UTC
@krstfrcee hi. feel free to post your question/ code
Chris
@krstfrcee
Nov 24 2015 01:56 UTC
well here's the line in question I believe
RoadtoMastery
@RoadtoMastery
Nov 24 2015 01:56 UTC
this room is for waypoints. there is also a room for bonfires
iccomq
@iccomq
Nov 24 2015 01:57 UTC
@RoadtoMastery i can tell you that FFC is a lot more indepth than codeacademy
Chris
@krstfrcee
Nov 24 2015 01:58 UTC
<p class="red-text"> view more<a href='http://www.freecatphotoapp.com'> cat photos </a> </p>
RoadtoMastery
@RoadtoMastery
Nov 24 2015 01:58 UTC
@iccomq been told that. did all the waypoints but i want to know more about them :smile:
Chris
@krstfrcee
Nov 24 2015 01:59 UTC
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 UTC
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 UTC
@iccomq agree. thanks. maybe you should help ^
CamperBot
@camperbot
Nov 24 2015 01:59 UTC
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 UTC
@krstfrcee in that case your paragraph is ending too late
Chris
@krstfrcee
Nov 24 2015 02:01 UTC
ending too late? like to far down the page?
Solms Dykman
@solms
Nov 24 2015 02:01 UTC

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 UTC
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
iccomq
@iccomq
Nov 24 2015 02:02 UTC
<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 UTC
@krstfrcee your paragraph contains more text than the instructions specify
Chris
@krstfrcee
Nov 24 2015 02:02 UTC
oh ok
Rory Smith
@alanbuchanan
Nov 24 2015 02:02 UTC
@iccomq i don't think answers should be posted
besides, the space needs to go afterwards :)
iccomq
@iccomq
Nov 24 2015 02:03 UTC
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 UTC
@iccomq well you have been providing much assistance, it's tiring work :)
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:04 UTC
full time job-like lol :smile:
Solms Dykman
@solms
Nov 24 2015 02:05 UTC
bonfire make a person
CamperBot
@camperbot
Nov 24 2015 02:05 UTC

: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 UTC
thanks @iccomq @alanbuchanan
CamperBot
@camperbot
Nov 24 2015 02:05 UTC
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 UTC
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 UTC
@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 UTC
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 UTC
why not both?
iccomq
@iccomq
Nov 24 2015 02:08 UTC
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 UTC
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 UTC
This message was deleted
iccomq
@iccomq
Nov 24 2015 02:10 UTC
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 UTC
lol
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:10 UTC
@0x0936 did you just happen to have that image handy?
Robert Richey
@0x0936
Nov 24 2015 02:11 UTC
no. i did a search and grabbed it. looked funny
jkidunot
@jkidunot
Nov 24 2015 02:11 UTC
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 UTC
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 UTC
@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 UTC
@jkidunot did you try to just reset code with a button?
Whiley Ifthenelse
@rafster
Nov 24 2015 02:15 UTC
Change the button with id target4 by italicizing its text.
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:15 UTC
@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 UTC
@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 UTC
Hello everyone, I'm having problems with this one: palindrome("0_0 (: /-\ :) 0-0")
Robert Richey
@0x0936
Nov 24 2015 02:17 UTC
@Icalvo1 need to also replace all underscores with an empty string
iccomq
@iccomq
Nov 24 2015 02:17 UTC
@RoadtoMastery it shows full code for me, tried like 5 different ones
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:17 UTC
@Icalvo1 post your code although your question should be in https://gitter.im/FreeCodeCamp/HelpBonfires
CamperBot
@camperbot
Nov 24 2015 02:17 UTC
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
iccomq
@iccomq
Nov 24 2015 02:17 UTC
@Icalvo1 you need to use replace method and filter out those pesky things. research about regex
Isaac Calvo
@Icalvo1
Nov 24 2015 02:18 UTC

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 UTC
@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 UTC
@RoadtoMastery it may still be beneficial to issue that matter
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:19 UTC
@iccomq true. will make a note.
@Icalvo1 do you know how regex works?
niveditasiri
@niveditasiri
Nov 24 2015 02:20 UTC

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 UTC
@niveditasiri for a start you multiply them by 3
niveditasiri
@niveditasiri
Nov 24 2015 02:21 UTC
okay @iccomq
Isaac Calvo
@Icalvo1
Nov 24 2015 02:21 UTC
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 UTC
@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 UTC
@Icalvo1 numbers are?
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:21 UTC
you are missing the _ in the last one i think @Icalvo1
Isaac Calvo
@Icalvo1
Nov 24 2015 02:21 UTC
would I need a separate conditional with a different regex for the last part
Robert Richey
@0x0936
Nov 24 2015 02:22 UTC
@Icalvo1 need to also replace all underscores with an empty string
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:22 UTC
@Icalvo1 you can combine all omissions in one //g
iccomq
@iccomq
Nov 24 2015 02:24 UTC
OR do it the hard way like real men do:
replace(/[,.:;\[\]\(\)\"\'\-\_\{\}\/\s]/g,"");
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:25 UTC
lol that works too.
Robert Richey
@0x0936
Nov 24 2015 02:25 UTC
@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 UTC
@iccomq well I didn't get anything
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:26 UTC
@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 UTC
@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 UTC
hmm
Rory Smith
@alanbuchanan
Nov 24 2015 02:28 UTC
@niveditasiri other clue: you shouldn't ignore the comment that says // Only change code above this line.
iccomq
@iccomq
Nov 24 2015 02:28 UTC

@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 UTC
@iccomq terminal command to format the hard drive
iccomq
@iccomq
Nov 24 2015 02:29 UTC
nooo, the gardener thing
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:29 UTC
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 UTC
@iccomq i think he was making a joke :)
iccomq
@iccomq
Nov 24 2015 02:29 UTC
he just told he didnt write that!
im confused
Robert Richey
@0x0936
Nov 24 2015 02:30 UTC
@iccomq garderner was a random profession, far away as possible from programming
kirah1314 @kirah1314 confused too...
Robert Richey
@0x0936
Nov 24 2015 02:30 UTC
@iccomq to get purple text, /me is bestest evar
0x0936 @0x0936 is bestest evar
iccomq
@iccomq
Nov 24 2015 02:30 UTC
ahh whatever i hate you for confusing my poor brain
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:31 UTC
lol. almost time to call it another night.
iccomq
@iccomq
Nov 24 2015 02:31 UTC
figuratively, not literally
Isaac Calvo
@Icalvo1
Nov 24 2015 02:31 UTC
"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 UTC
@Icalvo1 you are trying to get "0000" hint:
Isaac Calvo
@Icalvo1
Nov 24 2015 02:32 UTC
duh forgot underscore again xD
[^a-zA-Z0-9] == win thanks @RoadtoMastery @0x0936
CamperBot
@camperbot
Nov 24 2015 02:34 UTC
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 UTC
@Icalvo1 cool :)
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:35 UTC
:)
Robert Richey
@0x0936
Nov 24 2015 02:35 UTC
@Icalvo1 so, the shorter way of writing that, if you're interested, is /\W|_/gi
muzikmoe
@muzikmoe
Nov 24 2015 02:37 UTC
what does it mean: Cannot read property 'length' of null.
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:37 UTC
@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 UTC
@RoadtoMastery it's one of three flags for regex. i is for ignoring case
Rory Smith
@alanbuchanan
Nov 24 2015 02:38 UTC
@RoadtoMastery g = global, i = ignores case
(and m = multiline)
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:38 UTC
@0x0936 @alanbuchanan thanks. noted
CamperBot
@camperbot
Nov 24 2015 02:38 UTC
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 UTC
thanks @RoadtoMastery
CamperBot
@camperbot
Nov 24 2015 02:38 UTC
jinser sends brownie points to @roadtomastery :sparkles: :thumbsup: :sparkles:
:star: 228 | @roadtomastery | http://www.freecodecamp.com/roadtomastery
iccomq
@iccomq
Nov 24 2015 02:38 UTC
good night guys!
Rory Smith
@alanbuchanan
Nov 24 2015 02:38 UTC
@iccomq night :sleeping:
Robert Richey
@0x0936
Nov 24 2015 02:39 UTC
night @iccomq !
muzikmoe
@muzikmoe
Nov 24 2015 02:39 UTC
It's noon now Here
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:39 UTC
@iccomq night :smiley:
9:39pm here
muzikmoe
@muzikmoe
Nov 24 2015 02:39 UTC
10:39am here
Rory Smith
@alanbuchanan
Nov 24 2015 02:39 UTC
02:39 here :)
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:40 UTC
@alanbuchanan am or pm?
Rory Smith
@alanbuchanan
Nov 24 2015 02:40 UTC
02:39
not 14:39 :)
Robert Richey
@0x0936
Nov 24 2015 02:40 UTC
the leading 0 usually means 24 hour format. 2 39am
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:40 UTC
lol i see. didn't notice the 0 at first.
wow. that's late
Rory Smith
@alanbuchanan
Nov 24 2015 02:41 UTC
i keep forgetting some people dont use 24hr time
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:41 UTC
@alanbuchanan just not used to seeing it written with a 0 in front.
Rory Smith
@alanbuchanan
Nov 24 2015 02:41 UTC
i see
0x0936 @0x0936 needs brownies
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:45 UTC
@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 UTC
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 UTC
  $(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 UTC

@RoadtoMastery thanks!

img

CamperBot
@camperbot
Nov 24 2015 02:46 UTC
0x0936 sends brownie points to @roadtomastery :sparkles: :thumbsup: :sparkles:
muzikmoe
@muzikmoe
Nov 24 2015 02:46 UTC
sorry, I still cannot find the error: <Cannot read property 'length' of null>
CamperBot
@camperbot
Nov 24 2015 02:46 UTC
:star: 229 | @roadtomastery | http://www.freecodecamp.com/roadtomastery
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:46 UTC
hmmm. this one again. any takers :smile:
Robert Richey
@0x0936
Nov 24 2015 02:46 UTC
@Jinser post your code please
muzikmoe
@muzikmoe
Nov 24 2015 02:47 UTC
the code is above
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:49 UTC
$(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 UTC
@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 UTC
@Jinser which waypoint/bonfire is that?
Robert Richey
@0x0936
Nov 24 2015 02:53 UTC

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 UTC
heyas
i'm lost on functions!
waypoint 160
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:54 UTC
@katiemfrank post your code or where you are stuck and someone will help
katiemfrank
@katiemfrank
Nov 24 2015 02:54 UTC
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 UTC
@katiemfrank see the instructions on the left. should be math.random().
Robert Richey
@0x0936
Nov 24 2015 02:55 UTC
@Jinser to help get you started, here is what one line should look like: $("button").addClass("animated");
katiemfrank
@katiemfrank
Nov 24 2015 02:55 UTC
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 UTC
yes I have done it @0x0936
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:56 UTC
@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 UTC
@Jinser please paste your code again, just the jquery part
muzikmoe
@muzikmoe
Nov 24 2015 02:57 UTC
  $(document).ready(function() {
    $("button").addClass("animated");
    $(".btn").addClass("animated shake");
    $("#target1").addClass("animated shake btn-primary");
  });
</script>
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:57 UTC
@katiemfrank try not to overthink the waypoints too much.
katiemfrank
@katiemfrank
Nov 24 2015 02:58 UTC
yeah no im not getting it
Robert Richey
@0x0936
Nov 24 2015 02:58 UTC

@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 UTC
i stopped for days b/c i got stuck on this
muzikmoe
@muzikmoe
Nov 24 2015 02:58 UTC
ok done
RoadtoMastery
@RoadtoMastery
Nov 24 2015 02:59 UTC
@katiemfrank hmmm. there could a part two to that one. i just answer what you asked.
Robert Richey
@0x0936
Nov 24 2015 02:59 UTC

@Jinser last step

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

again, just btn-primary, not animated, not shake
RoadtoMastery
@RoadtoMastery
Nov 24 2015 03:00 UTC
@katiemfrank nvm. it should work unless you changed some of the other code
muzikmoe
@muzikmoe
Nov 24 2015 03:00 UTC
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 UTC
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 UTC
@Jinser awesome :)
Boomer
@boomer1204
Nov 24 2015 03:00 UTC

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 UTC
I am weak in English, some times Just guess what the tips @0x0936
katiemfrank
@katiemfrank
Nov 24 2015 03:01 UTC
i'm sorry, i don't even know how to send it correctly
RoadtoMastery
@RoadtoMastery
Nov 24 2015 03:01 UTC
@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 UTC
@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 UTC
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 UTC
@katiemfrank wiki format takes a while to get used to. nope just that one :smile:
katiemfrank
@katiemfrank
Nov 24 2015 03:02 UTC
omg @RoadtoMastery thats gotta be the issue
phewwww
here goes nothin!
RoadtoMastery
@RoadtoMastery
Nov 24 2015 03:03 UTC
@katiemfrank try not to change anything you didn't add to the code unless you have to.
katiemfrank
@katiemfrank
Nov 24 2015 03:05 UTC
good call. okay i should be able to figure this out
RoadtoMastery
@RoadtoMastery
Nov 24 2015 03:05 UTC
@katiemfrank you got this :smile:
katiemfrank
@katiemfrank
Nov 24 2015 03:06 UTC
@RoadtoMastery at last!!!!!!
thank you thank you thank you
i almost quit (sorta)
RoadtoMastery
@RoadtoMastery
Nov 24 2015 03:07 UTC
@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 UTC
@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 UTC
bonfire
CamperBot
@camperbot
Nov 24 2015 03:08 UTC
we're talking about bonfire :fire: Bonfire: Mutations
Joseph
@revisualize
Nov 24 2015 03:08 UTC
help bonfire
CamperBot
@camperbot
Nov 24 2015 03:08 UTC

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

:pencil: read more about bonfire arguments optional on the FCC Wiki

Joseph
@revisualize
Nov 24 2015 03:09 UTC
grrr..
Robert Richey
@0x0936
Nov 24 2015 03:09 UTC
while (fellDown) { getUp(); count++; } console.log(count); // error: stack overflow
Matthew Brown
@barakisbrown
Nov 24 2015 03:10 UTC
@0x0936 LOL so true
RoadtoMastery
@RoadtoMastery
Nov 24 2015 03:10 UTC
@0x0936 nice way to put it
Robert Richey
@0x0936
Nov 24 2015 03:10 UTC
heh :)
muzikmoe
@muzikmoe
Nov 24 2015 03:12 UTC
Luckily, I have gotten lots of help from your nice friends :smile:
RoadtoMastery
@RoadtoMastery
Nov 24 2015 03:13 UTC
Good Night all. Happy Coding :smile: 10:12pm est here
@Jinser :satellite: :smile:
muzikmoe
@muzikmoe
Nov 24 2015 03:14 UTC
I am going to have a lunch :smile:
Tristan J
@tsjones08
Nov 24 2015 03:16 UTC
How do you solve the 4th question in 114 jQuery
Joseph
@revisualize
Nov 24 2015 03:16 UTC
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 UTC
@revisualize its recursion
Joseph
@revisualize
Nov 24 2015 03:17 UTC
Recursion?
Calling itself over again?
Matthew Brown
@barakisbrown
Nov 24 2015 03:17 UTC
@revisualize nvm .. my bad ..
@revisualize what are you confused about?
muzikmoe
@muzikmoe
Nov 24 2015 03:18 UTC
in math It's like this N!
Matthew Brown
@barakisbrown
Nov 24 2015 03:18 UTC
yup
Joseph
@revisualize
Nov 24 2015 03:18 UTC
I don't understand the math.
I don't know what N! means.
Matthew Brown
@barakisbrown
Nov 24 2015 03:18 UTC
5! = 5 4 3 2 1
muzikmoe
@muzikmoe
Nov 24 2015 03:18 UTC
1 2 3*4 = 4!
Matthew Brown
@barakisbrown
Nov 24 2015 03:18 UTC
grr 5! == 5 times 4 times 3 time 2 times 1
Joseph
@revisualize
Nov 24 2015 03:19 UTC
okay.
I don't get it.
num *= num - 1
wait. that doesn't work.
crap.
Matthew Brown
@barakisbrown
Nov 24 2015 03:20 UTC
num = num * (num - 1)
is the same as num * = num - 1
muzikmoe
@muzikmoe
Nov 24 2015 03:20 UTC
num = num * (num-1)
Robert Richey
@0x0936
Nov 24 2015 03:21 UTC
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 UTC
and there are the similar like =+ -= %=
Joseph
@revisualize
Nov 24 2015 03:22 UTC
@0x0936 so, it wants me to call the function again to process the maths.
Robert Richey
@0x0936
Nov 24 2015 03:22 UTC
@revisualize ah, woops. the code you posted isn't the recursive version. sorry
Matthew Brown
@barakisbrown
Nov 24 2015 03:22 UTC
@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 UTC
I don't even understand what the hell I'm doing.
Robert Richey
@0x0936
Nov 24 2015 03:23 UTC
@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 UTC
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 UTC
@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 UTC
does freecodecamp have protection against infinite loop?
Robert Richey
@0x0936
Nov 24 2015 03:27 UTC
@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 UTC
and it remembers the code you entered
so if you enter some infinite loop
Robert Richey
@0x0936
Nov 24 2015 03:28 UTC
yes. that's when you'd need to clear your browser's local cache
wiki storage
CamperBot
@camperbot
Nov 24 2015 03:28 UTC

: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 UTC
ah
so that's the only way
Robert Richey
@0x0936
Nov 24 2015 03:29 UTC
the only way I'm aware of
Ang Li
@woleizihan
Nov 24 2015 03:31 UTC
thx! :sparkles:
McCoy
@mtbuck24
Nov 24 2015 03:32 UTC
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 UTC
@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 UTC
awesome! Thanks @0x0936 that helps!
CamperBot
@camperbot
Nov 24 2015 03:36 UTC
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 UTC
cool :)
McCoy
@mtbuck24
Nov 24 2015 03:48 UTC
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 UTC
nested arrays are useful for things like grids, or state machines
Anthony Guru
@mrguru2016
Nov 24 2015 03:50 UTC
I need a refresh on creating a h1 element with the text Hello World
McCoy
@mtbuck24
Nov 24 2015 03:51 UTC
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 UTC
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 UTC
@mrguru2016 hit reset to refresh
Robert Richey
@0x0936
Nov 24 2015 03:52 UTC
@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 UTC

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 UTC
@mtbuck24 lol you misunderstood
Robert Richey
@0x0936
Nov 24 2015 03:54 UTC
@mrguru2016 <h1>Hello World</h1> like that?
Anthony Guru
@mrguru2016
Nov 24 2015 03:54 UTC
@mtbuck24 Im on this portion Waypoint: Inherit Styles from the Body Element
McCoy
@mtbuck24
Nov 24 2015 03:54 UTC
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 UTC
@mtbuck24 right. it's much more common to see hierarchical objects than multi-dimensional arrays though
McCoy
@mtbuck24
Nov 24 2015 03:55 UTC
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 UTC
mtbuck24 sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:warning: mtbuck24 already gave 0x0936 points
Anthony Guru
@mrguru2016
Nov 24 2015 03:56 UTC
<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 UTC

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 UTC
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 UTC
@huanzhaoca done
Robert Richey
@0x0936
Nov 24 2015 03:58 UTC
@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 UTC
@0x0936 thanks i figured
CamperBot
@camperbot
Nov 24 2015 03:59 UTC
mrguru2016 sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 396 | @0x0936 | http://www.freecodecamp.com/0x0936
melric
@melric
Nov 24 2015 03:59 UTC
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 UTC
@chiang-shang-yu which waypoint are you working on?
Joseph
@revisualize
Nov 24 2015 04:00 UTC
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 UTC
String Variables
shang-yu
@chiang-shang-yu
Nov 24 2015 04:00 UTC
Fill in the Blank with Placeholder Text
Joseph
@revisualize
Nov 24 2015 04:01 UTC
That isn't going to work.
GRRR.
shang-yu
@chiang-shang-yu
Nov 24 2015 04:01 UTC
@0x0936 HI,my waypoint is Fill in the Blank with Placeholder Text
Robert Richey
@0x0936
Nov 24 2015 04:01 UTC
@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 UTC
@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 UTC
@hansinla okay.
McCoy
@mtbuck24
Nov 24 2015 04:02 UTC
Is this right? var ourArray = [3,2,1];
ourArray[0] = 1; // equals [1,2,1]
Joseph
@revisualize
Nov 24 2015 04:02 UTC
I always though 0 * 0 = 0
Anthony Guru
@mrguru2016
Nov 24 2015 04:02 UTC
<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 UTC

@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 UTC
@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 UTC
chiang-shang-yu okay
McCoy
@mtbuck24
Nov 24 2015 04:03 UTC
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 UTC
@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 UTC
huanzhaoca sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 397 | @0x0936 | http://www.freecodecamp.com/0x0936
shang-yu
@chiang-shang-yu
Nov 24 2015 04:04 UTC
@0x0936 oh i thought it's need some style haha
@0x0936 thanks
CamperBot
@camperbot
Nov 24 2015 04:04 UTC
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 UTC
@mtbuck24 [0] is the index position. Which starts at 0.
Huan Zhao
@huanzhaoca
Nov 24 2015 04:05 UTC
@0x0936 thanks again :D
CamperBot
@camperbot
Nov 24 2015 04:05 UTC
huanzhaoca sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:warning: huanzhaoca already gave 0x0936 points
Alexander Køpke
@alexanderkopke
Nov 24 2015 04:05 UTC
So it changes only the value in the first position of the array
McCoy
@mtbuck24
Nov 24 2015 04:06 UTC
@alexanderkopke so if I understand correctly. Would 1 be replacing index positions 0,1, and 2?
Robert Richey
@0x0936
Nov 24 2015 04:06 UTC
@huanzhaoca you're welcome! :)
McCoy
@mtbuck24
Nov 24 2015 04:06 UTC
Oh gotcha! Thank you @alexanderkopke
CamperBot
@camperbot
Nov 24 2015 04:06 UTC
mtbuck24 sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 258 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
McCoy
@mtbuck24
Nov 24 2015 04:06 UTC
Don't know how I missed that haha
Alexander Køpke
@alexanderkopke
Nov 24 2015 04:06 UTC
:+1:
Takes some getting used to
McCoy
@mtbuck24
Nov 24 2015 04:08 UTC
@alexanderkopke Definitely and I appreciate it! Was totally reading it wrong
Robert Richey
@0x0936
Nov 24 2015 04:12 UTC
// broken code, nothing to see here
Anthony
@vanillakernel
Nov 24 2015 04:16 UTC

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

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 UTC
@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 UTC
bonfire confirm the ending
CamperBot
@camperbot
Nov 24 2015 04:21 UTC

: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 UTC
Sweet, thanks @0x0936
CamperBot
@camperbot
Nov 24 2015 04:21 UTC
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 UTC
@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 UTC
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 UTC
-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 UTC
oh oh oh
i think the lightbulb went off.
Robert Richey
@0x0936
Nov 24 2015 04:30 UTC
yeah great!
wisekrish
@wisekrish
Nov 24 2015 04:35 UTC
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 UTC
@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 UTC

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 UTC
i need helping puttting an image in html
with img-responsive
Robert Richey
@0x0936
Nov 24 2015 04:44 UTC
@johndsykes86 cool :)
@TheRealCoder is this a waypoint? if so, which one?
James
@Andrale
Nov 24 2015 04:46 UTC
Quick question. How do you write CSS classes? I can't remember
Robert Richey
@0x0936
Nov 24 2015 04:47 UTC
@Andrale .className { property : value; }
Hans van Riet
@hansinla
Nov 24 2015 04:47 UTC
This message was deleted
SoKawaiii
@SoKawaiii
Nov 24 2015 04:48 UTC
what's the proper way to give an element an ID?
Hans van Riet
@hansinla
Nov 24 2015 04:48 UTC
@SoKawaiii id=“id_name"
Joseph
@revisualize
Nov 24 2015 04:49 UTC
Thanks @0x0936
CamperBot
@camperbot
Nov 24 2015 04:49 UTC
revisualize sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 400 | @0x0936 | http://www.freecodecamp.com/0x0936
James
@Andrale
Nov 24 2015 04:49 UTC
@0x0936 Then how would I assign it to lets say a h1 element?
lucypeony
@lucypeony
Nov 24 2015 04:49 UTC
I type <h2>CatPhotoApp</h2>?
Robert Richey
@0x0936
Nov 24 2015 04:50 UTC
@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 UTC
<h1 id="myid"></h1>
lucypeony
@lucypeony
Nov 24 2015 04:50 UTC
and there is error
$ is not defined?
Robert Richey
@0x0936
Nov 24 2015 04:50 UTC
@Icalvo1 class, not an id
Joseph
@revisualize
Nov 24 2015 04:50 UTC
@0x0936 Recursion isn't explained in the previous Waypoints.
Hans van Riet
@hansinla
Nov 24 2015 04:50 UTC
@lucypeony show your code
lucypeony
@lucypeony
Nov 24 2015 04:51 UTC
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 UTC
@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 UTC
@lucypeony there must be more code?
SoKawaiii
@SoKawaiii
Nov 24 2015 04:52 UTC
@hansinla I understand but for some reason I'm not getting it right
lucypeony
@lucypeony
Nov 24 2015 04:52 UTC
no ,i am on waypoint :Headline with the h2 element
i use chrome browser
Isaac Calvo
@Icalvo1
Nov 24 2015 04:52 UTC
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 UTC
How do I paste code into here
Joseph
@revisualize
Nov 24 2015 04:53 UTC
@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 UTC
like that ^
Hans van Riet
@hansinla
Nov 24 2015 04:53 UTC
@SoKawaiii show what you have
SoKawaiii
@SoKawaiii
Nov 24 2015 04:53 UTC
How?
James
@Andrale
Nov 24 2015 04:53 UTC
How can I add a class to a h1 element?
Hans van Riet
@hansinla
Nov 24 2015 04:53 UTC
This message was deleted
Bill
@kirah1314
Nov 24 2015 04:53 UTC
@Icalvo1 you're missing the rest of the strings
Joseph
@revisualize
Nov 24 2015 04:53 UTC
<h1 class="classname">text</h1>
Hans van Riet
@hansinla
Nov 24 2015 04:54 UTC
wiki format
CamperBot
@camperbot
Nov 24 2015 04:54 UTC

:point_right: code format [wiki]

Inline code

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

Code Block

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

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

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

How to Code

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

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

Mags Prescott
@magsprescott
Nov 24 2015 04:54 UTC
please
can some help me with this http://www.freecodecamp.com/challenges/waypoint-target-html-elements-with-selectors-using-jquery?solution=fccss%0A%20%20%24(document).ready(function()%20%7B%0A%0A%20%20%7D)%3B%0Afcces%0A%0A%3C!--%20Only%20change%20code%20above%20this%20line.%20--%3E%0A%0A%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%3Ch3%20class%3D%22text-primary%20text-center%22%3EjQuery%20Playground%3C%2Fh3%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23left-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22left-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target1%22%3E%23target1%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target2%22%3E%23target2%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target3%22%3E%23target3%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23right-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22right-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target4%22%3E%23target4%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target5%22%3E%23target5%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target6%22%3E%23target6%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A
Joseph
@revisualize
Nov 24 2015 04:54 UTC
WO!
Mags Prescott
@magsprescott
Nov 24 2015 04:54 UTC
please..
Joseph
@revisualize
Nov 24 2015 04:54 UTC
WOW! Look at the time
Bill
@kirah1314
Nov 24 2015 04:54 UTC
@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 UTC
@magsprescott what exactly do you need help with.
Hans van Riet
@hansinla
Nov 24 2015 04:55 UTC
@magsprescott what’s your question?
SoKawaiii
@SoKawaiii
Nov 24 2015 04:55 UTC
<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 UTC
@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 UTC
Sure.
SoKawaiii
@SoKawaiii
Nov 24 2015 04:55 UTC
how do I give this form element an ID
Hans van Riet
@hansinla
Nov 24 2015 04:55 UTC
@SoKawaiii <form id=“id_name”>
Joseph
@revisualize
Nov 24 2015 04:55 UTC
@0x0936 However, where I'm currently at is all ES5 and ES6.
Mags Prescott
@magsprescott
Nov 24 2015 04:56 UTC
"Use the jQuery addClass() function to give the classes animated and bounce to your button elements"
SoKawaiii
@SoKawaiii
Nov 24 2015 04:56 UTC
<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 UTC
@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 UTC
wait nevermind i think i got it
SoKawaiii
@SoKawaiii
Nov 24 2015 04:57 UTC
<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 UTC
@magsprescott so here is a hint .addClass(“bounce”);
SoKawaiii
@SoKawaiii
Nov 24 2015 04:57 UTC
neither way works ;_;
Robert Richey
@0x0936
Nov 24 2015 04:57 UTC
@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 UTC
@SoKawaiii your have two <form> tags now, you should only have one
Mags Prescott
@magsprescott
Nov 24 2015 04:58 UTC
dont you need a hashtag?
or not..
i forgot..
SoKawaiii
@SoKawaiii
Nov 24 2015 04:58 UTC
oh thanks
Hans van Riet
@hansinla
Nov 24 2015 04:58 UTC
@magsprescott you add a class by name
Mags Prescott
@magsprescott
Nov 24 2015 04:58 UTC
okay okay
Rishav Kumar
@rishav171
Nov 24 2015 04:59 UTC
i am not able to go to next map after completing
Joseph
@revisualize
Nov 24 2015 04:59 UTC
@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 UTC
revisualize sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:warning: revisualize already gave 0x0936 points
Hitesh Aloney
@Hitesh0413
Nov 24 2015 04:59 UTC
@breadstickguy I used this code $("#target4").html("<i>#target4</i>"); inside the script tag.
Hans van Riet
@hansinla
Nov 24 2015 04:59 UTC
@SoKawaiii you dont have a closing </form> tag at the end of your code
Robert Richey
@0x0936
Nov 24 2015 04:59 UTC
good night @revisualize
Rishav Kumar
@rishav171
Nov 24 2015 05:00 UTC
after completing one map ..coreectly it keeps loading and does not goes to next browser
Mags Prescott
@magsprescott
Nov 24 2015 05:00 UTC
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 UTC
@magsprescott how would you select the button?
Robert Richey
@0x0936
Nov 24 2015 05:01 UTC
@rishav171 which one are you stuck on?
Rishav Kumar
@rishav171
Nov 24 2015 05:01 UTC
$("button").addClass("animated bounce") use this code mags
SoKawaiii
@SoKawaiii
Nov 24 2015 05:02 UTC
@hansinla yeah I understand
thanks for the help
Robert Richey
@0x0936
Nov 24 2015 05:02 UTC
@rishav171 which waypoint is that?
Rishav Kumar
@rishav171
Nov 24 2015 05:02 UTC
i ma stuck in jquery
Jquery - 1
Mags Prescott
@magsprescott
Nov 24 2015 05:02 UTC
are you kidding me all i had to do was copy paste? that makes me angry
Rishav Kumar
@rishav171
Nov 24 2015 05:03 UTC
yes .!!:)
@0x0936 is there issue with browser?
Robert Richey
@0x0936
Nov 24 2015 05:04 UTC
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 UTC

: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 UTC
.green-box {
    background-color: green;
    padding: 40px 20px 20x 40px;
  }
oh wait nvm
Boris
@boris-in-london
Nov 24 2015 05:12 UTC
lol
Farshid Palad
@Capriano
Nov 24 2015 05:13 UTC
Guys I got a problem with "Target the same element with multiple jQuery Selectors waypoint"
Isaac Calvo
@Icalvo1
Nov 24 2015 05:14 UTC
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 UTC
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 UTC
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 UTC

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
Farshid Palad
@Capriano
Nov 24 2015 05:17 UTC
so how should I change my code you think?
Isaac Calvo
@Icalvo1
Nov 24 2015 05:18 UTC
each .addClass should only add 1 class in that waypoint
Farshid Palad
@Capriano
Nov 24 2015 05:18 UTC
well ... do I have more than one? I am new to javascript
Isaac Calvo
@Icalvo1
Nov 24 2015 05:18 UTC
$("button").addClass("animated");
etc
etc
Robert Richey
@0x0936
Nov 24 2015 05:19 UTC
.addClass("animated bounce"); is adding two classes
Farshid Palad
@Capriano
Nov 24 2015 05:19 UTC
oh i see
let me seeif i can fix it
thanks
Isaac Calvo
@Icalvo1
Nov 24 2015 05:19 UTC
np
Farshid Palad
@Capriano
Nov 24 2015 05:20 UTC
duh when you know its so simple
Dan Kuenneke
@DanKuenneke
Nov 24 2015 05:27 UTC
need help with "truncate a string" exercise
Mags Prescott
@magsprescott
Nov 24 2015 05:28 UTC
need help..
Dan Kuenneke
@DanKuenneke
Nov 24 2015 05:28 UTC
yes
Mags Prescott
@magsprescott
Nov 24 2015 05:28 UTC
<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 UTC
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 UTC
There's an extra C in the .btn class
TheRealCoder
@TheRealCoder
Nov 24 2015 05:47 UTC
my image wont pop up on html
Alem
@alemneh
Nov 24 2015 05:47 UTC
my pageId variable is coming up undefined???? http://codepen.io/alemneh/pen/dYEWpe?editors=001
TheRealCoder
@TheRealCoder
Nov 24 2015 05:47 UTC
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 UTC
@TheRealCoder the url in quotes
TheRealCoder
@TheRealCoder
Nov 24 2015 05:51 UTC
put the url in quotes?
under src or href?
Rohan
@Rohan2018
Nov 24 2015 05:52 UTC
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 UTC
@Rohan2018 "tails"
@Rohan2018 and reread the instructions :) the answer is there
Rohan
@Rohan2018
Nov 24 2015 05:58 UTC
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 UTC
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 UTC
@bluegoon I think you mean class='btn btn-primary'
LJ Roos
@bluegoon
Nov 24 2015 06:00 UTC
@kirah1314 You're my hero, thank you!
CamperBot
@camperbot
Nov 24 2015 06:00 UTC
bluegoon sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 411 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Nov 24 2015 06:01 UTC
@bluegoon glad to help :)
mgarcell
@mgarcell
Nov 24 2015 06:04 UTC
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 UTC
@mgarcell I'm not so sure we have a lesson 172 haha
mgarcell
@mgarcell
Nov 24 2015 06:07 UTC
Oops
Well that's the number in the top right corner
Bill
@kirah1314
Nov 24 2015 06:07 UTC
@mgarcell ahh that's your brownie points
help brownie points
CamperBot
@camperbot
Nov 24 2015 06:07 UTC

:point_right: brownie points [wiki]

The number beside your picture on Free Code Camp tells you how many Brownie Points you have.

A user profile picture next to a with Brownie Points score

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 UTC
@kirah1314 Thanks! Didn't know that
CamperBot
@camperbot
Nov 24 2015 06:08 UTC
mgarcell sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 413 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Nov 24 2015 06:08 UTC
@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 UTC
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 UTC
@mgarcell ok so you solved it right?
and you want to know what's going on?
mgarcell
@mgarcell
Nov 24 2015 06:12 UTC
Haven't looked at that one yet
But basically from arrays up until this point
Bill
@kirah1314
Nov 24 2015 06:13 UTC
@mgarcell well think of waypoints as basically a hand-holding process
mgarcell
@mgarcell
Nov 24 2015 06:13 UTC
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 UTC
@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 UTC
Cause I am to complete the tasks, but not fully "getting it"
Bill
@kirah1314
Nov 24 2015 06:14 UTC
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 UTC
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 UTC
@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 UTC
perfect
@kirah1314 thanks again!
CamperBot
@camperbot
Nov 24 2015 06:16 UTC
mgarcell sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: mgarcell already gave kirah1314 points
Rishav Kumar
@rishav171
Nov 24 2015 06:20 UTC
how much months it can take to complete full programs (if i dedicate 4 hours daily )
Farshid Palad
@Capriano
Nov 24 2015 06:26 UTC
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 UTC
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 UTC
@rishav171 post your codes and we could take a look?
Ian Walker
@tonesfrommars
Nov 24 2015 06:31 UTC
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 UTC

<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 UTC
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 UTC
@rishav171 $("#target4").html("<i>Jquery</i>"); Did the waypoint ask for the text of Jquery?
Rishav Kumar
@rishav171
Nov 24 2015 06:46 UTC
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 UTC
@Rohan2018 If you still have a question, post your code and ask a specific question.
Rishav Kumar
@rishav171
Nov 24 2015 06:48 UTC
@kirah1314 it asks for -Italicize the text in your target4 button by adding HTML tags
Rohan
@Rohan2018
Nov 24 2015 06:48 UTC
@Masd925 should I include the lesson code that was already there?
Rishav Kumar
@rishav171
Nov 24 2015 06:49 UTC
hey @kirah1314 i got it.was making a silly misatke
Rohan
@Rohan2018
Nov 24 2015 06:49 UTC
@Masd925 or just my code?
Akira Laine
@AkiraLaine
Nov 24 2015 06:49 UTC
@rishav171 You need to make the text "#target4"
Markus Kiili
@Masd925
Nov 24 2015 06:49 UTC
@Rohan2018 whole code please.
Rohan
@Rohan2018
Nov 24 2015 06:49 UTC

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

function myFunction() {

// Only change code below this line.

if (flip === 0){
return "tails";
}
else {
return "heads";
}
// 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){
return "heads";
}
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 UTC
@Rohan2018 What is the name of the exercise?
Rohan
@Rohan2018
Nov 24 2015 06:56 UTC
@Masd925 Use Conditional Logic with If and Else Statements
Markus Kiili
@Masd925
Nov 24 2015 06:57 UTC
@Rohan2018 use "tails" not "tales"
Rohan
@Rohan2018
Nov 24 2015 06:58 UTC
second time I've done that
Alexander
@gwartney21
Nov 24 2015 06:59 UTC
has any one thats on worked on the calculator zip line i have a question
Rohan
@Rohan2018
Nov 24 2015 06:59 UTC
@Masd925 Fixed that typo, still doesn't change anything though
Markus Kiili
@Masd925
Nov 24 2015 07:00 UTC
@Rohan2018 It works, I checked.
Rohan
@Rohan2018
Nov 24 2015 07:01 UTC
@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 UTC
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 UTC
@gwartney21 I did that one a while back.
Markus Kiili
@Masd925
Nov 24 2015 07:03 UTC
@Rohan2018 You're wellcome.
Austin Teshak
@Ateshak
Nov 24 2015 07:28 UTC
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 UTC
@Ateshak First you can go ahead and delete <class>.
Alexander
@gwartney21
Nov 24 2015 07:30 UTC
@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 UTC
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 UTC
@Ateshak like so <h1 class="color"></color>
Den McHenry
@denmch
Nov 24 2015 07:31 UTC
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 UTC
which would look like .color {color:pink}
Den McHenry
@denmch
Nov 24 2015 07:32 UTC
.pink-text { color: pink; }
Alexander
@gwartney21
Nov 24 2015 07:32 UTC
or what ever you name your class
Austin Teshak
@Ateshak
Nov 24 2015 07:34 UTC

<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 UTC
@Ateshak You'll get the hang of it :)
Alexander
@gwartney21
Nov 24 2015 07:35 UTC
@Ateshak takes time just keep at it and yea that looks right
Jim Withington
@jwithington
Nov 24 2015 07:35 UTC
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 UTC
This message was deleted
Austin Teshak
@Ateshak
Nov 24 2015 07:37 UTC
thanks for the help all. Appreciated
Alexander
@gwartney21
Nov 24 2015 07:38 UTC
@Ateshak your welcome
Trevor Murphy
@summerfr33ze
Nov 24 2015 07:39 UTC
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 UTC
Which Waypoint is that?
Bill
@kirah1314
Nov 24 2015 07:43 UTC
@summerfr33ze modify the <p> under <h2> and don't add a new line of code
Trevor Murphy
@summerfr33ze
Nov 24 2015 07:44 UTC
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 UTC
thanks @bjornkeyser
CamperBot
@camperbot
Nov 24 2015 08:23 UTC
sorry bjornkeyser, you can't send brownie points to yourself! :sparkles: :sparkles:
Henrikmr
@Henrikmr
Nov 24 2015 08:23 UTC
Your text input element should have the required attribute.
what to do?
Sam
@slibre2
Nov 24 2015 08:23 UTC

@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
return addUnit(speed);
};this.setGear= function (){
};

Henrikmr
@Henrikmr
Nov 24 2015 08:23 UTC
<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 UTC
someone say thanks bjornkeyser
Fridox
@deniz946
Nov 24 2015 08:26 UTC
brownie points hunter
Sam
@slibre2
Nov 24 2015 08:28 UTC
@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
return addUnit(speed);
};this.setGear= function (){
};
@bjornkeyser Hoi !
srinivas
@srinivasdasu
Nov 24 2015 08:30 UTC
Sam
@slibre2
Nov 24 2015 08:30 UTC
@srinivasdasu Waypoint: Make Object Properties Private
srinivas
@srinivasdasu
Nov 24 2015 08:32 UTC
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 UTC
@srinivasdasu why 1-4 ?
Rex Schrader
@SaintPeter
Nov 24 2015 08:33 UTC
@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 UTC
@srinivasdasu WON !! Thanks a lot
CamperBot
@camperbot
Nov 24 2015 08:34 UTC
slibre2 sends brownie points to @srinivasdasu :sparkles: :thumbsup: :sparkles:
:star: 279 | @srinivasdasu | http://www.freecodecamp.com/srinivasdasu
srinivas
@srinivasdasu
Nov 24 2015 08:34 UTC
Every vehicle will have gears up to 1-5 up to my knowledge@slibre2
Sam
@slibre2
Nov 24 2015 08:34 UTC
@SaintPeter thanks Saint Peter as well !
CamperBot
@camperbot
Nov 24 2015 08:34 UTC
slibre2 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1649 | @saintpeter | http://www.freecodecamp.com/saintpeter
srinivas
@srinivasdasu
Nov 24 2015 08:34 UTC
but it got passed for me @SaintPeter
Sam
@slibre2
Nov 24 2015 08:35 UTC
@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 UTC
its ok @slibre2
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 08:50 UTC
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 UTC
:bulb: to format code use backticks! ``` more info
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 08:51 UTC
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 UTC
hey @ohid1986 lets talk about that,
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 08:53 UTC
@iccomq ok could you tell where is the problem?
iccomq
@iccomq
Nov 24 2015 08:53 UTC
@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 UTC
@iccomq
ok
iccomq
@iccomq
Nov 24 2015 08:54 UTC
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 UTC
Then should I pass only numeric values in the car function
iccomq
@iccomq
Nov 24 2015 08:56 UTC
*To the Car function, thats right
in parenthesis
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 08:58 UTC
@iccomq
var myCar =new Car(3,1,2);{
  //Change this constructor

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

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

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 UTC
@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 UTC
@raw1211 @iccomq yes this work now
iccomq
@iccomq
Nov 24 2015 09:04 UTC
@raw1211 we would get there eventually :D
Md. Ohiduzzaman
@ohid1986
Nov 24 2015 09:04 UTC
@raw1211 @iccomq thanks
CamperBot
@camperbot
Nov 24 2015 09:04 UTC
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 UTC
@iccomq have u started working on your first zipline
iccomq
@iccomq
Nov 24 2015 09:05 UTC
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 UTC
@iccomq so u have been online since our last chat
iccomq
@iccomq
Nov 24 2015 09:07 UTC
could you remind exactly what we talked about last time?
bonfire Where do i belong?
CamperBot
@camperbot
Nov 24 2015 09:07 UTC

: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 UTC
hey bot go away :P
raw1211
@raw1211
Nov 24 2015 09:07 UTC
@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 UTC
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 UTC
@iccomq everyone has forgetting problem
iccomq
@iccomq
Nov 24 2015 09:13 UTC
@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 UTC
@iccomq change the conversation topic with people when u have forgotten about your previous conversation with them
iccomq
@iccomq
Nov 24 2015 09:17 UTC
@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 UTC
why do i have 2 followers
Mags Prescott
@magsprescott
Nov 24 2015 09:17 UTC
hi guys i need help
"Italicize the text in your target4 button by adding HTML tags."
raw1211
@raw1211
Nov 24 2015 09:18 UTC
@magsprescott post ur code
Mags Prescott
@magsprescott
Nov 24 2015 09:18 UTC
  $("target4").html("");
raw1211
@raw1211
Nov 24 2015 09:18 UTC
@magsprescott use have to use <i> </i> tag
inside .html class
Mags Prescott
@magsprescott
Nov 24 2015 09:19 UTC
  $("target4").html("<i> </i>");
raw1211
@raw1211
Nov 24 2015 09:19 UTC
@magsprescott and add #target4 in between
iccomq
@iccomq
Nov 24 2015 09:19 UTC

your

 $("target4")

needs # if its class

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

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!

:pencil: read more about camperbot on the FCC Wiki

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

@rishav171 remember that first part

$("#target4")

is the part you already call method for

Akira Laine
@AkiraLaine
Nov 24 2015 09:29 UTC
wiki brownie
CamperBot
@camperbot
Nov 24 2015 09:29 UTC

:point_right: brownie points [wiki]

The number beside your picture on Free Code Camp tells you how many Brownie Points you have.

A user profile picture next to a with Brownie Points score

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 UTC
@rishav171
iccomq
@iccomq
Nov 24 2015 09:29 UTC
@rishav171 it basically means "select element with id target4"
raw1211
@raw1211
Nov 24 2015 09:30 UTC
@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 UTC
oh okey ..
iccomq
@iccomq
Nov 24 2015 09:30 UTC
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 UTC
@iccomq more brownies=more cool
Rishav Kumar
@rishav171
Nov 24 2015 09:31 UTC
"thanks @raw1211
CamperBot
@camperbot
Nov 24 2015 09:31 UTC
rishav171 sends brownie points to @raw1211 :sparkles: :thumbsup: :sparkles:
:star: 252 | @raw1211 | http://www.freecodecamp.com/raw1211
raw1211
@raw1211
Nov 24 2015 09:31 UTC
@rishav171 yw
Mags Prescott
@magsprescott
Nov 24 2015 09:32 UTC
thanks @raw1211
CamperBot
@camperbot
Nov 24 2015 09:32 UTC
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 UTC
still in jquery.. lng way to go!
Mags Prescott
@magsprescott
Nov 24 2015 09:33 UTC
me too rishav171
we can do this
Rishav Kumar
@rishav171
Nov 24 2015 09:34 UTC
we will
Mags Prescott
@magsprescott
Nov 24 2015 09:49 UTC
2 more to go and im done with jQuery heeheh
iccomq
@iccomq
Nov 24 2015 09:52 UTC
@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 UTC
thanks @iccomq
CamperBot
@camperbot
Nov 24 2015 09:53 UTC
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 UTC
i dont know what links you're talking about.. :/
iccomq
@iccomq
Nov 24 2015 09:55 UTC
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 UTC
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 UTC
@KofiAkorli you are modyfying global variable here
KofiAkorli
@KofiAkorli
Nov 24 2015 10:03 UTC
@iccomq ... I don't understand what you mean ...
iccomq
@iccomq
Nov 24 2015 10:04 UTC
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 UTC
@iccomq okay, thanks
CamperBot
@camperbot
Nov 24 2015 10:06 UTC
kofiakorli sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles:
:star: 141 | @iccomq | http://www.freecodecamp.com/iccomq
iccomq
@iccomq
Nov 24 2015 10:12 UTC
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 UTC
@iccomq great illustration, thank you, but why is local undefined?
CamperBot
@camperbot
Nov 24 2015 10:16 UTC
kofiakorli sends brownie points to @iccomq :sparkles: :thumbsup: :sparkles:
:warning: kofiakorli already gave iccomq points
Mags Prescott
@magsprescott
Nov 24 2015 10:16 UTC
do you need to know maths to be good at this
iccomq
@iccomq
Nov 24 2015 10:17 UTC
@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 UTC

: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

MoaTh Khozyem
@moathkhozyem
Nov 24 2015 10:20 UTC
Morining mates
iccomq
@iccomq
Nov 24 2015 10:21 UTC
morning @jOkes7
MoaTh Khozyem
@moathkhozyem
Nov 24 2015 10:21 UTC
how is everything
iccomq
@iccomq
Nov 24 2015 10:22 UTC
ah morning coffess procrastination, and that feeling you have to do things you know
MoaTh Khozyem
@moathkhozyem
Nov 24 2015 10:24 UTC
i know that feeling bro
KofiAkorli
@KofiAkorli
Nov 24 2015 10:24 UTC
@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