These are chat archives for FreeCodeCamp/Help

13th
Oct 2015
DTing
@dting
Oct 13 2015 00:00
var timer;
$('#start').click(function(){
  timer = setInterval(myTimer, 1000);
});
$('#stop').click(function(){
  clearInterval(timer);
  console.log('stop')
});
Anders Bengtsson
@anders462
Oct 13 2015 00:02
@dting @BrainDrainBahrain thanks !! your right of course, ;-)
CamperBot
@camperbot
Oct 13 2015 00:02
anders462 sends brownie points to @dting and @braindrainbahrain :sparkles: :thumbsup: :sparkles:
:star: 197 | @braindrainbahrain | http://www.freecodecamp.com/braindrainbahrain
:star: 1376 | @dting | http://www.freecodecamp.com/dting
Tim Bell
@MindfulBell
Oct 13 2015 00:03
http://codepen.io/MindfulBell/full/EVvoNr/ let me know what you think
DTing
@dting
Oct 13 2015 00:08
@MindfulBell nice
i like how it doesnt let you mod floats
Tim Bell
@MindfulBell
Oct 13 2015 00:08
right...totally took that into account ;-)
DTing
@dting
Oct 13 2015 00:09
oh oops
hahah
nice work
Kevin Hsu
@WigoHunter
Oct 13 2015 00:11
Hi guys I'm a new guy, can I ask why is a code in the my FreeCodeCamp practice not working here?
David Bouwkamp
@DavidBouw
Oct 13 2015 00:11
@WigoHunter Hi. Which waypoint or bonfire are you on?
Kevin Hsu
@WigoHunter
Oct 13 2015 00:12
Bonfire: Title Case a Sentence
CamperBot
@camperbot
Oct 13 2015 00:12

:fire:Bonfire: Title Case a Sentence :link:

function titleCase(str) {
  return str;
}

titleCase("I'm a little tea pot");

Return the provided string with the first letter of each word capitalized.

more info:  bf details | bf links | hint

Kevin Hsu
@WigoHunter
Oct 13 2015 00:12

function titleCase(str) {
var i = 0;
str0=str0.toUpperCase();
for(i=0;i<str.length;i++){
if(str[i]===' ')
str[i+1]=str.charAt(i+1).toUpperCase();
}
return str;
}

titleCase("i'm a little tea pot");

and this was what I did
Colton Ehrman
@coltonehrman
Oct 13 2015 00:13
@WigoHunter edit your code and format it with backticks please
Kevin Hsu
@WigoHunter
Oct 13 2015 00:13
Oops, im sorry but how do i do that?
Colton Ehrman
@coltonehrman
Oct 13 2015 00:14
go to ur code and click the three dots on right. then click edit
then add three backticks ` on top and bottom of code
ill do it for u this time
bruglesco
@bruglesco
Oct 13 2015 00:14
format help
Colton Ehrman
@coltonehrman
Oct 13 2015 00:16
function titleCase(str) {
  var i = 0;
  str[0]=str[0].toUpperCase();
  for(i=0;i<str.length;i++){
    if(str[i]===' ')
      str[i+1]=str.charAt(i+1).toUpperCase();
  }
  return str;
}

titleCase("i'm a little tea pot");
Kevin Hsu
@WigoHunter
Oct 13 2015 00:18
thanks a lot!
CamperBot
@camperbot
Oct 13 2015 00:18
if you want to thank someone, put an @ before their name!
Kevin Hsu
@WigoHunter
Oct 13 2015 00:18
@coltonehrman thanks a lot!
CamperBot
@camperbot
Oct 13 2015 00:18
wigohunter sends brownie points to @coltonehrman :sparkles: :thumbsup: :sparkles:
:star: 274 | @coltonehrman | http://www.freecodecamp.com/coltonehrman
Colton Ehrman
@coltonehrman
Oct 13 2015 00:18
np @WigoHunter
Kevin Hsu
@WigoHunter
Oct 13 2015 00:18
the problem is it's not Uppercasing the first letter of each word
bruglesco
@bruglesco
Oct 13 2015 00:19
because bracket notation on string elements seperates the strings
they need rejoined.
Kevin Hsu
@WigoHunter
Oct 13 2015 00:20
but I thought I didn't separate them, I checked if there's a space, and every letter after a space should be capitalized
bruglesco
@bruglesco
Oct 13 2015 00:21
bf links
CamperBot
@camperbot
Oct 13 2015 00:21
James Smith
@matthew02
Oct 13 2015 00:21
@WigoHunter Strings are immutable. You can't change them after they are initialized like you can with an array.
bruglesco
@bruglesco
Oct 13 2015 00:22
is that why you have to join them?
James Smith
@matthew02
Oct 13 2015 00:22
@WigoHunter That bracket notation assignment doesn't work.
Colton Ehrman
@coltonehrman
Oct 13 2015 00:22
turn ur string into an array with .split()
Kevin Hsu
@WigoHunter
Oct 13 2015 00:24
Let me try this, let me split them first
thanks @coltonehrman @bruglesco @matthew02
CamperBot
@camperbot
Oct 13 2015 00:24
wigohunter sends brownie points to @coltonehrman and @bruglesco and @matthew02 :sparkles: :thumbsup: :sparkles:
:warning: wigohunter already gave coltonehrman points
:star: 336 | @matthew02 | http://www.freecodecamp.com/matthew02
:star: 200 | @bruglesco | http://www.freecodecamp.com/bruglesco
Kevin Hsu
@WigoHunter
Oct 13 2015 00:34
str[0].charAt(0)=str[0].charAt(0).toUpperCase();
it also says the left hand side of the assignment is invalid
I've tried to search with google, but couldn't find if there's any way else to make change of a string in an array
Garrett Schultz
@garettschultz
Oct 13 2015 00:37
hey everyone is there a way to disable the green popup boxes that show up on the side of chat room every once in awhile?
Chris
@Aoxom
Oct 13 2015 00:40
@gratschultz2013 top right of chat window, settings icon, notifications
Garrett Schultz
@garettschultz
Oct 13 2015 00:41
whats "lurk " mode?
David Bouwkamp
@DavidBouw
Oct 13 2015 00:45
I'd guess that it keeps your status icon's color to orange (inactive)
Garrett Schultz
@garettschultz
Oct 13 2015 00:50
oh okay
hey does anybody know why the "current streak" on our profiles doesnt change unless we do new stuff?
I am redoing the entire javascript tutorials and it still says I havent logged in today and not being counted towards my current streak thats the only reason i ask.
Nobuyuki Fujioka
@nfabacus
Oct 13 2015 00:54
In the profile page of FreeCodeCamp, it says "Update your code portfolio". Could you tell me what it does if I add my Twitter, Facebook account,etc...?
Edi Santoso
@repodevs
Oct 13 2015 00:56
hy any one can help me ?
Garrett Schultz
@garettschultz
Oct 13 2015 00:56
@nfabacus thats just optional, if you want to you can link those accounts to FCC to share your progress ect.
David Bouwkamp
@DavidBouw
Oct 13 2015 00:56
@tietutz what problem are you working on and can you post your code?
Edi Santoso
@repodevs
Oct 13 2015 00:59

i'm learning html5 in http://freecodecamp.com/challenges/waypoint-add-images-to-your-website . this is my code

<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }
</style>

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

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

<img src="https://s3.amazonaws.com/freecodecamp/relaxing-cat.jpg">

but i cannot continue the challange, is my code wrong or is a bug ?. #sorry for my bad english

bruglesco
@bruglesco
Oct 13 2015 00:59
wiki format
CamperBot
@camperbot
Oct 13 2015 00:59

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:02
Any one else get the bug on Bonfire: Return Larget Number in Arrays?
Gary E.
@Garodos11227
Oct 13 2015 01:02
...

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

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

//Add the property "engines" to myCar, and make it a number.

// Only change code above this line.
(function() {return JSON.stringify(myCar);})();

...
what gives?
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:02
car {
David Bouwkamp
@DavidBouw
Oct 13 2015 01:02
you need to use the link "https://bit.ly/fcc-relaxing-cat". everything else looks correct @tietutz
Gary E.
@Garodos11227
Oct 13 2015 01:02
i added this.engines = 6;
Nobuyuki Fujioka
@nfabacus
Oct 13 2015 01:03
@gratschultz2013 Ok, thank you for your help.
CamperBot
@camperbot
Oct 13 2015 01:03
nfabacus sends brownie points to @gratschultz2013 :sparkles: :thumbsup: :sparkles:
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:03
myCar.engines = 1;
CamperBot
@camperbot
Oct 13 2015 01:03
:star: 194 | @gratschultz2013 | http://www.freecodecamp.com/gratschultz2013
Edi Santoso
@repodevs
Oct 13 2015 01:03
@BrainDrainBahrain thanks its work :smile:
CamperBot
@camperbot
Oct 13 2015 01:03
tietutz sends brownie points to @braindrainbahrain :sparkles: :thumbsup: :sparkles:
:star: 198 | @braindrainbahrain | http://www.freecodecamp.com/braindrainbahrain
Gary E.
@Garodos11227
Oct 13 2015 01:03
thanks!!
CamperBot
@camperbot
Oct 13 2015 01:03
if you want to thank someone, put an @ before their name!
Noel Sufrin
@stimpygato
Oct 13 2015 01:07
If you want to thank someone, cash is also great ;)
CamperBot
@camperbot
Oct 13 2015 01:07
if you want to thank someone, put an @ before their name!
Korry Williams
@korrywill
Oct 13 2015 01:08
@BrainDrainBahrain Still online I see
Garrett Schultz
@garettschultz
Oct 13 2015 01:09
var firstNameLength = 0;
var lastNameLength = 0;
var firstName = "Ada";

firstNameLength = firstName.length;

var lastName = "Lovelace";

// Only change code below this line.

lastNameLength = lastName;
lastNameLength = lastName.length;



// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
if(typeof(lastNameLength) !== "undefined"){(function(){return lastNameLength;})();}
im finding the length of the last name but what i dont understand is why write lastNameLength at the beginning before the equal sign if that variable is equal to 0? But the solution is supposed to equal 8?
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:11
it is good practice to do that when calling the function with global variables
Thomas Manchester
@Eruditious
Oct 13 2015 01:11
looking for someone to pair program with
i got last 5 bonfires to go
lookin to finish em up fast
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:12
err @gratschultz2013 it is good practiace to do that when you have global variables involved (it clears out any old junk in them"
Brian K
@BKtheDAD
Oct 13 2015 01:12
I'm working on the first bonfire challenge reverse a string and I keep getting stuck
Garrett Schultz
@garettschultz
Oct 13 2015 01:12
@TheDukeOfAwesome but that doesnt make sense to me because it shows that that variable is equal to 0 so how is it possible to equal 8?
David Bouwkamp
@DavidBouw
Oct 13 2015 01:13
I'm on the last 2 bonfires if you want to pair up @Eruditious
bruglesco
@bruglesco
Oct 13 2015 01:13
variables can be altered
thats the whole point
Brian K
@BKtheDAD
Oct 13 2015 01:14

'''function reverseString(str) {
return str;
}

var array = reverseString("hello");
array = array.split("");
array.split = array.reverse("");
array.reverse = array.join("");'''

CamperBot
@camperbot
Oct 13 2015 01:14
:bulb: to format code use backticks! ``` more info
Thomas Manchester
@Eruditious
Oct 13 2015 01:14
sure brain
im using kobra.io
i can give you my link
Brian K
@BKtheDAD
Oct 13 2015 01:14

'''
function reverseString(str) {
return str;
}

var array = reverseString("hello");
array = array.split("");
array.split = array.reverse("");
array.reverse = array.join("");
'''

CamperBot
@camperbot
Oct 13 2015 01:14
:bulb: to format code use backticks! ``` more info
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:14
@gratschultz2013 the inital var lastNameLenght = 0; is defineing the variable. setting it to be used. then you have the one which is the calculated value. The reason for the 2 in the modifiable code section is to throw you off.
Brian K
@BKtheDAD
Oct 13 2015 01:14
function reverseString(str) {
  return str;
}

var array = reverseString("hello");
array = array.split("");
array.split = array.reverse("");
array.reverse = array.join("");
sorry about that
it gives me "olleh"
Thomas Manchester
@Eruditious
Oct 13 2015 01:16
@BrainDrainBahrain
Brian K
@BKtheDAD
Oct 13 2015 01:16
it's bonfire #2: Reverse a String
Thomas Manchester
@Eruditious
Oct 13 2015 01:16
bkgeek
you're not returning anything
you need that all in the function
Garrett Schultz
@garettschultz
Oct 13 2015 01:17
okay thank you @TheDukeOfAwesome much appreciated clarification
CamperBot
@camperbot
Oct 13 2015 01:17
gratschultz2013 sends brownie points to @thedukeofawesome :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for thedukeofawesome
Garrett Schultz
@garettschultz
Oct 13 2015 01:21
@TheDukeOfAwesome so would the same thing work if you just did this? ```
var lastName = "Some Last Name";
lastName.length;
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:21
@gratschultz2013 should
Brian K
@BKtheDAD
Oct 13 2015 01:21
@Eruditious can you explain that to me
Garrett Schultz
@garettschultz
Oct 13 2015 01:22
Okay, I am just trying to make sure I completely understand everything before moving to the next tutorial.
Nicole
@kathrynicolle
Oct 13 2015 01:23
Hello world!
CamperBot
@camperbot
Oct 13 2015 01:23

welcome to FreeCodeCamp @kathrynicolle!

Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:23
@gratschultz2013 I just punched it in my code window and gave me 14 so the code is proper and does work.
Garrett Schultz
@garettschultz
Oct 13 2015 01:23
awesome! thank you @TheDukeOfAwesome, feels good to understand it.
CamperBot
@camperbot
Oct 13 2015 01:23
gratschultz2013 sends brownie points to @thedukeofawesome :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for thedukeofawesome
Evgeniy Abramov
@kiopro
Oct 13 2015 01:23
yep
Nicole
@kathrynicolle
Oct 13 2015 01:24
I need help with the bonfire challenge on factorizing a number... Anyone?
CamperBot
@camperbot
Oct 13 2015 01:24
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Jordan Robertson
@Jordanson
Oct 13 2015 01:24
does annybody know how to look at someones fcc profile?
Herman Fassett
@HermanFassett
Oct 13 2015 01:25
@bkgeek a typical function is like
function reverseString(str) {
    //Do stuff to string here
    array = str.s...
    //After done, return
    return str;
}
reverseString("hello");
@kathrynicolle what have you tried?
about @Jordanson
CamperBot
@camperbot
Oct 13 2015 01:25
:star: 175 | @jordanson | http://www.freecodecamp.com/jordanson
Herman Fassett
@HermanFassett
Oct 13 2015 01:25
Clickety @Jordanson
Or just append username onto base of freecodecamp.com/
Jordan Robertson
@Jordanson
Oct 13 2015 01:26
thanks @HermanFassett gonna practice on you lol
CamperBot
@camperbot
Oct 13 2015 01:26
jordanson sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 357 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Jordan Robertson
@Jordanson
Oct 13 2015 01:26
about @HermanFassett
CamperBot
@camperbot
Oct 13 2015 01:26
:star: 357 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Jordan Robertson
@Jordanson
Oct 13 2015 01:27
cool
Nicole
@kathrynicolle
Oct 13 2015 01:28
@HermanFassett using modulus to get numbers less than n, though I dont know how to arrange it into code to get the answer
Herman Fassett
@HermanFassett
Oct 13 2015 01:30
The answer should be n * all the numbers below it down to 1... Modulus operator returns the remainder...
@kathrynicolle I think most people just use a for loop to go through all the numbers between 0 and inclusive n and multiply them into a result
Nicole
@kathrynicolle
Oct 13 2015 01:31
Okay... thanks
CamperBot
@camperbot
Oct 13 2015 01:31
if you want to thank someone, put an @ before their name!
Herman Fassett
@HermanFassett
Oct 13 2015 01:31
I used recursion just for fun :)
Brian K
@BKtheDAD
Oct 13 2015 01:33
@HermanFassett here is what I figured out:

```function reverseString(str) {
var array = str.split("").reverse().join("");
return array;
}

reverseString("hello");
```

function reverseString(str) {
  var array = str.split("").reverse().join("");
  return array;
}

reverseString("hello");
now my question lies in, why do I have to return array instead of str?
because when I try to return str, it does not work
Herman Fassett
@HermanFassett
Oct 13 2015 01:35
Well because you set array equal to str.split etc
You could always have done
function reverseString(str) {
  str = str.split("").reverse().join("");
  return str;
}
reverseString("hello");
Brian K
@BKtheDAD
Oct 13 2015 01:35
ohhhhhhhhh
Herman Fassett
@HermanFassett
Oct 13 2015 01:35
Or even
function reverseString(str) {
  return str.split("").reverse().join("");
}
reverseString("hello");
Brian K
@BKtheDAD
Oct 13 2015 01:36
so I don't need to set it as a variable?
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:37
@bkgeek Generally no.
Herman Fassett
@HermanFassett
Oct 13 2015 01:38
It might be considered good practice to make it more readable, but honestly especially for this length of code it doesn't matter. I generally go as easy and short as possible :)
Brian K
@BKtheDAD
Oct 13 2015 01:39
so if this were a real program I would probably should/would want to set it as a variable?
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:41
Or write the long hand code out in a comment above. It helps when you do something crazy @bkgeek . Tracking back code that just exploded when you compress 5 lines like that. it gets you back into the head space you were in while writing it.
Herman Fassett
@HermanFassett
Oct 13 2015 01:41
I generally prefer to use as few variables as possible, commenting if I think it's hard to understand.
Brian K
@BKtheDAD
Oct 13 2015 01:41
@TheDukeOfAwesome that's what I ended up doing, thanks for the suggestion
CamperBot
@camperbot
Oct 13 2015 01:41
bkgeek sends brownie points to @thedukeofawesome :sparkles: :thumbsup: :sparkles:
:star: 212 | @thedukeofawesome | http://www.freecodecamp.com/thedukeofawesome
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:41
And to Herman's point it helps with memory leaks.
Brian K
@BKtheDAD
Oct 13 2015 01:42
function reverseString(str) {
  var array = str.split("").reverse().join(""); //This doesn't need to be set as a variable
  return array; //Since array = str, you need to return array
}

reverseString("hello");
Jordan Robertson
@Jordanson
Oct 13 2015 01:42
reverseString("hello");
function reverseString(cake) {
  var strReverse = cake.split("").reverse().join("");
  return strReverse;
}
Can someone tell me how this solution satisfies all requirements for bonfire reverse a string?
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:43
@Jordanson ```
Brian K
@BKtheDAD
Oct 13 2015 01:43
@Jordanson look at what I just put in above it
or do you want it broken down?
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:43
@Jordanson
function reverseString(cake) {
  var strReverse = cake.split("").reverse().join("");
  return strReverse;
}
reverseString("hello");
Jordan Robertson
@Jordanson
Oct 13 2015 01:44
I understand the code, I just dont understand how i completed the bonfire bc it asks to reverse other words as well?
naw mean?
Herman Fassett
@HermanFassett
Oct 13 2015 01:44
Yeah the way it's written kind of feels like it should be looped through values, but
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:44
@Jordanson I am still getting the hang of these modern chat rooms. So forgive my typos. You have to call the function after you create it. Otherwise it can cause headaches once compiled.
Herman Fassett
@HermanFassett
Oct 13 2015 01:45
Or
Not sure where I was going with that
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:45
@Jordanson Oh that. There is another sheet that tests the function behind the scenes.
I add all that noise to test when I am having a stupid moment.
And have to bash through making sure that I didn't do something odd with a variable.
Brian K
@BKtheDAD
Oct 13 2015 01:48
Thanks to @Jordanson @TheDukeOfAwesome @HermanFassett
CamperBot
@camperbot
Oct 13 2015 01:48
bkgeek sends brownie points to @jordanson and @thedukeofawesome and @hermanfassett :sparkles: :thumbsup: :sparkles:
:warning: bkgeek already gave thedukeofawesome points
:star: 358 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
:star: 177 | @jordanson | http://www.freecodecamp.com/jordanson
Jordan Robertson
@Jordanson
Oct 13 2015 01:48
wot i do lol?
Rex Schrader
@SaintPeter
Oct 13 2015 01:49
@Jordanson Thank you for being awesome!
CamperBot
@camperbot
Oct 13 2015 01:49
saintpeter sends brownie points to @jordanson :sparkles: :thumbsup: :sparkles:
:star: 178 | @jordanson | http://www.freecodecamp.com/jordanson
Brian K
@BKtheDAD
Oct 13 2015 01:50
haha just spreading the karma around
Jordan Robertson
@Jordanson
Oct 13 2015 01:50
haha aye noice thanks @TheDukeOfAwesome @bkgeek @Heibeg
CamperBot
@camperbot
Oct 13 2015 01:50
jordanson sends brownie points to @thedukeofawesome and @bkgeek and @heibeg :sparkles: :thumbsup: :sparkles:
:star: 190 | @heibeg | http://www.freecodecamp.com/heibeg
:star: 213 | @thedukeofawesome | http://www.freecodecamp.com/thedukeofawesome
:star: 181 | @bkgeek | http://www.freecodecamp.com/bkgeek
Jordan Robertson
@Jordanson
Oct 13 2015 01:51
help bonfire Factorialize a Number
CamperBot
@camperbot
Oct 13 2015 01:51

:point_right: bonfire factorialize a number [wiki]

The problem

Return the factorial of the provided integer. If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.

Factorials are often represented with the shorthand notation n!

For example: 5! = 1 * 2 * 3 * 4 * 5 = 120f

:pencil: read more about bonfire factorialize a number on the FCC Wiki

Rex Schrader
@SaintPeter
Oct 13 2015 01:51
@TheDukeOfAwesome BTW, in a run-time interperited language like Javascript, you can define your functions in any order you darn well please and it call them from anywhere in scope. Javascript does a first pass that does all of the variable declarations (which it moves to the tops of eahc function) and all of the function definitons before running.
@Jordanson Still chugging on that one? Got a loop going yet?
Jordan Robertson
@Jordanson
Oct 13 2015 01:53
I went to codeacademy for clarification on things. i hope to pick up on recursion before i return to the bonfires. but i looked at the solution for that one and I'm still lost in the sauce @SaintPeter
Rex Schrader
@SaintPeter
Oct 13 2015 01:54
@Jordanson Haha - I'd actually advise AGAINST learning recursion. It's . . . non-trivial and even bends my brain. You can solve factorialize itteratively anyway.
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:54
@SaintPeter I was raised on qbaisc/VB4 so I have some old quarks that are because 20 years ago some of the compilers were a little funky.
Herman Fassett
@HermanFassett
Oct 13 2015 01:54
it bends @SaintPeter brain? Oooh !!
Rex Schrader
@SaintPeter
Oct 13 2015 01:55
@Jordanson Well, yeah, you can learn it eventually, but I strongly advise against trying to write code recursively when you're new to coding. You'll spin off into an infinite loop and have to kill your browser tab. None of the Bonfires require recursion.
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:55
I am with @SaintPeter iteritively solving was the "cheat" i used.
Jordan Robertson
@Jordanson
Oct 13 2015 01:55
gotcha, thanks @SaintPeter can i use a for loop to solve it?
CamperBot
@camperbot
Oct 13 2015 01:55
jordanson sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 994 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 13 2015 01:56
@TheDukeOfAwesome Oh, tell me about it, I learned on C, where what you say is very true. One of the best parts about run-time languages is that you can be a lazy slob and put your stuff anywhere.
@Jordanson You absolutely can!
bruglesco
@bruglesco
Oct 13 2015 01:58
I actually liked the recursive method. But thats just me.
Rex Schrader
@SaintPeter
Oct 13 2015 01:58
@bruglesco It doesn't scale well.
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 01:58
@SaintPeter What's worse is I started programming back when I was 9-10ish and I am almost 31 os the 20 years ago makes me sould much older. But I have been tweaking scripts for 20 years and finally decided to get a cert and rebuild my portfolio after being in corp. america for 12 years and start consulting again.
Rex Schrader
@SaintPeter
Oct 13 2015 01:59
@TheDukeOfAwesome I taugh myself at age 13, mucking around with my BBS software. Pre-internet. I'm in a similar boat as you, but I've got an EE degree and have been dabbling as a hobbyist for years.
Jordan Robertson
@Jordanson
Oct 13 2015 02:01
I'm not discouraged, but hearing of individuals teaching themselves at such young ages has me feeling like I'm at a huge disadvantage lol
Rex Schrader
@SaintPeter
Oct 13 2015 02:02
@Jordanson Oh, mind you, my code was SHIT. Absolute garbage. I wasn't really that good at it. But I kept at it for the next ~30 years and I've gotten a bit better. ;)
Dinnertime!
Jordan Robertson
@Jordanson
Oct 13 2015 02:03
about @SaintPeter
CamperBot
@camperbot
Oct 13 2015 02:03
:star: 994 | @saintpeter | http://www.freecodecamp.com/saintpeter
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 02:03
@Jordanson Some people can't do it that young. Not an insult. My son who is now 10 preferes dance to programming.
Herman Fassett
@HermanFassett
Oct 13 2015 02:04
I frankly had a hard time understanding basic loops much less oop when I started :P
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 02:06
I started learning to progam on the venerable ZMudd for anyone who has google. In fact I have a paid copy somewhere because I needed the database backend in it. Then when I needed more power came VB :-) I still can't program anywhere near as well in Java as I can in VB.
Clei-Anderson
@Clei-Anderson
Oct 13 2015 02:10
you could introduce him to processing :https://processing.org/ . Its a really good programming environment(why i say that because though its main language is java(simplified), it can run in python, android, and javascript mode)
its a program created by designers for designers so even children can create beutiful art in a few lines of code
leemurdock
@leemurdock
Oct 13 2015 02:13
I'm at a loss on Waypoint: Add Font Awesome Icons to our Buttons . I'm pretty reliant on the examples still, can anyone help me?
Rex Schrader
@SaintPeter
Oct 13 2015 02:23
@leedmurdock Sure, lay it on me
leemurdock
@leemurdock
Oct 13 2015 02:26
Thank you so much @SaintPeter but I just figured it out. I'll message you if I run into any more hurdles.
CamperBot
@camperbot
Oct 13 2015 02:26
leedmurdock sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 996 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 13 2015 02:26
@leedmurdock Sure thing! I'm happy to be your Rubber Duck
Herman Fassett
@HermanFassett
Oct 13 2015 02:27
You're almost at 1k @SaintPeter :D
Rex Schrader
@SaintPeter
Oct 13 2015 02:27
I know! I've gotta be extra helpful. No cheating, though. I want to get there honestly.
justg99
@justg99
Oct 13 2015 02:28
@SaintPeter maybe helping me with the Seek and Destroy bonfire could bump you up?
CamperBot
@camperbot
Oct 13 2015 02:28
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Hugo
@hugoender
Oct 13 2015 02:28
@SaintPeter that link is great! lol
Rex Schrader
@SaintPeter
Oct 13 2015 02:28
@justg99 You bettcha - let's hop over to /HelpBonfires
CamperBot
@camperbot
Oct 13 2015 02:28
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Rex Schrader
@SaintPeter
Oct 13 2015 02:28
@justg99 oops
justg99
@justg99
Oct 13 2015 02:28
thanks! @SaintPeter
CamperBot
@camperbot
Oct 13 2015 02:28
justg99 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 997 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 13 2015 02:28
@justg99 no need to hop
@justg99 Got code?
justg99
@justg99
Oct 13 2015 02:29

function destroyer(arr) {
// Remove all the values
return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);

this is what they set up with
Rex Schrader
@SaintPeter
Oct 13 2015 02:29
@justg99 Ahh, ok. So let me lay it out for you:
justg99
@justg99
Oct 13 2015 02:30
@SaintPeter they reccomend using the arguments object which I don't completely understand
Rex Schrader
@SaintPeter
Oct 13 2015 02:30
@justg99
1) You will need to use the arguments object to pull out your extra arguments that will be the numbers to destroy.
2) You will need to inspect each number in the array to see if it matches one or more of those arguments
3) You'll need to store all the numbers that don't match (or filter the ones that do) and return them
@justg99 ok
@justg99 So, the arguments object is an "array like object", in as that it has numbered keys for each argument, like this:
{  1: "first Argument",
   2: "Second Argument",
  // and so on
}
@justg99 You can convert it to an actual array. Details here:
wiki js arguments
CamperBot
@camperbot
Oct 13 2015 02:32

:point_right: js arguments [wiki]

The arguments object is an array-like object (meaning that it looks like an array but it's not) that stores all of the arguments that you passed to a function and is proprietary to that function in particular. If you were to pass 3 arguments to a function, say storeNames(), those 3 arguments would be stored inside an object called arguments and it would look like this when we pass the arguments storeNames("Mulder", "Scully", "Alex Krycek") to our function:

  • First, we declare a function and make it return the arguments object.

    function storeNames() { return arguments; }
  • Then, when we execute that function with n arguments, 3 in this case, it will return the object to us and it will look like an array. We can convert it to an array, but more on that later...

    // If we execute the following line in the console:
    storeNames("Mulder", "Scully", "Alex Kryceck");
    // The output will be: ["Mulder", "Scully", "Alex Kryceck"]

If you want to know more about this, such as converting it to an array or the optimization problem that comes with using the slice() method and how to solve it, click on read more (Gitter Chat Only).

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

Rex Schrader
@SaintPeter
Oct 13 2015 02:32
@justg99 Let me know if you need more
justg99
@justg99
Oct 13 2015 02:33
@SaintPeter oh so it's kind of just like a premade object that acts as an array?
Rex Schrader
@SaintPeter
Oct 13 2015 02:33
@justg99 Yeah. The downside is that you can't use the array functions on it.
justg99
@justg99
Oct 13 2015 02:33
I think i get it now. thanks @SaintPeter
CamperBot
@camperbot
Oct 13 2015 02:33
justg99 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: justg99 already gave saintpeter points
Rex Schrader
@SaintPeter
Oct 13 2015 02:34
@justg99 So to do anything more array-like with it, you need to convert it to an array.
Hugo
@hugoender
Oct 13 2015 02:34
@justg99 objects are essentially name-value pair arrays
Rex Schrader
@SaintPeter
Oct 13 2015 02:34
@justg99 Awesome!
Hugo
@hugoender
Oct 13 2015 02:40
Question: what is the simplest way to log the date/time when a user presses a button on the site?
do i need backend knowledge for this or can it be done in javascript?
Rex Schrader
@SaintPeter
Oct 13 2015 02:41
If you want to "Log" it - IE: store it for longer than the time the user is visiting the site, yeah, you kinda have to have a backend
Hugo
@hugoender
Oct 13 2015 02:41
@SaintPeter thats what i feared
hmmm
Rex Schrader
@SaintPeter
Oct 13 2015 02:41
You could muck around with Google Analytics
Hugo
@hugoender
Oct 13 2015 02:41
no i want the user to see the log
or be able to pull it up
and clear it
Rex Schrader
@SaintPeter
Oct 13 2015 02:41
Or maybe there exists a free online DB that has an API?
Hugo
@hugoender
Oct 13 2015 02:41
thats a good suggestion...
let me look into that
SaintPeter @SaintPeter furiously googles
Hugo
@hugoender
Oct 13 2015 02:42
i started learning Ruby on Rails but while i can follow a tutorial…its way over my head. not to mention then i have to host it somewhere lik Heroku
and i think the free heroku accounts are slow to load
James Smith
@matthew02
Oct 13 2015 02:42
@hugoender Cookies or local storage might also work.
Hugo
@hugoender
Oct 13 2015 02:43
@matthew02 cookies are too….temporary i think
@matthew02 i need something that will stay there until the user decides to clear it…if ever
@matthew02 but thank you for the suggestion
CamperBot
@camperbot
Oct 13 2015 02:43
hugoender sends brownie points to @matthew02 :sparkles: :thumbsup: :sparkles:
:star: 338 | @matthew02 | http://www.freecodecamp.com/matthew02
James Smith
@matthew02
Oct 13 2015 02:44
There are persistent cookies.
Hugo
@hugoender
Oct 13 2015 02:44
@matthew02 yeah but the user has to be using the same browser everyt ime right?
it wont follow them from computer to computer or browser to browser
i need it to stay with the site…not the user
James Smith
@matthew02
Oct 13 2015 02:45
Ahh, then you are correct.
Hugo
@hugoender
Oct 13 2015 02:46
hmm this looks like it may be somthing: https://parse.com/plans
Chris
@Shifthawke
Oct 13 2015 02:49
@hugoender Your avatar makes me think of bioshock...
Hugo
@hugoender
Oct 13 2015 02:49
@Shifthawke lol thats my face!
Chris
@Shifthawke
Oct 13 2015 02:49
Lol but yeah the art style lol
Hugo
@hugoender
Oct 13 2015 02:49
@Shifthawke i feel ya
Question 2: is there a backend framework that i can learn quickly and use that?
seems like parse.com will work but if I can make this work AND learn some backend in the process…that would be beneficial
justg99
@justg99
Oct 13 2015 02:51
@SaintPeter this is what i have but it doesn't seem to work

'''
function destroyer(arr) {
var thing = arguments[0]
var arg1 = arguments[1];
var arg2 = arguments[2];

for (i = 0; i < thing.length; i++) {
if (thing[i] == arg1){
thing.splice(i);
} else if (thing[i] == arg2) {
thing.splice(i);
}
}

return thing;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
'''

CamperBot
@camperbot
Oct 13 2015 02:51
:bulb: to format code use backticks! ``` more info
justg99
@justg99
Oct 13 2015 02:52
function destroyer(arr) {
  var thing = arguments[0]
  var arg1 = arguments[1];
  var arg2 = arguments[2];

  for (i = 0; i < thing.length; i++) {
    if (thing[i] == arg1){
      thing.splice(i);
    } else if (thing[i] == arg2) {
      thing.splice(i);
    }
  }

  return thing;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Hugo
@hugoender
Oct 13 2015 02:52
@justg99 Tip: use ===
@justg99 not that that is the solution to your problem but in the future...
Rex Schrader
@SaintPeter
Oct 13 2015 02:53
@justg99 You can't know ahead of time how many arguements you're going to have, so you can't do what you're doing up top. Secondly, I advise against modifying an array via splice when you are itterating through it. The problem becomes that you skip a number, because i is not being decremented even though you removed an item from the array.
justg99
@justg99
Oct 13 2015 02:53
ohhh i see what you mean
Hugo
@hugoender
Oct 13 2015 02:54
@justg99 you may want to loop through the arguments that way you can accept any number of arguments
@justg99 or use indexOf
Chris
@Shifthawke
Oct 13 2015 02:55
On a side note, I'm streaming my attempts at bonfires tomorrow 6pm est, if you guys want to come hang out and give me pointers.
justg99
@justg99
Oct 13 2015 02:55
wiki indexOf
CamperBot
@camperbot
Oct 13 2015 02:55

:point_right: js indexof [wiki]

Array.prototype.indexOf()

The indexOf() method returns the first index at which a given element can be found in the array, or -1 if it is not present.

arr.indexOf(searchElement[, fromIndex = 0])

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

justg99
@justg99
Oct 13 2015 02:56
ok. gotcha thanks @hugoender !
CamperBot
@camperbot
Oct 13 2015 02:56
justg99 sends brownie points to @hugoender :sparkles: :thumbsup: :sparkles:
:star: 261 | @hugoender | http://www.freecodecamp.com/hugoender
Rex Schrader
@SaintPeter
Oct 13 2015 02:56
@Shifthawke Oh, man, I'd come out to watch, but that's the middle of my work day.
Chris
@Shifthawke
Oct 13 2015 02:56
I know some people it is. I'll probably go to midnight. If you drop in, awesome. If not, no hate brah lol.
<3
Rex Schrader
@SaintPeter
Oct 13 2015 02:56
@hugoender Oh, look at you, gettin' all them brownies ;)
Chris
@Shifthawke
Oct 13 2015 02:56
Oh!
Hugo
@hugoender
Oct 13 2015 02:56
@justg99 I take that back… while it is possible to use indexOf (plenty of different ways to solve a problem in programming) its probably best to stick to the filter as they suggest
Chris
@Shifthawke
Oct 13 2015 02:57
I did 7 bonfires last night Peter.
I'm on falsy now.
Rex Schrader
@SaintPeter
Oct 13 2015 02:57
@Shifthawke !!!
Hugo
@hugoender
Oct 13 2015 02:57
@SaintPeter lol pfff… you say that like my brownie count is increasing drastically
Rex Schrader
@SaintPeter
Oct 13 2015 02:57
@Shifthawke :heart:
@Shifthawke Oh man, Falsy is ugly. It's a trick question, you know.
Chris
@Shifthawke
Oct 13 2015 02:57
I know. I'm pumped at the numbers.
Rex Schrader
@SaintPeter
Oct 13 2015 02:57
@Shifthawke Hint: You do not need to use == or ===
Chris
@Shifthawke
Oct 13 2015 02:58
I'm going to study it tonight so I dont stare at the screen for more than five minutes lol. Thanks for the hint, I'll take that lol.
CamperBot
@camperbot
Oct 13 2015 02:58
if you want to thank someone, put an @ before their name!
Rex Schrader
@SaintPeter
Oct 13 2015 02:58
@hugoender That parse thing looks pretty sweet. For your small app I bet it would work well.
Chris
@Shifthawke
Oct 13 2015 02:59
Dude. One bf I did on my own in literally like three minutes. Ok enough of my rantings. I'm just stoked lol. Back to helping.
Hugo
@hugoender
Oct 13 2015 02:59
@justg99 my tip: find a way to assign the arguments to an array and then loop through that arguments array while using filter
Algenis Romero
@algenisromero
Oct 13 2015 02:59
This message was deleted
CamperBot
@camperbot
Oct 13 2015 02:59
no wiki entry for: with im stuck in waypoint make object properties private error message mybikespeed should remain undefined here my code
:pencil: click here to create one now!after creating your page type update to reload it here
Hugo
@hugoender
Oct 13 2015 03:00
@SaintPeter yeah it looks legit. i just wonder if i should take longer and learn one of the three big backend players and use that instead
instead of learning this parse system that will be useless in the future
Algenis Romero
@algenisromero
Oct 13 2015 03:02
This message was deleted
CamperBot
@camperbot
Oct 13 2015 03:02
no wiki entry for: with waypoint make object properties private always this error message mybikespeed should remain undefined var bike function only change code below this line thisspeed 100 function addunitvalue return value kmh thisgetspeed function return addunitthisspeed
:pencil: click here to create one now!after creating your page type update to reload it here
Rex Schrader
@SaintPeter
Oct 13 2015 03:03
about @saintpeter
CamperBot
@camperbot
Oct 13 2015 03:03
:star: 1000 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 13 2015 03:03
Who has two thumbs and 1k points? Dis guy!
DJ
@qualitymanifest
Oct 13 2015 03:03
daaaang :thumbsup:
Carl J. Kashnier
@CarlJKashnier
Oct 13 2015 03:03
@SaintPeter Awesome on hitting 1k
Rex Schrader
@SaintPeter
Oct 13 2015 03:04
Now . . . onward to 2k! I've got to catch up to @dting
Hugo
@hugoender
Oct 13 2015 03:05
@SaintPeter congrats man!
Rex Schrader
@SaintPeter
Oct 13 2015 03:05
So . . can I trade them in for cash or valuable prizes?
Maybe cache and valuable . . . something
Chris
@Shifthawke
Oct 13 2015 03:05
thanks @SaintPeter
CamperBot
@camperbot
Oct 13 2015 03:05
shifthawke sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1001 | @saintpeter | http://www.freecodecamp.com/saintpeter
Chris
@Shifthawke
Oct 13 2015 03:06
1001
SaintPeter @SaintPeter bows
Rex Schrader
@SaintPeter
Oct 13 2015 03:06
You're welcome
Chris
@Shifthawke
Oct 13 2015 03:06
On the way to 2k
Rex Schrader
@SaintPeter
Oct 13 2015 03:06
The journy of 1000 points starts with just one help question
I think it's time to go play some Witcher 3 to celebrate
Algenis Romero
@algenisromero
Oct 13 2015 03:07
Please help with "Waypoint: Make Object Properties Private" always show this error message "myBike.speed should remain undefined." any idea how to solve, here are my code
var Bike = function() {
  // Only change code below this line.
  this.speed = 100;
  function addUnit(value) {
    return value + "KM/H";

  }

 this.getSpeed = function () {
     return addUnit(this.speed);


  };


};
Hugo
@hugoender
Oct 13 2015 03:07
alright who here has decent enough knowledge in backend programming to help me with this little side project im working on? I just need to be able to create a log of dates and times when a user presses a button. That’s it.
I will also require that you show me what you are doing so I can learn as well so that I don’t have to ask you for help again in the future ;)
@algenisromero you cannot use this. outside of the object
@algenisromero you need to create a Bike object like so var myBike = new Bike;
Rex Schrader
@SaintPeter
Oct 13 2015 03:09
@hugoender Well, I can point you to the ClementineJS site
Hugo
@hugoender
Oct 13 2015 03:09
i was there for the twitch stream where they mentioned that
is it really that much easier than the rest?
Matt Leonard
@matty22
Oct 13 2015 03:10
Need help understanding .replace() for the Palindromes bonfire.
CamperBot
@camperbot
Oct 13 2015 03:10
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Rex Schrader
@SaintPeter
Oct 13 2015 03:10
@hugoender The Tutorials are really pretty great.
Hugo
@hugoender
Oct 13 2015 03:10
@SaintPeter alright i guess i can give that a try…how long do you think before i can get something as simple as what I need up and running?
@SaintPeter thanks for the suggestion
CamperBot
@camperbot
Oct 13 2015 03:10
hugoender sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1002 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 13 2015 03:11
@hugoender No idea. I think you should be able to do it in under a day, maybe? It's pretty straightforward.
Matt Leonard
@matty22
Oct 13 2015 03:11
bonfire check for palindromes
CamperBot
@camperbot
Oct 13 2015 03:11

:fire:Bonfire: Check for Palindromes :link:

function palindrome(str) {
  // Good luck!
  return true;
}



palindrome("eye");

Return true if the given string is a palindrome. Otherwise, return false.

more info:  bf details | bf links | hint

Hugo
@hugoender
Oct 13 2015 03:11
@SaintPeter awesome sounds great. will give it a try
Rex Schrader
@SaintPeter
Oct 13 2015 03:11
Algenis Romero
@algenisromero
Oct 13 2015 03:12
@hugoender let me show you the code complete, I created already a new object, please check the code
//Let's create an object with two functions. One attached as a property and one not.
var Car = function() {
  this.gear = 1;
  function addStyle(styleMe){
    return 'The Current Gear Is: ' + styleMe;
  }
  this.getGear = function() {
    return addStyle(this.gear);
  };
};

var Bike = function() {
  // Only change code below this line.
  this.speed = 100;
  function addUnit(value) {
    return value + "KM/H";

  }

 this.getSpeed = function () {
     return addUnit(this.speed);  

  };

};

// Only change code above this line.
var myCar = new Car();
var myBike = new Bike();

if(myBike.hasOwnProperty('getSpeed')){(function() {return JSON.stringify(myBike.getSpeed());})();};
Rex Schrader
@SaintPeter
Oct 13 2015 03:12
@hugoender Gonna add you to /HelpBasejumps - the author hangs out there and is answering questions and looking for feedback on the tuts.
Hugo
@hugoender
Oct 13 2015 03:13
@algenisromero oh okay i understand now
@algenisromero basically, when you add this. in front of an object’s property, you are making it public. When you remove the this. from in front of the property, you make it private
@algenisromero so this waypoint wants you to make the getSpeedmethod public but the speed property private
oh and the addUnit method private as well
@algenisromero let me know if this doesn’t make sense or you need further clarification
@SaintPeter what do you mean you’re going to add me!?
@SaintPeter you have admin rights on these channels or something?
SaintPeter @SaintPeter has titanic universe crushing power
Rex Schrader
@SaintPeter
Oct 13 2015 03:17
Naw
Anyone can add anyone to a public channel. It just shows up on your list once I do
Algenis Romero
@algenisromero
Oct 13 2015 03:17
@hugoender thanks bro! I just remove this in both speed and it worked now.
CamperBot
@camperbot
Oct 13 2015 03:17
algenisromero sends brownie points to @hugoender :sparkles: :thumbsup: :sparkles:
:star: 262 | @hugoender | http://www.freecodecamp.com/hugoender
Hugo
@hugoender
Oct 13 2015 03:19
@algenisromero no problem man
@SaintPeter how do you add someone to a channel?
Rex Schrader
@SaintPeter
Oct 13 2015 03:20
@hugoender click the tool button in the upper right corner and select "add people to this room"
Hugo
@hugoender
Oct 13 2015 03:21
@SaintPeter thats an invasion of my privacy!
SaintPeter @SaintPeter is a Saint, so it's all good.
Rex Schrader
@SaintPeter
Oct 13 2015 03:21
Bless you my child.
Hugo
@hugoender
Oct 13 2015 03:21
alright so tomorrow i will get crackin on this Clementine mumbo jumbo
does celementine need to be hosted on heroku as well?
or what?
Rex Schrader
@SaintPeter
Oct 13 2015 03:22
Yup - for it to be public
Hugo
@hugoender
Oct 13 2015 03:22
or is that part of the tutorial and i should stop asking questions
Rex Schrader
@SaintPeter
Oct 13 2015 03:22
You can test on c9
SaintPeter @SaintPeter shrugs
Rex Schrader
@SaintPeter
Oct 13 2015 03:22
I'm fool enough to answer 'em
Hugo
@hugoender
Oct 13 2015 03:22
oka yeah ive used c9 for ruby on rails tutorial
maybe this will give me excuse to test this DigitalOcean company everyone keeps making a big fuss about
Graham Whitley
@lotusgraham
Oct 13 2015 03:29
hey i’d love a little help with the reverse a string bonfire. I’m using my brower’s built in console and it works on my console, but doesn’t come out right on the FCC console...
CamperBot
@camperbot
Oct 13 2015 03:29
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Graham Whitley
@lotusgraham
Oct 13 2015 03:29

function reverseString(str) {

var str = 'hello';
var arr=str = str.split ('');
var arr=str = str.reverse ('');
var arr=str = str.join ('');

return str;

}

reverseString('hello');

reverse a string bonfire for newbies….
Rex Schrader
@SaintPeter
Oct 13 2015 03:30
@lotusgraham Don't set str = 'hello' - the whole point is that str is passed in whent he function is called.
alex
@alexhudici
Oct 13 2015 03:30
does reverse take a parameter?
Rex Schrader
@SaintPeter
Oct 13 2015 03:31
@alexhudici @lotusgraham Yes it does.
Graham Whitley
@lotusgraham
Oct 13 2015 03:31
ding ding
Rex Schrader
@SaintPeter
Oct 13 2015 03:31
@lotusgraham :D
Graham Whitley
@lotusgraham
Oct 13 2015 03:31
@SaintPeter thanks… still a little unclear about calling and passing
CamperBot
@camperbot
Oct 13 2015 03:31
lotusgraham sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1004 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 13 2015 03:31
@lotusgraham Well, you've got it now
Graham Whitley
@lotusgraham
Oct 13 2015 03:33
yeah but i don’t understand so well about calling and passing… that parameter thing always kinda trips me up.. it just looks like str should be defined somewhere or something.
Hans van Riet
@hansinla
Oct 13 2015 03:33
@lotusgraham look at this as well: var arr=str = str.split ('’);, you’re leaking a var here.
Chris McIntyre
@leamerluck
Oct 13 2015 03:33
I wouldn't use var arr = str = str.split(''). Why not just do var array = str.split('');
then reverse the array, then do var str = "join the array here"?
Nathan Fowler
@nrfowler
Oct 13 2015 03:33
I am at the waypoint "Add borders around your elements" and I have a question. I have added the code thick-green-border apparently correctly, and it even agrees with the code in the next waypoint, yet the compiler says that the border-width is not 10px, even though it is....here is my code:
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
}
Rex Schrader
@SaintPeter
Oct 13 2015 03:34
@lotusgraham It is defined somewhere: function reverseString(str) // <-- right here
Graham Whitley
@lotusgraham
Oct 13 2015 03:35
yeah that doesn’t make sense to me at this point for some reason. i’m just used to seeing evertything that is defined as having “var =“ in front of it...
alex
@alexhudici
Oct 13 2015 03:38
@lotusgraham those are the variables you declare inside your function. When you call a function, it sometimes asks for parameters to be passed in, like str.split('') the parameter is ''. Your reverseString function also takes a parameter, which is defined as 'str', and that is the variable name you can use to see what was passed in, as @SaintPeter pointed out.
@SaintPeter I don't think reverse actually takes any parameters, https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse
Hans van Riet
@hansinla
Oct 13 2015 03:39
@lotusgraham You’re right; you can define a function that way as well:
var reverseString = function(str){
/// do something clever here
};
Jordan Robertson
@Jordanson
Oct 13 2015 03:41
function factorialize(num) {
  var ans = 1;
  for(i = 2; i <= num; i++) {
      ans *= i;  
  }
  return ans;
}

factorialize(5);
Your solution @SaintPeter Can you break down the lines to me? Mainly lines 2 and 4. I don't understand the role of variable "ans"
Graham Whitley
@lotusgraham
Oct 13 2015 03:41
thanks @hansinla @alexhudici
CamperBot
@camperbot
Oct 13 2015 03:41
lotusgraham sends brownie points to @hansinla and @alexhudici :sparkles: :thumbsup: :sparkles:
:star: 527 | @hansinla | http://www.freecodecamp.com/hansinla
:star: 10 | @alexhudici | http://www.freecodecamp.com/alexhudici
Mike G.
@mgraham134
Oct 13 2015 03:43
Anyone here for debugging help?
Rex Schrader
@SaintPeter
Oct 13 2015 03:43
@Jordanson ans = "answer". The idea is that it accumulates the result
@Jordanson I'm looping from 2 to num, and multiplying ans by i.
@Jordanson So: 1 * 2 = 2 * 3 = 6 * 4 = 24 * 5 = 120
Jordan Robertson
@Jordanson
Oct 13 2015 03:45
ans is equal to 1? or am i misinterpreting it?
@SaintPeter
Rex Schrader
@SaintPeter
Oct 13 2015 03:46
@Jordanson It starts there. But look how it's ans *= i - that's the same as saying
ans = ans * i
Jordan Robertson
@Jordanson
Oct 13 2015 03:50
I don't understand. I cannot wrap my head around line 2. It is so frustrating. Is there an outside reference you can direct me to that will be helpful? @SaintPeter
Rex Schrader
@SaintPeter
Oct 13 2015 03:57
@Jordanson Line 2 as in the for loop definition?
@Jordanson Or line 2 where I initialize ans?
Jordan Robertson
@Jordanson
Oct 13 2015 03:58
the latter
@SaintPeter
Rex Schrader
@SaintPeter
Oct 13 2015 03:59
@Jordanson var ans is defining the variable ans. ans = 1 sets it equal to 1 initially. That's it.
Mike G.
@mgraham134
Oct 13 2015 04:01
Hey @SaintPeter do you have a couple of mins?
Rex Schrader
@SaintPeter
Oct 13 2015 04:01
@mgraham134 Shore
Mike G.
@mgraham134
Oct 13 2015 04:02
been dealing with stubborn debugging issues with a rock, paper, scissors game.
Rex Schrader
@SaintPeter
Oct 13 2015 04:03
@mgraham134 ok
Mike G.
@mgraham134
Oct 13 2015 04:03
var compare = function(choice1, choice2) {
if(choice1 === choice2) {
    return "The result is a tie";


} else if(choice1 === "rock") {

    if(choice2 === "scissors") {
        return "rock wins";
    }
    else {
        return "paper wins";
    }}

} else if(choice1 === "paper") {
    if(choice2 === "rock") {
      return "paper wins";
    } else {
        return "scissors wins";
    }
}
Jason
@Jauble
Oct 13 2015 04:04
Hey @SaintPeter. Is there a way to make this work? I'm trying to make it countdown. http://codepen.io/auble220/pen/Lpjbve
Rex Schrader
@SaintPeter
Oct 13 2015 04:04
@mgraham134 You're missing a last else, for scissors (no if needed)
Graham Whitley
@lotusgraham
Oct 13 2015 04:04
would anyone like to pair up with me and help me along with factorialize a number bonfire? i am reading the hints from the hint bot, and it’s making some sense but there is a lot of gaps… mainly should i use a for loop or a while loop? or not either?
CamperBot
@camperbot
Oct 13 2015 04:04
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Rex Schrader
@SaintPeter
Oct 13 2015 04:04
@Jauble Lemme look
OverTheNeptune
@OverTheNeptune
Oct 13 2015 04:04
@Jordanson When factorialize function @SaintPeter posted is first called, the variable ans is declared and assigned an initial value of 1. Each time the for loop iterates, ans will be updated with a new value. That's what's taking place on line 4. ans *= i; is taking the current value of ans, multiplying it by i, and then storing the result back in ans. Hope that helps without further confusing matters. :)
Jason
@Jauble
Oct 13 2015 04:05
When I did it without the button, it showed 2 numbers, but the didn't change
they*
@SaintPeter Thanks
CamperBot
@camperbot
Oct 13 2015 04:05
jauble sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1005 | @saintpeter | http://www.freecodecamp.com/saintpeter
Mike G.
@mgraham134
Oct 13 2015 04:05
@SaintPeter looking into it
Rex Schrader
@SaintPeter
Oct 13 2015 04:06
@Jauble It will change after 1 minute. You're ONLY updating the stuff after sec < 1
@Jauble You need to write to sec and min every time your callback executes
Jordan Robertson
@Jordanson
Oct 13 2015 04:06
yes it does @OverTheNeptune thank you so much for the clarification and as always @SaintPeter for the patience. I will persevere lol
CamperBot
@camperbot
Oct 13 2015 04:06
jordanson sends brownie points to @overtheneptune and @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 219 | @overtheneptune | http://www.freecodecamp.com/overtheneptune
:star: 1006 | @saintpeter | http://www.freecodecamp.com/saintpeter
OverTheNeptune
@OverTheNeptune
Oct 13 2015 04:07
@Jordanson No problem.
Rex Schrader
@SaintPeter
Oct 13 2015 04:07
@Jauble Also, sec starts at . . .0? Humm
Mike G.
@mgraham134
Oct 13 2015 04:08
@SaintPeter adding another statement is the next part after I get the syntax right. I do see an error which is unexpected token else.
OverTheNeptune
@OverTheNeptune
Oct 13 2015 04:08
@lotusgraham I would probably go with a for loop.
@lotusgraham But you could do it with either for or while.
Rex Schrader
@SaintPeter
Oct 13 2015 04:09
@mgraham134 You've got to match up your curley braces
@mgraham134 It looks like you could put an else right after the last curly in the code you pasted.
Mike G.
@mgraham134
Oct 13 2015 04:11
@SaintPeter Its happened before. The curly braces are irritating
Rex Schrader
@SaintPeter
Oct 13 2015 04:12
@mgraham134 Yeah, you have to count properly :D
DTing
@dting
Oct 13 2015 04:12
@SaintPeter congrats!
Rex Schrader
@SaintPeter
Oct 13 2015 04:12
@mgraham134 Look, you have a line with }}
@mgraham134 After paper wins
@dting Thanks :D
CamperBot
@camperbot
Oct 13 2015 04:13
saintpeter sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1378 | @dting | http://www.freecodecamp.com/dting
Mike G.
@mgraham134
Oct 13 2015 04:14
@SaintPeter The code wouldn't pass without two curly braces there. I thought it was strange
Rex Schrader
@SaintPeter
Oct 13 2015 04:14

@Jauble Found the problem:

$(document).ready(function()

missing an opening curly

Jordan Robertson
@Jordanson
Oct 13 2015 04:14
@OverTheNeptune how many solutions do you estimate there are that only pertain to the waypoints completed until that bonfire?
Rex Schrader
@SaintPeter
Oct 13 2015 04:15
@mgraham134 You need one at the very very end to close your function definition
@Jauble This code works:
$(document).ready(function() {   // Added missing curly here
  $('#timerBtn').click(function() {
    setInterval(function() {
      sec--;
      if (sec < 01) {
        sec = 59;
        min--;
      }
      $('#sec').html(sec);  // Note these are outside the if, so it updates once per sec
      $('#min').html(min);
    }, 1000);
  });
});
Mike G.
@mgraham134
Oct 13 2015 04:17
@SaintPeter its extremely stubborn. When I pasted the code into repl theres an error missing ; before statement
Rex Schrader
@SaintPeter
Oct 13 2015 04:18
@mgraham134 You also need a semicolon after the very last }, because you're saying: var thing = function(){}; // <--semicolon there
OverTheNeptune
@OverTheNeptune
Oct 13 2015 04:20
@Jordanson I'm not sure I understand what you're asking. How many solutions to the factorialize bonfire are there that are based on the waypoints up until that point?
Jordan Robertson
@Jordanson
Oct 13 2015 04:24
Si @OverTheNeptune
Jason
@Jauble
Oct 13 2015 04:27
Sweet, got it to work! Thanks @SaintPeter! I just added another $('sec').html(sec) and changed the seconds to 01. I'll take a look at the code you pasted too. Is it better to keep my variables outside of my $(document).ready, or should I move them inside?
CamperBot
@camperbot
Oct 13 2015 04:27
jauble sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: jauble already gave saintpeter points
Mike G.
@mgraham134
Oct 13 2015 04:28
@SaintPeter thanks! its like pulling teeth but finally got that squared away. You're the man! Stay put haha
OverTheNeptune
@OverTheNeptune
Oct 13 2015 04:42
@Jordanson It would be hard to put a number on how many solutions there were. As with most problems, there are a lot of ways to approach it. Using a for loop is a common one, but it could also be done using a while loop, both of which were covered in the waypoints. There are other ways that it could be handled based only on the information found in the waypoints. For example, the code below should pass, so it would be a valid solution if not a particularly efficient one (at least not compared to other options).
function factorialize(num) {
    var rangeOfNumbers = [];
    var ans = 1;

    if(num !== 0) {
        for(var i = 1; i <= num; i++) {
            rangeOfNumbers.push(i);
            }

    ans = rangeOfNumbers.reduce(function(a,b) {
        return a*b;
        });
    }

    return ans;
}

factorialize(5);
Jordan Robertson
@Jordanson
Oct 13 2015 04:48
wow. Ok i understand the solution @SaintPeter used. Your explanation was particularly helpful. Do you think I should explore the other solutions are just continue trekking? maybe figuring out the while solution will be helpful. sometimes i feel like fcc is so ambiguous.
@OverTheNeptune
*or just continue
Jason
@Jauble
Oct 13 2015 04:51
@SaintPeter I checked out your code. It's more efficient and saves me an extra line. I noticed a bug in both of ours. When you click more than once, it speeds up the clock. So I tried $('#timerBtn').one('click', function() { and surprisingly it works. I just learned about .one yesterday or the day before :smile:
OverTheNeptune
@OverTheNeptune
Oct 13 2015 04:56
@Jordanson It might be a good exercise to try it with a while loop at some point just for practice. If you understand the solution @SaintPeter used, then I wouldn't worry too much about exploring other solutions right now. You can always go back and try different solutions as you get a little more experience under your belt.
Jordan Robertson
@Jordanson
Oct 13 2015 04:59
thanks @OverTheNeptune I'm not satisfied with the fcc waypoints but maybe ill think differently after some bonfires. your explanation was exactly what i needed. do you know of a site or any resource that will break things down like that?
CamperBot
@camperbot
Oct 13 2015 04:59
jordanson sends brownie points to @overtheneptune :sparkles: :thumbsup: :sparkles:
:warning: jordanson already gave overtheneptune points
Jordan Robertson
@Jordanson
Oct 13 2015 05:00
about @OverTheNeptune
CamperBot
@camperbot
Oct 13 2015 05:00
:star: 219 | @overtheneptune | http://www.freecodecamp.com/overtheneptune
OverTheNeptune
@OverTheNeptune
Oct 13 2015 05:00
@Jordanson Not off the top of my head.
navicyclical
@navicyclical
Oct 13 2015 05:28

I'm in the confirm the ending bonfire, and this code passes all but one test - the fourth one with name. Can I split the input to an array and use that instead?

```

DTing
@dting
Oct 13 2015 05:28
@Jordanson i have a git repo that has some notes on the solutions for the basic bonfires
you can see them here https://github.com/dting/fccbonfires if you are interested
navicyclical
@navicyclical
Oct 13 2015 05:29
function end(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
var stringToCheck = str.substr(str.length-1);
var checkWithString = target;
if (stringToCheck == checkWithString){
return true;
}
else{
return false;
}
}
end("Bastian", "n");
DTing
@dting
Oct 13 2015 05:30
you are only checking if the last character is = to target
you need to use a different number for the str.substr function call argument
the check is if "str" ends with the string "target" so your code works as long as the target is a single character
but fails if the target string is more than 1 character long
navicyclical
@navicyclical
Oct 13 2015 05:35
@dting I also added the substr method to the target with one character to match and it worked
@camperbot how do I give brownie points?
DTing
@dting
Oct 13 2015 05:36
wiki brownie
CamperBot
@camperbot
Oct 13 2015 05:36

: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

DTing
@dting
Oct 13 2015 05:36
that passes the tests
navicyclical
@navicyclical
Oct 13 2015 05:36
thanks @dting
CamperBot
@camperbot
Oct 13 2015 05:36
navicyclical sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1380 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Oct 13 2015 05:36
but that doesn't really solve the problem
the method that you passed the tests with only checks if the last letter is the same still
ronald
@ronstarcool
Oct 13 2015 05:37
hi, is there a way to share admin-rights in a group-chat? we can not find the option
DTing
@dting
Oct 13 2015 05:37
so end("Bastian", "in"); would return true when it should return false with your code
Michael Kebe
@michaelkebe
Oct 13 2015 05:40
@dting The posted code of @navicyclical:
@dting The posted code of @navicyclical:```
navicyclical
@navicyclical
Oct 13 2015 05:41
@dting my other thought was to split the checked string into an array and access the last value
DTing
@dting
Oct 13 2015 05:42
you can use substr
Michael Kebe
@michaelkebe
Oct 13 2015 05:42

@dting The posted code of @navicyclical end("Bastian", "in") returns false.

stringToCheck is the last character of str, but checkWithString is just target.

DTing
@dting
Oct 13 2015 05:42
but you need to change the number you call substr with
@michaelkebe he explained in a following chat comment that he is calling substr on the target to get the last character
start
Location at which to begin extracting characters. If a negative number is given, it is treated as strLength + start where strLength is the length of the string (for example, if start is -3 it is treated as strLength - 3.)
the part about the negative number is especially relevant for this problem
Michael Kebe
@michaelkebe
Oct 13 2015 05:44
@dting you have to get the ending portion of strwith the length of target.
DTing
@dting
Oct 13 2015 05:44
yes
Jordan Robertson
@Jordanson
Oct 13 2015 05:45
Thanks @dting
CamperBot
@camperbot
Oct 13 2015 05:45
jordanson sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1381 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Oct 13 2015 05:46
np
Michael Kebe
@michaelkebe
Oct 13 2015 05:46
What is the textbox "Your pair's username if pairing" for?
DTing
@dting
Oct 13 2015 05:46
if you pair programmed with some one you can type their fcc name in there and they will receive credit for that challenge as well
Michael Kebe
@michaelkebe
Oct 13 2015 05:47
IC
thx @dting
CamperBot
@camperbot
Oct 13 2015 05:47
michaelkebe sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1383 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Oct 13 2015 05:52
nps
Vivek
@vivek28111992
Oct 13 2015 05:56

//Let's create an object with two functions. One attached as a property and one not.
var Car = function() {
this.gear = 1;
function addStyle(styleMe){
return 'The Current Gear Is: ' + styleMe;
}
this.getGear = function() {
return addStyle(this.gear);
};
};

var Bike = function() {
// Only change code below this line.

this.speed = 100;
function addUnit(value) {
return value + "KM/H";
}

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

};

// Only change code above this line.
var myCar = new Car();
var myBike = new Bike();

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

how to solve this?
Jason
@Jauble
Oct 13 2015 06:03
Hey @dting Do you know how would I say: if (button is clicked) { ?
DTing
@dting
Oct 13 2015 06:04
you usually attach an event handler to the button that fires a function when the button is clicked
Avishay
@avishayshushan
Oct 13 2015 06:05
@Jauble hey,
you can do it by using js event listener
Chris
@Shifthawke
Oct 13 2015 06:09
Question. How many lines can I solve falsy bouncer in?
Jason
@Jauble
Oct 13 2015 06:10
@dting You mean like onclick="someFunction" ?
@avishayshushan Thanks I'll check that out
CamperBot
@camperbot
Oct 13 2015 06:10
jauble sends brownie points to @avishayshushan :sparkles: :thumbsup: :sparkles:
:star: 297 | @avishayshushan | http://www.freecodecamp.com/avishayshushan
DTing
@dting
Oct 13 2015 06:14
@Shifthawke 1 line
Chris
@Shifthawke
Oct 13 2015 06:14
Ty. I was wondering if so
Kouty
@koouty
Oct 13 2015 06:14
Zipline: Build a Personal Portfolio Webpage
I don't understand nothing! the tutorial of javascript coding is very clear and easy to understang. But the basic front end development project is completely unclear. There is no step by step guideline and the world of front end is unknow for me. Help!
DTing
@dting
Oct 13 2015 06:15
@navyvel there isn't a step by step guide for the ziplines. You are going to have to take the stuff you learned from before and look up a lot of things to get those done
Chris
@Shifthawke
Oct 13 2015 06:15
What does it mean undefined is not a function?
DTing
@dting
Oct 13 2015 06:15
what's your code
Chris
@Shifthawke
Oct 13 2015 06:16
function bouncer(arr) {
var arr;
   return arr.filter();
}

bouncer([7, "ate", "", false, 9], "");
DTing
@dting
Oct 13 2015 06:17
that var arr; inside your function declares a variable arr in the local scope that is undefined and shadows the arr variable that is the function parameter
Chris
@Shifthawke
Oct 13 2015 06:17
I just sat down to do it. The links they gave don't really help me much.
I should just delete that right?
DTing
@dting
Oct 13 2015 06:18
ya
Chris
@Shifthawke
Oct 13 2015 06:18
I'm still getting undefined is not a function.
DTing
@dting
Oct 13 2015 06:19
you need a callback function
for filter
arr.filter expects to be called with a callback function. since you dont call it with an argument it calls undefined and tells you it isn't a function
Kouty
@koouty
Oct 13 2015 06:20
@dting You mind that the html and css previously and JQuery soon at begining the course are suffisant informations to properly design the Portfolio Webpage?
DTing
@dting
Oct 13 2015 06:20
@navyvel probably not a very good one
Chris
@Shifthawke
Oct 13 2015 06:20
Ah. Ok. I will have to look up a callback function.
Rahul Rana
@rahulrana95
Oct 13 2015 06:20
hi
DTing
@dting
Oct 13 2015 06:20
has examples
Dean Whittaker
@deanhtid
Oct 13 2015 06:20
Can anyone help, im struggling

var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
function myFunction(){
// Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".

// Only change code below this line.

var heads;
var tails;

if (flip = 0) {
return heads;
} else {
return tails;
}

// Only change code above this line.
}

// We use this function to show you the value of your variable in your output box.
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);}

Vivek
@vivek28111992
Oct 13 2015 06:20
waypoint: Make Object Properties Private. Please tell me solution of this
DTing
@dting
Oct 13 2015 06:20
@navyvel you can always go back and change it later when you learn more
Chris
@Shifthawke
Oct 13 2015 06:20
Ty dting. <3
thanks @dting
CamperBot
@camperbot
Oct 13 2015 06:21
shifthawke sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1385 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Oct 13 2015 06:21
@deanhtid you need to return the string "heads" and "tails"
Rahul Rana
@rahulrana95
Oct 13 2015 06:21
@deanhtid you can return a string by "" heads and tails
DTing
@dting
Oct 13 2015 06:21
also the conditional for the if statement at the moment is an assignemnt
not a comparison
Vivek
@vivek28111992
Oct 13 2015 06:21
if (flip === 0) {
return "heads";
} else {
return "tails";
}
Dean Whittaker
@deanhtid
Oct 13 2015 06:22
ah thats great guys, thanks, been on 20 mins =-/
CamperBot
@camperbot
Oct 13 2015 06:22
if you want to thank someone, put an @ before their name!
DTing
@dting
Oct 13 2015 06:22
@vivek28111992 public properties are declared in the constructor function using the this keyword. if you want something as a private variable, you can declare it with var someVariableName
Kouty
@koouty
Oct 13 2015 06:23
@dting If you know a Tutorial or bibliographic reference or specific forum, I'm intrested!
Dean Whittaker
@deanhtid
Oct 13 2015 06:23
thanks @dting @vivek28111992
CamperBot
@camperbot
Oct 13 2015 06:23
deanhtid sends brownie points to @dting and @vivek28111992 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for vivek28111992
:star: 1386 | @dting | http://www.freecodecamp.com/dting
Dean Whittaker
@deanhtid
Oct 13 2015 06:23
thanks @rahulrana95
CamperBot
@camperbot
Oct 13 2015 06:23
deanhtid sends brownie points to @rahulrana95 :sparkles: :thumbsup: :sparkles:
:star: 197 | @rahulrana95 | http://www.freecodecamp.com/rahulrana95
DTing
@dting
Oct 13 2015 06:24
wiki js res
DTing
@dting
Oct 13 2015 06:25
I have read through eloquent javascript but thats not super front end related. im not really sure what a good resource is for getting started with front end dev.
I'm all for reading books, but I tend to jump into things and mess around to get my feet wet. Then look up resources when i get stuck.
Chris
@Shifthawke
Oct 13 2015 06:28
Ok so obviously this doesn't work. But I'm getting unexpected token ;
function bouncer(arr) {
var arr=[false, null, 0, "", undefined, NaN];
 var arr=arr.filter(function(val);
   return val;
}

bouncer([7, "ate", "", false, 9], "");
h4r1m4u
@h4r1m4u
Oct 13 2015 06:28
@Shifthawke you're missing a closing bracket on the 3rd line
Chris
@Shifthawke
Oct 13 2015 06:29
a )?
DTing
@dting
Oct 13 2015 06:29
delete var arr=[false, null, 0, "", undefined, NaN];
Kouty
@koouty
Oct 13 2015 06:29
@dting You say
'I tend to jump into things and mess around to get my feet wet. Then look up resources when i get stuck."
Verry good!
Chris
@Shifthawke
Oct 13 2015 06:29
I put it in as I thought, and I get an error.
Michael Kebe
@michaelkebe
Oct 13 2015 06:29
function bouncer(arr) {
var arr=[false, null, 0, "", undefined, NaN];
 var arr=arr.filter(function(val) {
   return val;
 });
}
DTing
@dting
Oct 13 2015 06:29
you are shadowing the arr parameter with that. meaning the arr you call your function with will not be used
also you would need to return something from your bouncer function
the result of filtering the array
because the tests are checking for the return value
and what @michaelkebe about closing your filter call with a ) after the }
Chris
@Shifthawke
Oct 13 2015 06:32
I did that and I'm still getting errors.
DTing
@dting
Oct 13 2015 06:32
what's your code look like now?
Chris
@Shifthawke
Oct 13 2015 06:32
I've only been doing js for about 2 weeks. Most of these terms and what not are still really new to me.
sad lol
it looks sad
function bouncer(arr) {

 var filteredArr=arr.filter(function(val){

   return filteredArr;
});
}
bouncer([7, "ate", "", false, 9], "");
I'm kinda taking wild guesses now lol.
Vivek
@vivek28111992
Oct 13 2015 06:33
@dting Can you provide me complete solution please?
DTing
@dting
Oct 13 2015 06:33
you were very close before
Michael Kebe
@michaelkebe
Oct 13 2015 06:33
@Shifthawke no syntax error now
DTing
@dting
Oct 13 2015 06:33
 var arr=arr.filter(function(val) {
   return val;
 });
you would need to return arr after you have filtered it
Chris
@Shifthawke
Oct 13 2015 06:34
huh I tried that...
DTing
@dting
Oct 13 2015 06:34
or directly return the result of the function call instead of assigning it to the variable arr
var arr=arr.filter(function(val) {
  return val;
});
return arr;
Chris
@Shifthawke
Oct 13 2015 06:35
It was the second return
DTing
@dting
Oct 13 2015 06:35
var Bike = function() {
  // Only change code below this line.
  var speed = 100;
  function addUnit(value) {
    return value + "KM/H";
  }  
  this.getSpeed = function () {
    return addUnit(speed);
  };

};
Chris
@Shifthawke
Oct 13 2015 06:35
Thank you. I did the above code before. But I didn't have the second arr. Thanks @dting @michaelkebe
CamperBot
@camperbot
Oct 13 2015 06:35
shifthawke sends brownie points to @dting and @michaelkebe :sparkles: :thumbsup: :sparkles:
:warning: shifthawke already gave dting points
:star: 208 | @michaelkebe | http://www.freecodecamp.com/michaelkebe
DTing
@dting
Oct 13 2015 06:36
@Shifthawke shadowing the named parameter within the function might lead to confusion in more complex functions.
Chris
@Shifthawke
Oct 13 2015 06:37
Is that what I did in that code?
DTing
@dting
Oct 13 2015 06:37
you would probably just write that as:
return arr.filter(function(val) {
  return val;
});
or use a different variable name
var filteredArray = arr.filter(function(val) {
  return val;
});
return filteredArray;
Chris
@Shifthawke
Oct 13 2015 06:37
I try to make my variable names unique. One I used 'squishy kitten' lol
Jason
@Jauble
Oct 13 2015 06:37
@dting Do you know how I would break out of the setInterval function when I click the reset button? http://codepen.io/auble220/pen/avyZZE
Chris
@Shifthawke
Oct 13 2015 06:37
I used filteredArr at one point too lol
DTing
@dting
Oct 13 2015 06:38
@Jauble you would declare a variable to store the object returned by calling setInterval
var something = setInterval(...);
...
clearInterval(something);
since you are calling setInterval inside a callback function for your eventhandler. you would probably create the "something" outside the scope of the callback.
var something;
$('start').click(function() {
   something = setInterval(...);
});

$('stop').click(function() {
  clearInterval(something);
});
Chris
@Shifthawke
Oct 13 2015 06:42
Seek and destroy. The web page says not to use slice. Do we use slice in this one?
It mentions slice then says not to use it...
Jason
@Jauble
Oct 13 2015 06:42
@dting Thanks I'll try that. Didn't know there was a clearInterval function
CamperBot
@camperbot
Oct 13 2015 06:42
jauble sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1387 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Oct 13 2015 06:43
bf seek
CamperBot
@camperbot
Oct 13 2015 06:43

:fire:Bonfire: Seek and Destroy :link:

function destroyer(arr) {
  // Remove all the values
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);

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

more info:  bf details | bf links | hint

DTing
@dting
Oct 13 2015 06:43
bf details
CamperBot
@camperbot
Oct 13 2015 06:43

:fire:Bonfire: Seek and Destroy :link:

function destroyer(arr) {
  // Remove all the values
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
DTing
@dting
Oct 13 2015 06:44
i used filter to solve that one
Chris
@Shifthawke
Oct 13 2015 06:45
Good I was hoping to avoid the object
Question. Can you filter by word or groupings of numbers?
Julia Jasmine Sta Romana
@JuliaStaRomana
Oct 13 2015 06:49
Hi guys! I'm a little stuck on constructor functions, can you help me?
Chris
@Shifthawke
Oct 13 2015 06:50
I suppose I should ask, what is it specifically looking for us to do? I thought it wanted us to remove repeats, and then incrimentals. But now I don't know what it's specifically asking us to do. I'm very tired but want to do this bonfire.
DTing
@dting
Oct 13 2015 06:51
the function is called with an array and then a variable number of arguments after the array that it wants you to remove from the array at the first argument
remove all the numbers that follow the array from the array
Chris
@Shifthawke
Oct 13 2015 06:52
Oh ok. ty. Hmmm
well I got it to return an empty arr lol.
that is important to solving that problem
Oleg Cherkasky
@gunrunners-paradise
Oct 13 2015 06:56
Hey, can I get some advice on setting up the calculator zipline?
Jason
@Jauble
Oct 13 2015 07:07
@gunrunners-paradise Sorry haven't gotten there yet
Oleg Cherkasky
@gunrunners-paradise
Oct 13 2015 07:08
I can't get it to work
Any advice?
Jason
@Jauble
Oct 13 2015 07:16
@dting Can you tell what I'm doing wrong here with the reset? http://codepen.io/auble220/pen/avyZZE
Oleg Cherkasky
@gunrunners-paradise
Oct 13 2015 07:18
@Jauble The myTimer variable only exists within the function, set it up outside
Jason
@Jauble
Oct 13 2015 07:25
@gunrunners-paradise If I set it up outside it starts running when the page loads
Oleg Cherkasky
@gunrunners-paradise
Oct 13 2015 07:27
@Jauble don't put anything in the variable
Jason
@Jauble
Oct 13 2015 07:30
@gunrunners-paradise Oh, so just declare the variable outside?
Avishay
@avishayshushan
Oct 13 2015 07:31
@gunrunners-paradise what your calc function should do?
Oleg Cherkasky
@gunrunners-paradise
Oct 13 2015 07:31
@Jauble yes
Avishay
@avishayshushan
Oct 13 2015 07:32
it seems like it just change the output to 0 every time you push an operator
Jason
@Jauble
Oct 13 2015 07:32
@gunrunners-paradise Got it thanks
CamperBot
@camperbot
Oct 13 2015 07:32
jauble sends brownie points to @gunrunners-paradise :sparkles: :thumbsup: :sparkles:
:star: 202 | @gunrunners-paradise | http://www.freecodecamp.com/gunrunners-paradise
Oleg Cherkasky
@gunrunners-paradise
Oct 13 2015 07:33
@avishayshushan that's right
Avishay
@avishayshushan
Oct 13 2015 07:35
@gunrunners-paradise is it something you want to happen?
Oleg Cherkasky
@gunrunners-paradise
Oct 13 2015 07:36
@avishayshushan yes, the problem is that I can't get it to calculate the numbers properly.
I need to go, will come back later.
Jason
@Jauble
Oct 13 2015 07:38
@gunrunners-paradise I'm using .one on the start button click event, because if I don't, there's a bug that speeds up the clock each time you push it, so I can't start it again after I reset. Do you know if there's a way to get it to start? Or do you know how to make it toggle start and stop?
Avishay
@avishayshushan
Oct 13 2015 07:41
@Jauble you can disable the start button after the first click and enable it when user pause or whatever you choose
kangyao
@kay78
Oct 13 2015 07:43
http://codepen.io/kay78/pen/Lpyxyo?editors=101
Need help on above assignment, when i get json instead of jsonp from the url, the result won't show, i tried to google about it but still can't figure it out
must we only used jsonp over json data when using $.getJSON()?
vere perrot
@perrot
Oct 13 2015 07:45
Hi friends,
I get an error in the unit "Waypoint: Get Set for Basejumps" and "Check box 11.".
After I command "rm -rf * && echo "export NODE_PATH=$NODE_PATH:/home/ubuntu/.nvm/v0.10.35/lib/node_modules" >> ~/.bashrc && source ~/.bashrc && npm install -g yo grunt grunt-cli generator-angular-fullstack && yo angular-fullstack" in my cloud9 terminal, than get this error message:
events.js:72
        throw er; // Unhandled 'error' event
              ^
TypeError: Object [object Object] has no method 'isAbsolute'
    at Generator.processDirectory (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/generator-angular-fullstack/util.js:110:19)
    at Generator.generateProject (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/generator-angular-fullstack/app/generator.js:399:14)
    at /home/ubuntu/.nvm/v0.10.35/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/lib/base.js:429:16
    at processImmediate [as _immediateCallback] (timers.js:354:15)
Avishay
@avishayshushan
Oct 13 2015 07:45
@Jauble document.getElementById("start").disabled = true;
Jason
@Jauble
Oct 13 2015 07:53
@gunrunners-paradise Thanks, didn't know about .disabled. It still doesn't start when I enable it though
CamperBot
@camperbot
Oct 13 2015 07:53
jauble sends brownie points to @gunrunners-paradise :sparkles: :thumbsup: :sparkles:
:warning: jauble already gave gunrunners-paradise points
Jason
@Jauble
Oct 13 2015 07:53
@gunrunners-paradise Do you know how I would make it toggle start and stop so I don't have to use .one?
Oops I meant @avishayshushan not @gunrunners-paradise
Jason
@Jauble
Oct 13 2015 07:58
@avishayshushan Thanks, didn't know about .disabled. It still doesn't start when I enable it though. Do you know how I would make it toggle start and stop so I don't have to use .one?
CamperBot
@camperbot
Oct 13 2015 07:58
jauble sends brownie points to @avishayshushan :sparkles: :thumbsup: :sparkles:
:star: 298 | @avishayshushan | http://www.freecodecamp.com/avishayshushan
Edper
@edper
Oct 13 2015 08:33
@Shifthawke both bouncer and seek & destroy use filter and on seek & destroy this could also give you a clue on how to deal with arguments.
Avishay
@avishayshushan
Oct 13 2015 08:41
Ali-Haider5
@Ali-Haider5
Oct 13 2015 09:12
bonfire find the logest word
CamperBot
@camperbot
Oct 13 2015 09:12
Sorry, can't find a bonfire called find the logest word. [ Check the map? ]
Ali-Haider5
@Ali-Haider5
Oct 13 2015 09:12
Bonfire: Find the Longest Word in a String
CamperBot
@camperbot
Oct 13 2015 09:12

:fire:Bonfire: Find the Longest Word in a String :link:

function findLongestWord(str) {
  return str.length;
}

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

Return the length of the longest word in the provided sentence.

more info:  bf details | bf links | hint

Ali-Haider5
@Ali-Haider5
Oct 13 2015 09:12
hint
CamperBot
@camperbot
Oct 13 2015 09:12
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
thomas-duval
@thomas-duval
Oct 13 2015 09:21

Hey guys, I am trying to understand the details of the JS slot machine.
If I understood correctly, this part checks if the numbers are differents :

if(slotOne !== slotTwo || slotTwo !== slotThree){

And this one checks if the 3 numbers match:

if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){

If I'm not mistaken, the undefined property only check if it has a value, not if it match another variable.
I would have used something along the line of :

if(slotOne == slotTwo && slotTwo == slotThree){

What did I miss ?

Travis
@TravisHi
Oct 13 2015 09:37
!== means "does not equal"
thomas-duval
@thomas-duval
Oct 13 2015 09:45
Yes, so it checks that each slotnumber (1, 2 & 3) has a value (i.e. does not equal undefined), correct ?
David Bouwkamp
@DavidBouw
Oct 13 2015 09:54
@thomasduval The function is appraoching from the opposite direction of what you've described in your own solution. Both would work I presume. With this in mind, the purpose for the two statements is to prevent a false positive with matching undefined slots. The !== slotTwo || etc checks if there is any mismatch across the 3 slots THEN it checks to make sure the supposed match isn't all undefined value.
thomas-duval
@thomas-duval
Oct 13 2015 10:01
I didn't understand the logic behind the first one and the || operator.
Thanks @BrainDrainBahrain
CamperBot
@camperbot
Oct 13 2015 10:01
thomasduval sends brownie points to @braindrainbahrain :sparkles: :thumbsup: :sparkles:
:star: 203 | @braindrainbahrain | http://www.freecodecamp.com/braindrainbahrain
Jose E. Pimentel
@jedpimentel
Oct 13 2015 10:23
@neoage can you copy/paste your code so I can try to fiddle with it?
help code format
CamperBot
@camperbot
Oct 13 2015 10:23

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Jose E. Pimentel
@jedpimentel
Oct 13 2015 10:25
@neoage it seems you need another closing div after the last checkbox
specifically, to close the div with class "row"
neoage
@neoage
Oct 13 2015 10:27
cool thnaks
Mandeep Singh
@MandeepMann
Oct 13 2015 10:32
@bschaden Thank you
CamperBot
@camperbot
Oct 13 2015 10:32
mandeepmann sends brownie points to @bschaden :sparkles: :thumbsup: :sparkles:
:star: 219 | @bschaden | http://www.freecodecamp.com/bschaden
Ngaosathe
@ThekhoN
Oct 13 2015 10:33
Can some one review my code for "Bonfire: Diff Two Arrays"
function diff(a,b) {
  var unique = [];

 //get non repeating arrays of both 
  var nonR_a = a.filter(function(e,i,arr){
    return a.indexOf(e) == i;
  });
  var nonR_b = b.filter(function(e,i,arr){
    return b.indexOf(e) == i;
  });

  //compare and get uniques in each
  var unique_a = nonR_a.filter(function(e,i,arr){
    return nonR_b.indexOf(e) == -1;
  });
  var unique_b = nonR_b.filter(function(e,i,arr){
    return nonR_a.indexOf(e) == -1;
  });

  unique = unique.concat(unique_a, unique_b);

  return unique;
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Jose E. Pimentel
@jedpimentel
Oct 13 2015 10:35
Bonfire: Diff Two Arrays
CamperBot
@camperbot
Oct 13 2015 10:35

:fire:Bonfire: Diff Two Arrays :link:

function diff(arr1, arr2) {
  var newArr = [];
  // Same, same; but different.
  return newArr;
}

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

Compare two arrays and return a new array with any items not found in both of the original arrays.

more info:  bf details | bf links | hint

Travis
@TravisHi
Oct 13 2015 10:37
@neoage we need to see all your code
neoage
@neoage
Oct 13 2015 10:37
@jedpimentel
Jose E. Pimentel
@jedpimentel
Oct 13 2015 10:39
@neoage we'll probably need to be able to copy/paste the code into our own browsers in order to debug it, ctrl+a ctrl+c should copy everything
neoage
@neoage
Oct 13 2015 10:40

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

<style>
h2 {
font-family: Lobster, Monospace;
}

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

</style>

<div class="container-fluid">
<div class="row">
<div class="col-xs-8">
<h2 class="text-primary text-center">CatPhotoApp</h2>
</div>
<div class="col-xs-4">
<a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
</div>
</div>
<img src="http://bit.ly/fcc-running-cats" class="img-responsive">
<div class="row">
<div class="col-xs-4">
<button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button>
</div>
</div>
<p>Things cats <span class="text-danger">love:</span></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>
<form action="/submit-cat-photo">
<div class="row">
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
</div>
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
</div>
</div>

<div class="row">
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Loving</label> </div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Lazy</label> </div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Crazy</label> </div>
</div>
<div class="col-xs-4">
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</div>
</form>

Aleksandar B.
@aleksandar-b
Oct 13 2015 10:40
Selection_012.png
I am having trouble with Waypoint: Save your revision forever with Git.
Here is the problem: when I type git-it verify in the first lesson it throws an error.
Jose E. Pimentel
@jedpimentel
Oct 13 2015 10:40
help code format
CamperBot
@camperbot
Oct 13 2015 10:40

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Edper
@edper
Oct 13 2015 10:41
@ThekhoN what is the output of your code?
neoage
@neoage
Oct 13 2015 10:42
This message was deleted
CamperBot
@camperbot
Oct 13 2015 10:42
:bulb: to format code use backticks! ``` more info
neoage
@neoage
Oct 13 2015 10:43

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

<style>
h2 {
font-family: Lobster, Monospace;
}

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

</style>

<div class="container-fluid">
<div class="row">
<div class="col-xs-8">
<h2 class="text-primary text-center">CatPhotoApp</h2>
</div>
<div class="col-xs-4">
<a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
</div>
</div>
<img src="http://bit.ly/fcc-running-cats" class="img-responsive">
<div class="row">
<div class="col-xs-4">
<button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button>
</div>
</div>
<p>Things cats <span class="text-danger">love:</span></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>
<form action="/submit-cat-photo">
<div class="row">
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
</div>
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
</div>
</div>

<div class="row">
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Loving</label> </div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Lazy</label> </div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Crazy</label> </div>
</div>
<div class="col-xs-4">
<input type="text" placeholder="cat photo URL" required> </div>
<div class="col-xs-4"> <button type="submit">Submit</button>
</div>
</form>
'''

CamperBot
@camperbot
Oct 13 2015 10:43
:bulb: to format code use backticks! ``` more info
neoage
@neoage
Oct 13 2015 10:44
@camperbot is this ok
im really very new to all this
Ngaosathe
@ThekhoN
Oct 13 2015 10:45
@edper my code works and it has been approved . i was wondering if it could be further optimized.
Aleksandar B.
@aleksandar-b
Oct 13 2015 10:46
@neoage you don't have closing </div> for <div class="container-fluid">
put </div> in the bottom of the page, bellow </form>
neoage
@neoage
Oct 13 2015 10:47
@samosale thank you :)
CamperBot
@camperbot
Oct 13 2015 10:47
neoage sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 334 | @samosale | http://www.freecodecamp.com/samosale
Jose E. Pimentel
@jedpimentel
Oct 13 2015 10:48
@ThekhoN something like (val, index, arr) instead of (e, i, arr) would help readability a bit, but the argument seems solid. In case your interested this was my solution
function isNotInArr(value, arr) {
  for(var key in arr) {
    if(arr[key] === value) {
      return false;
    }
  }
  return true;
}

function diff(arr1, arr2) {
  var newArr = [];
  var key;
  for(key in arr1) {
    if(isNotInArr(arr1[key], arr2)) {
      newArr.push(arr1[key]);
    }
  }
  for(key in arr2) {
    if(isNotInArr(arr2[key], arr1)) {
      newArr.push(arr2[key]);
    }
  }
  return newArr;
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
gregorysl
@gregorysl
Oct 13 2015 10:51
Hi, could somebody tell me why in function updateTimer after changing variable sessionName it doesn't change in view? http://codepen.io/gregorysl/pen/bVqEEm?editors=001
Edper
@edper
Oct 13 2015 10:57
@ThekhoN that is very nicely done already
Ngaosathe
@ThekhoN
Oct 13 2015 10:58
@jedpimentel thanks..i had read somewhere that using "for in " loops on non-object(key:value pair objects) is considered a bad practice. :/
CamperBot
@camperbot
Oct 13 2015 10:58
thekhon sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 356 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
Ngaosathe
@ThekhoN
Oct 13 2015 10:59
@edper ok
Edper
@edper
Oct 13 2015 10:59
Mine is not that readable but get the works done.
Kanishk
@kanishk2112
Oct 13 2015 10:59
could someone please help me with this - Bonfire: Title Case a Sentence. Here's my code
CamperBot
@camperbot
Oct 13 2015 10:59
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Kanishk
@kanishk2112
Oct 13 2015 11:00
function titleCase(str) {
  str = str.split(' ');
  for(i=0; i<str.length; i++) {
    str[i].charAt(0) = str[i].charAt(0).toUpperCase();
  }
  str = str.join(' ');
  return str;
}

titleCase("I'm a little tea pot");
Edper
@edper
Oct 13 2015 11:00
function diff(arr1, arr2) {
  return ( arr1.length == 0 ? arr2 : ( arr2.length==0 ? arr1 : (arr1.concat(arr2).filter(function(val,idx,a){
     return ((a.indexOf(val) == a.lastIndexOf(val) || ((arr1.indexOf(val) != arr1.lastIndexOf(val)) & arr2.indexOf(val)==-1) || ((arr2.indexOf(val) != arr2.lastIndexOf(val)) && arr1.indexOf(val)==-1) ));
  })) ) );
}
Jose E. Pimentel
@jedpimentel
Oct 13 2015 11:01
@ThekhoN, yes, I understand the issues it can cause. I've been only using "for in" on arrays where the order is unimportant, considering officially there is no set order in which they would be processed. I'll probably get out of that habit once I'm more ocmfortable to standard methods,
@kanishk2112 strings can't be "edited", instead of trying to modify the first letter of each element of the str array, you wold have to create a new string and use that to replace the old string
Ananth
@AnanthKrishna1993
Oct 13 2015 11:04
Hi guys, I'm trying to run the below code but it's not showing mw any output

<script>$(document).ready(function() {});</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>

Jose E. Pimentel
@jedpimentel
Oct 13 2015 11:05
@kanishk2112 .charAt() only returns a value, but doesn't behave as a variable
Kanishk
@kanishk2112
Oct 13 2015 11:05
ohh... lemme try. thanks @jedpimentel
CamperBot
@camperbot
Oct 13 2015 11:05
kanishk2112 sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 357 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
Ngaosathe
@ThekhoN
Oct 13 2015 11:05
thanks guys..@edper your code is kinda hard to read but yeah if you're working alone and u understand it, why not. :)
CamperBot
@camperbot
Oct 13 2015 11:05
if you want to thank someone, put an @ before their name!
Edper
@edper
Oct 13 2015 11:08
@kanishk2112 you are almost there.
@kanishk2112 you cannot store a value on this line str[i].charAt(0) = str[i].charAt(0).toUpperCase();. But you can store it str[i] = str[i].charAt(0).toUpperCase()+ after the plus sign you need to add the rest of the string.
And before that you need to convert everything first to lowercase.
Or you could lower case in the same line.
Kanishk
@kanishk2112
Oct 13 2015 11:16
thanks @edper check this code.... how do i optimize it?
CamperBot
@camperbot
Oct 13 2015 11:16
kanishk2112 sends brownie points to @edper :sparkles: :thumbsup: :sparkles:
:star: 70 | @edper | http://www.freecodecamp.com/edper
Kanishk
@kanishk2112
Oct 13 2015 11:16
function titleCase(str) {
  str = str.toLowerCase().split(' ');
  for(i=0; i<str.length; i++) {
    str[i] = str[i].charAt(0).toUpperCase()+str[i].replace(str[i].charAt(0),'');
  }
  str = str.join(' ');
  return str;
}

titleCase("I'm a little tea pot");
Edper
@edper
Oct 13 2015 11:20
@kanishk2112 use substr instead of replace and convert it to lowercase using toLowerCase().
Kanishk
@kanishk2112
Oct 13 2015 11:24
str[i].substr(1, str[i].length()).toLowerCase();
like this?
Rakesh
@rrpatil7279
Oct 13 2015 11:25
Capture.PNG
any pointers for above issue?
Aleksander Gębicki
@Takumar
Oct 13 2015 11:27
@kanishk2112 when you want entire string except first letter you can place only from which character you would like to start, you don't have to write second parameter: str[i].substr(1);
Kanishk
@kanishk2112
Oct 13 2015 11:27
@rrpatil7279 try using that link which is mentioned there in the last line... that could be an issue... otherwise everything else looks jst fine
ohh ok... dint know that. thanks @Takumar
CamperBot
@camperbot
Oct 13 2015 11:27
:warning: kanishk2112 already gave takumar points
kanishk2112 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
Aleksander Gębicki
@Takumar
Oct 13 2015 11:28
@rrpatil7279 like @kanishk2112 said you have wrong link. Paste there link from your instruction.
Rakesh
@rrpatil7279
Oct 13 2015 11:29
Oops... It worked with link in instructions. :smile: Thanks @kanishk2112 @Takumar
CamperBot
@camperbot
Oct 13 2015 11:29
rrpatil7279 sends brownie points to @kanishk2112 and @takumar :sparkles: :thumbsup: :sparkles:
:star: 186 | @kanishk2112 | http://www.freecodecamp.com/kanishk2112
:star: 447 | @takumar | http://www.freecodecamp.com/takumar
Edper
@edper
Oct 13 2015 11:30
use substr after the plus sign str[i] = str[i].charAt(0).toUpperCase()+
Kanishk
@kanishk2112
Oct 13 2015 11:31
yeah it worked.. thanks @Edper :)
CamperBot
@camperbot
Oct 13 2015 11:31
kanishk2112 sends brownie points to @edper :sparkles: :thumbsup: :sparkles:
:warning: kanishk2112 already gave edper points
Edper
@edper
Oct 13 2015 11:32
You're welcome and on to the next challenge @kanishk2112 . Happy coding and GOD bless.
Kanishk
@kanishk2112
Oct 13 2015 11:33
thanks :)
CamperBot
@camperbot
Oct 13 2015 11:33
if you want to thank someone, put an @ before their name!
Travis
@TravisHi
Oct 13 2015 11:35
Hey guys, any idea how I'd filter out a particular data type from an array?
Edper
@edper
Oct 13 2015 11:36
@TravisHi what are you working on?
Travis
@TravisHi
Oct 13 2015 11:36
just an algorithm problem
Aleksander Gębicki
@Takumar
Oct 13 2015 11:36
@TravisHi maybe use typeof?
Travis
@TravisHi
Oct 13 2015 11:37
so if arr[i] === typeof ?
Aleksander Gębicki
@Takumar
Oct 13 2015 11:37
Create function: if (typeof var === yourType) return false;
Edper
@edper
Oct 13 2015 11:37
arr.filter(function(val) { return typeof(val)==="boolean";});
Aleksander Gębicki
@Takumar
Oct 13 2015 11:37
I think that should work.
Travis
@TravisHi
Oct 13 2015 11:38
cool thanks @Takumar and @edper I'll try with those
CamperBot
@camperbot
Oct 13 2015 11:38
travishi sends brownie points to @takumar and @edper :sparkles: :thumbsup: :sparkles:
:star: 448 | @takumar | http://www.freecodecamp.com/takumar
:star: 71 | @edper | http://www.freecodecamp.com/edper
Travis
@TravisHi
Oct 13 2015 11:47
@Takumar it's saying string is not defined
Aleksander Gębicki
@Takumar
Oct 13 2015 11:48
@TravisHi hmm, typeof("abc") === string not working ?
Travis
@TravisHi
Oct 13 2015 11:50
No dice
Aleksander Gębicki
@Takumar
Oct 13 2015 11:50
sorry, compare with 'string'
if (typeof("abc") === 'string') ...
Travis
@TravisHi
Oct 13 2015 11:51
yes!
theres some progress
Aleksander Gębicki
@Takumar
Oct 13 2015 11:52
@edper showed you example with quotation marks, I have forgotten about that.
Edper
@edper
Oct 13 2015 11:58
:smile:
You need Grit and Grind @TravisHi to deliver the cheese ;-)
Travis
@TravisHi
Oct 13 2015 11:59
Keep on hacking!
I don't understand it now, but I will eventually
Edper
@edper
Oct 13 2015 12:01
Yes, you will my friend! GOD willing.
But did it worked now? Are you working on a challenge or just playing around with some algo?
Travis
@TravisHi
Oct 13 2015 12:02
just playing around
I can't work this one out yet even with you guys help
I still don't understand algorithms yet
and how to tell the machine what I want it to do
Richard Vankoningsveld
@richyvk
Oct 13 2015 12:10
help condense arrays with reduce
CamperBot
@camperbot
Oct 13 2015 12:10

:point_right: waypoint condense arrays with reduce [wiki]

Reduce can be useful for condensing an array or numbers into one value.

var array = [4,5,6,7,8];
var singleVal = 0;
// Only change code below this line.

var singleVal = array.reduce(function(previousVal, currentVal){

  return previousVal+currentVal;

});

:pencil: read more about waypoint condense arrays with reduce on the FCC Wiki

Avishay
@avishayshushan
Oct 13 2015 12:54
hello all,
need some help on my calculator app
i want one handler for all the possible number clicks
so if the user will click a number the executed function will be the same
http://codepen.io/avishayshushan/pen/WQjPRV/?editors=101
Nana Owusu
@nanaowusunyamekye
Oct 13 2015 13:14
Help!! Please i need help with this. Not understanding a bunch.
CamperBot
@camperbot
Oct 13 2015 13:14
no wiki entry for: please i need help with this not understanding a bunch
:pencil: click here to create one now!after creating your page type update to reload it here
Aleksander Gębicki
@Takumar
Oct 13 2015 13:21
@nanaowusunyamekye but what is "this"? Describe your problem and maybe someone can help you.
azaleas
@azaleas
Oct 13 2015 13:25
@avishayshushan you can use each function to get it done..Give your numbers ids from 0-9, then create an array in js with same values. this way each will iterate through your buttons and check which one was clicked.
@nanaowusunyamekye are you having problems with "this" statement in js? if not, then as @Takumar mentioned, try to be more specific please
Michael Bomholt
@bomholtm
Oct 13 2015 13:28
hey some people with a good understanding of git here? im trying to change a allready pushed commit message... and im stuck at closing and saving with nano correctly
if i want to exit the file and save it
i get a lot of options
like mac format dos format append prepent and stufff
M-D Toggle the use of DOS format
M-M Toggle the use of Mac format
M-A Toggle appending
M-P Toggle prepending
M-B Toggle backing up of the original file
Aleksandar B.
@aleksandar-b
Oct 13 2015 13:35
what is document.body.scrollHeight property and what is the difference beetwen that and innerHeight?
http://codepen.io/samosale/pen/yYoGqx?editors=101
Ryder Timberlake
@SherSpock
Oct 13 2015 13:46
Don't know answers to any questions I see pending. I've got a really simple one. I'm doing a Waypoint about using nth-child in jQuery. The way I see it, line 10 of the code I'm about to post should be selecting the 2nd child of each element with the class of well and making it bounce. Instead it is making the well's themselves bounce. Here's the explanation text: "Here's how you would give the third element in each well bounce: $(".target:nth-child(3)").addClass("animated bounce");" Any thoughts?

<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#target1").parent().css("background-color", "red");
$("#right-well").children().css("color", "green");
$(".well:nth-child(2)").addClass("animated bounce");

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

(oof and I'd love to know how not to barf that code)
Rich
@RichinSA
Oct 13 2015 13:47
Thanks @kirah1314 @Rafase282 @jsommamtek
CamperBot
@camperbot
Oct 13 2015 13:47
richinsa sends brownie points to @kirah1314 and @rafase282 and @jsommamtek :sparkles: :thumbsup: :sparkles:
:star: 276 | @kirah1314 | http://www.freecodecamp.com/kirah1314
:star: 212 | @jsommamtek | http://www.freecodecamp.com/jsommamtek
:star: 530 | @rafase282 | http://www.freecodecamp.com/rafase282
André Duarte
@clint74
Oct 13 2015 13:49
help Make Instances of Objects with a Constructor Function
CamperBot
@camperbot
Oct 13 2015 13:49

:point_right: waypoint make instances of objects with a constructor function [wiki]

A function that creates objects is called a constructor_, my favorite way of creating objects when you have to create more than one of the same object. You can also edit the second object to add more properties if needed. This is called creating _instances of an object.

Each new instance of this object inherits all the properties and methods of your original object.

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

// New instance of Car object.
var myCar = new Car();

//Add the property "engines" to myCar, and make it a number.
myCar.engines = 1;

:pencil: read more about waypoint make instances of objects with a constructor function on the FCC Wiki

Ryder Timberlake
@SherSpock
Oct 13 2015 13:53
Found the answer for mine, cheers
Ryder Timberlake
@SherSpock
Oct 13 2015 13:58
Yo @clint74 did that explanation make sense to you?
André Duarte
@clint74
Oct 13 2015 14:01
@SherSpock I was expecting a hint and it came with a solution… :smile:
Ryder Timberlake
@SherSpock
Oct 13 2015 14:01
lol awesome
Why does clicking home scroll a bit down?
Ryder Timberlake
@SherSpock
Oct 13 2015 14:09
@michaelkebe I'd guess because your home link is not quite at the top-most limit of the page. No other ideas off top of my head
Jason Wood
@catapixel
Oct 13 2015 14:09
@michaelkebe Because it is "scrolling" down to take you to the local link. The behavior ignores the presence of the navigation bar
if you don't want to see this happen just set a top margin on the home container the height of your navigation
André Duarte
@clint74
Oct 13 2015 14:09
@michaelkebe it is going to #home anchor
Ryder Timberlake
@SherSpock
Oct 13 2015 14:10
@michaelkebe potato potahto. I agree with everything that's been said so far!
and @catapixel's solution should fix it
Chris
@Shifthawke
Oct 13 2015 14:13
@edper Thanks. Sorry I dozed off last night.
CamperBot
@camperbot
Oct 13 2015 14:13
shifthawke sends brownie points to @edper :sparkles: :thumbsup: :sparkles:
:star: 74 | @edper | http://www.freecodecamp.com/edper
Dayne Wright
@daynewright
Oct 13 2015 14:18
@michaelkebe Also, (someone can correct me if I am wrong, but) you don’t need the <a> links and the extra div classes. I updated it here: http://codepen.io/daynewr/pen/meMvmp
Michael Kebe
@michaelkebe
Oct 13 2015 14:24
@Daynewr @SherSpock @clint74 @catapixel Thanks!
CamperBot
@camperbot
Oct 13 2015 14:24
michaelkebe sends brownie points to @daynewr and @sherspock and @clint74 and @catapixel :sparkles: :thumbsup: :sparkles:
:star: 95 | @sherspock | http://www.freecodecamp.com/sherspock
:star: 446 | @catapixel | http://www.freecodecamp.com/catapixel
:star: 292 | @daynewr | http://www.freecodecamp.com/daynewr
:star: 255 | @clint74 | http://www.freecodecamp.com/clint74
Ryder Timberlake
@SherSpock
Oct 13 2015 14:28
@michaelkebe Np! Let us know if for some reason it stays broke
Daniel Robinson
@danielrob
Oct 13 2015 14:28
Hi all, do you know what the submission of project urls is for?
Does someone actually review them?
Aleksander Gębicki
@Takumar
Oct 13 2015 14:32
@danielrob you mean this projects from codepen? Someone can look at them and search for problems or good parts and review if he like.
Daniel Robinson
@danielrob
Oct 13 2015 14:33
@Takumar Ok, so does it just go on our FreeCodeCamp profile sort of thing?
Aleksander Gębicki
@Takumar
Oct 13 2015 14:34
This project @Daynewr has just posted is zipline from FCC projects, so it is on your Map of exercises.
Karolis
@Luomint
Oct 13 2015 14:35
hmm a curious problem, does anyone have any ideas why my two variables "left" and "right" both return merged results with one another?
function smallestCommons(arr) {
 var marr = [];  
 var m = 0; 
 var left = [];
 var right = []; 
 function multiple(n){ 
   for(var i = 0; i < 10; i++){
    marr.push(m += n) 
   }
   return marr;
 } 
 var left = multiple(arr[0]);
 var right = multiple(arr[1]);

  return left 
}
smallestCommons([1,5]);
edit: still wondering
Aleksander Gębicki
@Takumar
Oct 13 2015 14:43
@Luomint you operate in your multiple() function on the same m variable and same marr array. that may cause problems.
Tyler Moeller
@TylerMoeller
Oct 13 2015 14:43
@Luomint When you run var left = multiple(arr[0]) it doesn't wait to go through the loop before running var right = multiple(arr[1]). Both Left and Right are calling the function and modifying marr[].
What @Takumar said
Karolis
@Luomint
Oct 13 2015 14:44
ah yes, @Takumar @TylerMoeller thanks
CamperBot
@camperbot
Oct 13 2015 14:44
luomint sends brownie points to @takumar and @tylermoeller :sparkles: :thumbsup: :sparkles:
:star: 236 | @tylermoeller | http://www.freecodecamp.com/tylermoeller
:star: 451 | @takumar | http://www.freecodecamp.com/takumar
Chris
@Shifthawke
Oct 13 2015 14:49
I have a question directly linked to js but not related to fcc...ish...
Which one is faster to read? js for cats, or eloquent js?
I have some time until my stream tonight and want to read one.
Aleksandar B.
@aleksandar-b
Oct 13 2015 14:58
@Shifthawke what stream are you watching?
Chris
@Shifthawke
Oct 13 2015 14:59
I will be streaming on FCC twitch tonight.
Jose E. Pimentel
@jedpimentel
Oct 13 2015 15:24
@Shifthawke JS for cats is a much faster read (if it's related to learning, it is on-topic :p)
Chris
@Shifthawke
Oct 13 2015 15:25
I can do the reading if it's quick enough lol. Thankfully there are no tsunami place holders here
Henry Erickson
@henryed86
Oct 13 2015 15:54
@Shifthawke reading eloquent JS will teach you from the most simple to the most complex JS subjects.
Aleksandar B.
@aleksandar-b
Oct 13 2015 16:03
@henryed86 I am just reading eloquen JS, and I agree with you
givepizza @henryed86
it's not working
Clayton
@cjg040103
Oct 13 2015 16:05
Is @SaintPeter here? I need help. Same problem.
bf mutations
CamperBot
@camperbot
Oct 13 2015 16:05

:fire:Bonfire: Mutations :link:

function mutation(arr) {
  return arr;
}

mutation(['hello', 'hey']);

Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array.

more info:  bf details | bf links | hint

Clayton
@cjg040103
Oct 13 2015 16:06
function mutation(arr) {
  var word1 = arr[0].toUpperCase();
  var word2 = arr[1].toUpperCase();
  var word1Split = word1.split('');
  var word2Split = word2.split('');
  var word1Length = word1.length;
  var word2Length = word2.length;
  for(var i = 0; i < word2Length; i++) {
    var indexOf = word1Split.indexOf(word2Split [i]);
    if(indexOf === -1) {
      return false;
    } else if (indexOf === word2Length) {
      return true;
    } else {
      return false;
    }
  }
}
mutation(["alien", "line"], "");
GarretteLarsen
@GarretteLarsen
Oct 13 2015 16:08
Im on html css Waypoint: Change the Color of text and it wont change?????
Clayton
@cjg040103
Oct 13 2015 16:08
What is your code so far?
I think I can help.
GarretteLarsen
@GarretteLarsen
Oct 13 2015 16:09
Nevermind I messed up
Clayton
@cjg040103
Oct 13 2015 16:09
:wink2:
Aleksandar B.
@aleksandar-b
Oct 13 2015 16:11
@cjg040103 you need to remove part from else if to the bottom and put return true outside of for loop
Clayton
@cjg040103
Oct 13 2015 16:11
You are doing problems that are child's-play. The one I'm on, I have been stuck on it for 1 1/2 months! @GarretteLarsen
? @samosale
Aleksandar B.
@aleksandar-b
Oct 13 2015 16:12
@cjg040103 I have modified your code. Should I send a link?
Clayton
@cjg040103
Oct 13 2015 16:12
Yes please.
Clayton
@cjg040103
Oct 13 2015 16:13
...
THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU!
CamperBot
@camperbot
Oct 13 2015 16:14
if you want to thank someone, put an @ before their name!
Clayton
@cjg040103
Oct 13 2015 16:14
@samosale THANK YOU!
CamperBot
@camperbot
Oct 13 2015 16:14
cjg040103 sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 337 | @samosale | http://www.freecodecamp.com/samosale
Clayton
@cjg040103
Oct 13 2015 16:14
I
have
been
stuck
on
that
problem
for
1 1/2
MONTHS!
:exclamation:
Aleksandar B.
@aleksandar-b
Oct 13 2015 16:16
@cjg040103 no problemo. Do you understand the code now? You don't need so much else statements. Just set to return true by default, and in for loop search for -1. If true return false, that will break the function from executing further
Ariel
@ArielLeslie
Oct 13 2015 16:16
@cjg040103 You got it?
Clayton
@cjg040103
Oct 13 2015 16:17
Yes. Thank you. :D
CamperBot
@camperbot
Oct 13 2015 16:17
if you want to thank someone, put an @ before their name!
Ariel
@ArielLeslie
Oct 13 2015 16:17
@cjg040103 Good job!
Clayton
@cjg040103
Oct 13 2015 16:18
Way to ruin the moment @camperbot
@ArielLeslie :D
Ariel
@ArielLeslie
Oct 13 2015 16:18
@cjg040103 If you want to, you can actually make your code simpler and shorter.
(because I'm sure you will miss this BF so much)
Clayton
@cjg040103
Oct 13 2015 16:19
@ArielLeslie HAH! As if!
Ariel
@ArielLeslie
Oct 13 2015 16:19
;)
function mutation(arr) {
  arr[0] = arr[0].toLowerCase();
  arr[1] = arr[1].toLowerCase();
  for (i = 0; i < arr[1].length; i++){
    if(arr[0].indexOf(arr[1].charAt(i)) < 0){
      return false;
    }
  }
  return true;
}
Clayton
@cjg040103
Oct 13 2015 16:23
I'm confused on how to use the .filter function.
tva10
@tva10
Oct 13 2015 16:25
here is one example
function isBigEnough(value) {
  return value >= 10;
}
var filtered = [12, 5, 8, 130, 44].filter(isBigEnough);
// filtered -> [12, 130, 44]
@cjg040103 filter function run callBack function for each element of array. If function returns false value, filter removes that element
Clayton
@cjg040103
Oct 13 2015 16:27
OH! Okay. Thanks a bunch @tva10!
CamperBot
@camperbot
Oct 13 2015 16:27
cjg040103 sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 311 | @tva10 | http://www.freecodecamp.com/tva10
Clayton
@cjg040103
Oct 13 2015 16:37
Does anyone know what I need to do to fix this?
function bouncer(arr) {
  function values() {
    var value = "";
    var value2 = false;
    var value3 = null;
    var value4 = 0;
    var value5 = undefined;
    var value6 = NaN;
    return value;
    return value2;
    return value3;
    return value4;
    return value5;
    return value6;
  }
  var filtered = arr.filter(values);
  return filtered;
}

bouncer([7, "ate", "", false, 9]);
Never mind. I'll figure it out later.
Ariel
@ArielLeslie
Oct 13 2015 16:42
@cjg040103 You can only ever return once.
So your code just returns "" and exits
Aleksandar B.
@aleksandar-b
Oct 13 2015 16:52
@cjg040103 as @ArielLeslie is saying when you type return statement it stops function from executing further. So, all code bellow your first return return value; is unreacheable. Use repl.it when you write code for bonfires.
tva10
@tva10
Oct 13 2015 16:59
@cjg040103 so this function breaks after first return
Jose E. Pimentel
@jedpimentel
Oct 13 2015 17:00
@cjg040103 you're actually pretty close to a solution, you can use a switch statement inside the values() function, to handle the logic. However, please consider that the values() function would need to take an input, and compare that input with the cases. there are a couple other ways, but the switch statement is closest to the code you already have
Dennis
@ydennisy
Oct 13 2015 17:01
hello all!
Jose E. Pimentel
@jedpimentel
Oct 13 2015 17:02
hey @ydennisy
Dennis
@ydennisy
Oct 13 2015 17:03
I need a hand with variable scope!
Jose E. Pimentel
@jedpimentel
Oct 13 2015 17:03
anything specific?
Dennis
@ydennisy
Oct 13 2015 17:04
yeah will paste in now
$(document).ready(function() {

    console.log('DOM ready');
    // focus on first input
    $("#userCity").focus();

    // init css and js
    $('select').material_select();

    $("#search").on("click", runApp);

    var searchLatLong;
    var ukCities = ["52.1,-1.02","52.2,-1.08"];
    console.log(searchLatLong);


    // collect user inputs
    var userCity = $("#userCity").val();
    var userPoi = $("#userPoi").val();
    var userCountry = $("#userCountry").val();

    // generate the API url to call
    var url = "https://xxxxx.com"+
                  "?client_id=xxx"+
                  "&client_secret=xxxxxxxxxx"+
                  "&ll="+searchLatLong+
                  "&query="+userPoi;

      // Ajax call made to FS API
      function makeAjaxCall () {



          $.ajax({
                url: url,
                dataType: "JSON",
                error: function () {
                    console.log("error");
                },
                success: function (){}

                    $("#yourSelection").append("<h3>Results for "+userPoi+" in "+userCity+"</h3>");
                }
        });
    }

    // begin app
    function runApp () {
        for (var i = 0; i < ukCities.length; i++) {
            document.searchLatLong = ukCities[i];
            console.log(searchLatLong);
            console.log(url);
            makeAjaxCall();
        };
    };
});
when the loop runs the variable "url" is not updated
and the api call is made incorreclty
I am logging the correct value within the function
Jose E. Pimentel
@jedpimentel
Oct 13 2015 17:08
so, you're interested in the URL for all UK cities?
Dennis
@ydennisy
Oct 13 2015 17:09
yeah
loop through the array and make all the individual calls
Jose E. Pimentel
@jedpimentel
Oct 13 2015 17:12
as-is, the "url" value is only calculated once, when the doc is ready. You would have to edit runApp() to include code that'll update the "url" value
Daniel Apple
@snapplefact187
Oct 13 2015 17:13
Hey guys, can some help me with one quick thing; how do i nest my text input element within a form element.
Dennis
@ydennisy
Oct 13 2015 17:14
@jedpimentel where do I build the var url
can you show me the structure?
Jose E. Pimentel
@jedpimentel
Oct 13 2015 17:20
@ydennisy you could try wrapping it into a function, such as updateURL(), or a simple url() function. it's okay to do url="something" inside the runApp() function, it would update the correct var
Dennis
@ydennisy
Oct 13 2015 17:22
i have tried running inside the runApp() but then the other function cannot access the URL
Ariel
@ArielLeslie
Oct 13 2015 17:24
@snapplefact187 nesting means: <outside element>...<nested element>....</nested element>...</outside element>
Jose E. Pimentel
@jedpimentel
Oct 13 2015 17:24
you could also either repeat the code, or wrap it into its own function
Daniel Apple
@snapplefact187
Oct 13 2015 17:29
Screen Shot 2015-10-13 at 10.27.33 AM.png
@ArielLeslie
Ariel
@ArielLeslie
Oct 13 2015 17:30
@snapplefact187 Your code does not have nesting. Nesting means an element inside another element.
Jeff Garrett
@jeffjg
Oct 13 2015 17:43
var saveToArray = function () {
    var userInput = [];
    $('td.btn').click(function() {
        if (!isNaN(this.innerHTML)) {
            userInput[0] += this.innerHTML;
            console.log(userInput[0]);
        }
    });
};

saveToArray();
Can anyone explain why my console.log is returning 'undefinied[number]' here?
I'm trying to make a basic calculator from scratch and I want it to log the first string of numbers into an array index (I haven't built in the function to tell it to stop logging in the first index position yet)
Rex Schrader
@SaintPeter
Oct 13 2015 17:45
@jeffjg Because when you initialize userInput = [], it has no value. Everything inside is undefined. Then later you do userInput[0] += this.innerHTML . += is the same as userInput[0] = userInput[0] + this.innerHTML;
@jeffjg If userInput[0] is undefined (which it is), you're adding a number to an undefined, which is . . undefined.
@jeffjg Also: Use parseInt(this.innerHTML,10) to ensure you get a number. Either that, or don't store data in HTML. It's not a good practice.
Jeff Garrett
@jeffjg
Oct 13 2015 17:47
oooh ok. So is there a way to set the array to be ready to take numbers and strings? The numbers will be the digits the user wants to perform mathematical operations to, and the strings will be for the mathematical operations (x - + /)
What should it be stored as instead of HTML?
Rex Schrader
@SaintPeter
Oct 13 2015 17:47
@jeffjg I suggest you store your number in a data attribute, like data-value="1". It can then be read with $(this).data('value')
Jeff Garrett
@jeffjg
Oct 13 2015 17:48
ok, thanks. I'll do some googlging about data-values
CamperBot
@camperbot
Oct 13 2015 17:48
if you want to thank someone, put an @ before their name!
Rex Schrader
@SaintPeter
Oct 13 2015 17:48
@jeffjg That way you separate your display from your value
@jeffjg No,
@jeffjg There is no value called "data-value" - they're data atrributes. They take the format of "data-someNameHere"
Jeff Garrett
@jeffjg
Oct 13 2015 17:48
I see
Rex Schrader
@SaintPeter
Oct 13 2015 17:48
@jeffjg Then they are availibe via .data('someNameHere')
Jeff Garrett
@jeffjg
Oct 13 2015 17:49
Ok great. Thanks for your help @SaintPeter
CamperBot
@camperbot
Oct 13 2015 17:49
jeffjg sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1007 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 13 2015 17:49
@jeffjg They're basically just a special case of an HTML attribute. Anything with the data- prefix gets put into the element data. Sure thing, glad to help. :D
@jeffjg BTW, this will be very helpful for your operators, because you can't test for a square-root symbol
MD MOJIBUL HOQUE
@Mojibul
Oct 13 2015 17:51
How to solve it " zipline-build-a-personal-portfolio-webpage " . I need directions ...
How to start ...
Ariel
@ArielLeslie
Oct 13 2015 17:52
Fork the pen that the instructions tell you to. Look at the example portfolio. Work on making the forked pen look like the example.
Rex Schrader
@SaintPeter
Oct 13 2015 17:53
@Mojibul Decide what you want your site to look like. Make a sketch or a drawing. Possibly find a template for you to start from.
@Mojibul Build your structure in HTML, style it with CSS
@Mojibul Choose colors and shapes that please you :D
MD MOJIBUL HOQUE
@Mojibul
Oct 13 2015 17:55
My task is reverse engineering of given site and site is http://codepen.io/ThiagoFerreir4/full/eNMxEp
I think it's very critical . I need step by step guide .
to complete my task.
mchouse
@housewar
Oct 13 2015 17:57
@Mojibul there is no step-by-step guide. I believe the challenge is supposed to be difficult and force you to search for solutions and ask for help.
Rex Schrader
@SaintPeter
Oct 13 2015 17:58
@Mojibul If you truly need a step by step guide and cannot proceed without one then you will not be able to work as a programmer/web designer. This is a fundamental, if somewhat daunting, skill. There are plenty of templates you can find online that you could use as a starting point.
mchouse
@housewar
Oct 13 2015 17:58
@Mojibul I recommend you import bootstrap, or fork the bootstrap template they give you.
Rex Schrader
@SaintPeter
Oct 13 2015 17:58
@Mojibul Clearly you can see that the sample website is made up of smaller parts. Can you identify one part and recreate it?
MD MOJIBUL HOQUE
@Mojibul
Oct 13 2015 18:00
Thanks @SaintPeter . You are right . First i need a try first .
CamperBot
@camperbot
Oct 13 2015 18:00
mojibul sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1008 | @saintpeter | http://www.freecodecamp.com/saintpeter
mchouse
@housewar
Oct 13 2015 18:00
@Mojibul Start with the navigation bar. Use http://getbootstrap.com/components/ to help you with how to setup a navigation bar and change the headings.
MD MOJIBUL HOQUE
@Mojibul
Oct 13 2015 18:02
Thanks @housewar I start with navigation bar.
CamperBot
@camperbot
Oct 13 2015 18:02
mojibul sends brownie points to @housewar :sparkles: :thumbsup: :sparkles:
:star: 259 | @housewar | http://www.freecodecamp.com/housewar
Jason Wood
@catapixel
Oct 13 2015 18:02
@SaintPeter see you broke 1000 brownie points. Well done!
Rex Schrader
@SaintPeter
Oct 13 2015 18:02
@Mojibul Don't be afraid to cut and paste some code to start with and then modify it until it looks like what you want.
SaintPeter @SaintPeter bows
mchouse
@housewar
Oct 13 2015 18:02
@Mojibul thanks
Rex Schrader
@SaintPeter
Oct 13 2015 18:02
@catapixel I dropped them on the floor. They broke. I'm sorry.
CamperBot
@camperbot
Oct 13 2015 18:02
housewar sends brownie points to @mojibul :sparkles: :thumbsup: :sparkles:
:star: 221 | @mojibul | http://www.freecodecamp.com/mojibul
Jason Wood
@catapixel
Oct 13 2015 18:03
@SaintPeter that's sad. now you won't be able to cash them in for bitcoins
Rex Schrader
@SaintPeter
Oct 13 2015 18:04
@catapixel LOL, if only. Honestly, I'm feeling a bit let down now. Yay! 1000 . . now what? Guess I better finish my Basejumps :D
Jason Wood
@catapixel
Oct 13 2015 18:05
@SaintPeter now you have to catch up to @dting :wink2:
Rex Schrader
@SaintPeter
Oct 13 2015 18:05
@catapixel I know, right? Like that's even possible . . .
DTing
@dting
Oct 13 2015 18:05
football season has started