These are chat archives for FreeCodeCamp/Help

27th
Aug 2015
Reggie
@Reggie01
Aug 27 2015 00:00

@gitmihalis you can go to http://repl.it/languages/javascript and type the following and run

"eye".replace("\"", ""); // you should not see any difference

then try typing the following and press run

"ey\e".replace("\"", "") ; // you should notice a difference
Jill Stellman
@techrev
Aug 27 2015 00:02
OK, so I'm on the first zipline and I'd really like to find actual documentation for Bootstrap - not just a bunch of examples. That's not really helpful for me. According to the github project's readme, there's supposed to be documentation on the getbootstrap site, but I'm not seeing anything that looks like real documentation - just some tutorial-type stuff. It's fine, but how do I find out what all the various classes and such that I can use are? I'm used to things like the php site, where I can search for a particular method and it will bring me there and have all the documentation for that method...am I just blind?
Aaron Freidus
@shadowfool
Aug 27 2015 00:02
Anyone having issues with convert html entities bonfire? Dolce & gabanna test won't pass even though my characters are escaped
Jill Stellman
@techrev
Aug 27 2015 00:04
@stevenGarciaDev I so wanted to use recursion on that, but I was afraid I'd lock up my browser...
Aaron Freidus
@shadowfool
Aug 27 2015 00:09
Anyone know why this is passing every test aside from the "&" for Convert HTML Entities?
function convert(str) {
  str = str.split("");
  var conv = {"&":"&AMP;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"};
  var check = ["&","<",">",'"',"'"];
   for(i = 0; i <= str.length; i++){
     if(check.indexOf(str[i]) > 0){
      str[i] = conv[str[i]];
     }
   }

  str = str.join("");
  return str;

  }
Mihalis Phenos
@gitmihalis
Aug 27 2015 00:09
@timmcallister @Reggie01 thanks, but it still does not pass...
function palindrome(str) {
    str = str.toLowerCase();
    var re = '/ /./"';
    cleanstr = str.replace(re, '');
    return cleanstr === str.split('').reverse().join('');
}

palindrome("eye");
CamperBot
@camperbot
Aug 27 2015 00:09
gitmihalis sends brownie points to @timmcallister and @reggie01 :sparkles: :thumbsup: :sparkles:
:star: 159 | @reggie01 | http://www.freecodecamp.com/reggie01
:star: 182 | @timmcallister | http://www.freecodecamp.com/timmcallister
Reggie
@Reggie01
Aug 27 2015 00:10
@techrev bootstrap you would have to inspect the classes given in the examples. For example http://getbootstrap.com/css/#buttons-sizes beneath the example you see the css classes you have to add to create the example.
<p>
  <button type="button" class="btn btn-primary btn-lg">Large button</button>
  <button type="button" class="btn btn-default btn-lg">Large button</button>
</p>
Aaron Freidus
@shadowfool
Aug 27 2015 00:11
well that's weird I just solved it by putting something before my "& in my check array...
Jill Stellman
@techrev
Aug 27 2015 00:21
@Reggie01 so there's no way to see all the available classes anywhere? How can someone possibly know what's available? Or is it that everything is used in an example somewhere?
Spatz
@Spatzerny
Aug 27 2015 00:23
well there's info on the website
plus you could just look at the bootstrap css files
Jill Stellman
@techrev
Aug 27 2015 00:23
So maybe I should be a bit more specific in my question. In the first zipline Build a Personal Portfolio Webpage, it gives you a codepen to fork that's a template. There are some bootstrap classes (or at least I assume they are) that I'd like to look up and see what they do...how do I do that?
Spatz
@Spatzerny
Aug 27 2015 00:24
i'd assume that could be found at 'http://getbootstrap.com/css/'
but it seems you tried :D
Jill Stellman
@techrev
Aug 27 2015 00:24
@Spatzerny Exactly
NITEHAWK07
@NITEHAWK07
Aug 27 2015 00:25
I need help
Can someone help me?
Spatz
@Spatzerny
Aug 27 2015 00:25
maybe its a class that's a part of the custom css?
Jill Stellman
@techrev
Aug 27 2015 00:26
@Spatzerny Not sure. I think I'll just google it and see what happens.
@NITEHAWK07 I think you need to say what you need help with.
Spatz
@Spatzerny
Aug 27 2015 00:26
have you looked through the css on codepen
asking just to be sure :)
NITEHAWK07
@NITEHAWK07
Aug 27 2015 00:27
Waypoint 19 for html5 isnt registering the code im typing and saying it is wrong when it is right
Jill Stellman
@techrev
Aug 27 2015 00:27
@Spatzerny No....I was hoping to not have to do that. I want to be spoon fed. :smile:
Spatzerny @Spatzerny is confused
NITEHAWK07
@NITEHAWK07
Aug 27 2015 00:28
@techrev do you think you can help
Spatz
@Spatzerny
Aug 27 2015 00:28
it's a pretty short one
you could just paste the code here
@NITEHAWK07
Jill Stellman
@techrev
Aug 27 2015 00:28
@Spatzerny I was hoping not to have to go through the css - I just want a nice little website that shows me what the class does. :smile:
@NITEHAWK07 Are you working on Add Rounded Corners with a Border Radius?
Spatz
@Spatzerny
Aug 27 2015 00:29
well that won't happen if it's not a class from bootstrap :P
Jonathan
@jonathantimm
Aug 27 2015 00:30
Hi all, anyone see a problem with this?
<style>
  body {
    background-color: black;
    font-family: Monospace;
    color: green;
  }
  .pink-text {
    color: pink;
  }

  .blue-text {color:blue;}
</style>
<h1 class="pink-text blue-text">Hello World!</h1>
CamperBot
@camperbot
Aug 27 2015 00:30

welcome to FreeCodeCamp @jonathantimm!

NITEHAWK07
@NITEHAWK07
Aug 27 2015 00:30

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

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

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

<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
<a href="http://catphotoapp.com"> cat photos</a>

Jill Stellman
@techrev
Aug 27 2015 00:30
@Spatzerny it might...if it's some other library that's well documented. I guess I'll just go look at the css. <SIGH>
NITEHAWK07
@NITEHAWK07
Aug 27 2015 00:30
That is the text the anchor element is at the bottom
Spatz
@Spatzerny
Aug 27 2015 00:31
explain code formating
CamperBot
@camperbot
Aug 27 2015 00:31
no wiki entry for: code formating
:pencil: click here to create one now!after creating your page type update to reload it here
Spatz
@Spatzerny
Aug 27 2015 00:31
explain code formatting
CamperBot
@camperbot
Aug 27 2015 00:31

:point_right: code formatting [wiki]

Inline code

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

Code Block

``` ⇦ Type 3 backticks, 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

Jonathan
@jonathantimm
Aug 27 2015 00:31
My text is blue as it's supposed to be and the code looks right to me so i'm checking before I create a bug report
NITEHAWK07
@NITEHAWK07
Aug 27 2015 00:32
'''
Spatz
@Spatzerny
Aug 27 2015 00:32
@jonathantimm on the left you have test conditions
CamperBot
@camperbot
Aug 27 2015 00:32
:bulb: to format code use backticks! ``` more info
Spatz
@Spatzerny
Aug 27 2015 00:32
are some of them red?
NITEHAWK07
@NITEHAWK07
Aug 27 2015 00:32

'''

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

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

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

<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
<a href="http://catphotoapp.com"> cat photos</a>
'''

CamperBot
@camperbot
Aug 27 2015 00:32
:bulb: to format code use backticks! ``` more info
Spatz
@Spatzerny
Aug 27 2015 00:32
@NITEHAWK07 backticks not quotation marks
and you can EDIT chat :)
` <- this
' <- not this
Jonathan
@jonathantimm
Aug 27 2015 00:33
@Spatzerny oh weird, i didn't know i had to do that
NITEHAWK07
@NITEHAWK07
Aug 27 2015 00:33
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
<a href="http://catphotoapp.com"> cat photos</a>
Jonathan
@jonathantimm
Aug 27 2015 00:33
@Spatzerny thanks
CamperBot
@camperbot
Aug 27 2015 00:33
jonathantimm sends brownie points to @spatzerny :sparkles: :thumbsup: :sparkles:
:star: 258 | @spatzerny | http://www.freecodecamp.com/spatzerny
NITEHAWK07
@NITEHAWK07
Aug 27 2015 00:33
Ok is that better?
Spatz
@Spatzerny
Aug 27 2015 00:33
better
now @NITEHAWK07 do the same thing and look at the checks on the left
which ones are red?
NITEHAWK07
@NITEHAWK07
Aug 27 2015 00:34
huh?
Spatz
@Spatzerny
Aug 27 2015 00:34
on the page with the waypoint
left part of the screen
scroll all the way to the bottom
there are test conditions that have to be met
for the waypoint to be considered correct
NITEHAWK07
@NITEHAWK07
Aug 27 2015 00:35
It fixed itself
@Spatzerny Thanks!
CamperBot
@camperbot
Aug 27 2015 00:35
nitehawk07 sends brownie points to @spatzerny :sparkles: :thumbsup: :sparkles:
:star: 259 | @spatzerny | http://www.freecodecamp.com/spatzerny
Tim
@timmcallister
Aug 27 2015 00:35
can someone pleeeeaaase look at my stuff for the Random Quote Zipline and tell me where I'm messing up?
It's driving me crazy
Spatz
@Spatzerny
Aug 27 2015 00:35
@timmcallister link?
whoa
Reggie
@Reggie01
Aug 27 2015 00:36
@techrev I see the issue you having now. After you look through bootstrap a couple of times you can guess the subsections the classes belong to. I guess bootstrap needs a search form. What classes did you have questions about?
Tim
@timmcallister
Aug 27 2015 00:36
that wasn't the font I specified lol
Spatz
@Spatzerny
Aug 27 2015 00:36
codepen doesnt really 'run' here
it just displays it in chat without running most of it
Tim
@timmcallister
Aug 27 2015 00:37
ok
Spatz
@Spatzerny
Aug 27 2015 00:37
and what i can see is the same problem everybody seems to have
Tim
@timmcallister
Aug 27 2015 00:37
for my API call?
Spatz
@Spatzerny
Aug 27 2015 00:37
ye
codepen, security reasons etc. etc.
Tim
@timmcallister
Aug 27 2015 00:38
yeah I have NO idea what I'm doing with that. I've never worked with an API before
Spatz
@Spatzerny
Aug 27 2015 00:39
yeah, i havent done that one and i keep seeing this error
weather api works fine
ip location works fine
but forismatic seems to have issues
Tim
@timmcallister
Aug 27 2015 00:40
so it's at least partly not my fault
?
Spatz
@Spatzerny
Aug 27 2015 00:41
ye
give me a sec
Tim
@timmcallister
Aug 27 2015 00:41
ok
Spatz
@Spatzerny
Aug 27 2015 00:45
ok it seems that you cannot just use $.getJSON here
NITEHAWK07
@NITEHAWK07
Aug 27 2015 00:45
ANyone want to pair with me?
Tim
@timmcallister
Aug 27 2015 00:46
ok
thank you @Spatzerny
CamperBot
@camperbot
Aug 27 2015 00:46
timmcallister sends brownie points to @spatzerny :sparkles: :thumbsup: :sparkles:
:star: 260 | @spatzerny | http://www.freecodecamp.com/spatzerny
Matt Yamamoto
@MattYamamoto
Aug 27 2015 00:47
@timmcallister you can use getJSON... just set the format to jsonp and add &jsonp=? to the end of the url.
Gabriel
@gdedi001
Aug 27 2015 00:48
Hey guys are on the local weather zipline and im having trouble figuring something out. Im assuming that I have to use the geolocation api to get the coordinates of the client, but how can i use those coordinates to tell the user their exact city ie Miami, FL or Atlanta, GA
Tim
@timmcallister
Aug 27 2015 00:49
@MattYamamoto !!! Thanks a lot! It works! Now I have to figure out why...
CamperBot
@camperbot
Aug 27 2015 00:49
timmcallister sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 312 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Aug 27 2015 00:49
@gdedi001 whatever weather API you're getting weather data from should give you the city name
Gabriel
@gdedi001
Aug 27 2015 00:49
ok cool thanks @MattYamamoto
CamperBot
@camperbot
Aug 27 2015 00:49
gdedi001 sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 313 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Spatz
@Spatzerny
Aug 27 2015 00:51
it's always nice to have more competent people around to help :D
Matt Yamamoto
@MattYamamoto
Aug 27 2015 00:51
@timmcallister you want jsonp to get around same origin issues, but when using jsonp you need to provide a callback function for the server to wrap around the data. I remembered from helping someone else that forismatic wanted the callback to be entered as jsonp=?
Gabriel
@gdedi001
Aug 27 2015 00:51
yea i agree. @Spatzerny
Matt Yamamoto
@MattYamamoto
Aug 27 2015 00:52
for the few other API's I've played around with you normally use callback=?
Spatz
@Spatzerny
Aug 27 2015 00:52
@gdedi001 sorry for leading you slightly astray
Renelis Abreu Ramirez
@renelis
Aug 27 2015 00:52
@camperbot rooms
Spatz
@Spatzerny
Aug 27 2015 00:52
@MattYamamoto what does &jsonp=? mean
does it turn into php-like thing?
Matt Yamamoto
@MattYamamoto
Aug 27 2015 00:54
@Spatzerny The forismatic api states jsonp=<string> — callback function name, used for jsonp format only. You can use a question mark as an anonymous function (I think... I'm not a super expert on it)
Spatz
@Spatzerny
Aug 27 2015 00:55
oh
so it just wraps it in ?()
Hans van Riet
@hansinla
Aug 27 2015 00:55
@timmcallister Your button doesn’t call a function. You could do this with onclick=“” and then name the function you want to be called in the quotation marks.
Spatz
@Spatzerny
Aug 27 2015 00:55
having no clue what that actually changes is annoying
Tim
@timmcallister
Aug 27 2015 00:56
@hansinla haha you just troubleshot the problem I just figured out I had
thanks @hansinla
CamperBot
@camperbot
Aug 27 2015 00:56
timmcallister sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 322 | @hansinla | http://www.freecodecamp.com/hansinla
Spatz
@Spatzerny
Aug 27 2015 00:56
"The advent of JSONP — essentially a consensual cross-site scripting hack[...]"
so it probably has no rhyme or reason
Jacob Jordan
@jjordan88
Aug 27 2015 00:57

Guys, what the heck am I doing wrong?

```
function mutation(arr) {
var firstElement = arr[0].toLowerCase();
var secondElement = arr[1].toLowerCase();
var i = 0;

/This loop says while i is less than the length of the the element being searched in var secondElement,
if i encounters a number < 0, i.e. - 1, when indexing secondElement, that means the inputted strings
are different. Thus, return false. If not, the element in var secondElement contains the same string as
the element in var firstElement, and the loop will return a positive index, i.e. true.
/
while(i < arr[1].length) {
if (firstElement.indexOf(secondElement[i]) < 0) {
return false;
}
return true;
}
}

/Function call. /
mutation(['hello', 'hey']);

Spatz
@Spatzerny
Aug 27 2015 00:57
you're formatting code wrong
Jacob Jordan
@jjordan88
Aug 27 2015 00:57
function mutation(arr) {
  var firstElement = arr[0].toLowerCase();
  var secondElement = arr[1].toLowerCase();
  var i = 0;

 /*This loop says while i is less than the length of the the element being searched in var secondElement,
 if i encounters a number < 0, i.e. - 1, when indexing secondElement, that means the inputted strings
 are different. Thus, return false. If not, the element in var secondElement contains the same string as
 the element in var firstElement, and the loop will return a positive index, i.e. true.*/
  while(i < arr[1].length) {
  if (firstElement.indexOf(secondElement[i]) < 0) {
  return false; 
}
  return true;  
  }
}

/*Function call. */
mutation(['hello', 'hey']);
Spatz
@Spatzerny
Aug 27 2015 00:57
:D
Matt Yamamoto
@MattYamamoto
Aug 27 2015 00:57
@Spatzerny Essentially the reason you have to use jsonp is to work around the same origin policy. That is, for security reasons a script isn't allowed to call a third party server. With jsonp you provide the server with a callback function to wrap the data in...so the server says "oh, you want this data, and you want me to wrap it in this function...okay, here's the function" .... then once that gets to you it is pulled out of the callback. At least, that is as far as I understand it.
Jacob Jordan
@jjordan88
Aug 27 2015 00:58
Lol I guess I asked for that. Literally.
ninjatron
@ninjatron
Aug 27 2015 00:58
@jjordan88 what are you asking?
Jacob Jordan
@jjordan88
Aug 27 2015 00:58
But seriously, all the little green checkmarks pass except for hello vs hey at the top. And I don't mean to be a pest - I hate to bother you guys! - but this is driving me nuts.
Tim
@timmcallister
Aug 27 2015 00:59
@jjordan88 you're not incrementing i
Matt Yamamoto
@MattYamamoto
Aug 27 2015 01:00
@timmcallister one of the reasons your button wasn't working is that when you use .click() you should just put the function name in there. When you have .click(getQuote()) ( that is you have the parens () after getQuote) that code is executed immediately. You could also do something like
ninjatron
@ninjatron
Aug 27 2015 01:00
@jjordan88 just use a for loop
Matt Yamamoto
@MattYamamoto
Aug 27 2015 01:00
whoops
Jacob Jordan
@jjordan88
Aug 27 2015 01:00
It doesn't just have a one-by-one search function baked into the indexOf... or you mean in the loop?
Spatz
@Spatzerny
Aug 27 2015 01:00
"A particularly great source of JSONP-formatted data is the Yahoo! Query Language, which we'll use in the following example to fetch news about cats."
welp... internet....
Matt Yamamoto
@MattYamamoto
Aug 27 2015 01:00
$('.elem').click(funciton(){
  getQuote();
});
@timmcallister
Spatz
@Spatzerny
Aug 27 2015 01:01
guys, you can edit your text :P
on the right, after the timestamp
Tim
@timmcallister
Aug 27 2015 01:02
@MattYamamoto javascript is weird.
Jacob Jordan
@jjordan88
Aug 27 2015 01:02
@timmcallister I tried sticking i++ in the loop and it threw an error, so.... yeah. IDK. It looks like you guys are pretty busy already, so I'll hammer it out somehow. I might do what @ninjatron suggests and use a for loop.
Matt Yamamoto
@MattYamamoto
Aug 27 2015 01:02
@Spatzerny thanks....didn't know that. quite convenient
CamperBot
@camperbot
Aug 27 2015 01:02
mattyamamoto sends brownie points to @spatzerny :sparkles: :thumbsup: :sparkles:
:star: 261 | @spatzerny | http://www.freecodecamp.com/spatzerny
Tim
@timmcallister
Aug 27 2015 01:03
@jjordan88 it's all good, I'm fixed now. what type of error was it
ninjatron
@ninjatron
Aug 27 2015 01:03
@QuincyLarson There is a bug Bonfire: Map the Debris i finished, i click continue and it takes me to waypoints i already solved
Spatz
@Spatzerny
Aug 27 2015 01:04
just go to the map
and select the next unsolved one
ninjatron
@ninjatron
Aug 27 2015 01:04
@Spatzerny i know, i just reported the bug
lol
Tim
@timmcallister
Aug 27 2015 01:05
Yeah, I click on next challenge and end up a few in the future sometimes. Thats why I'm doing the quote zipline now when I haven't done the portfolio.
Jacob Jordan
@jjordan88
Aug 27 2015 01:05
@timmcallister I'll try and reproduce it, hold on. For what it's worth, I'm still getting the same result with a for loop - all checkmarks achieved but the top one.
Hans van Riet
@hansinla
Aug 27 2015 01:05
@jjordan88 Your variable i doesn’t get changed from the initial value
Jacob Jordan
@jjordan88
Aug 27 2015 01:06
@timmcallister It was an unexpected token ; but I fixed it. @hansinla what do you mean?
ninjatron
@ninjatron
Aug 27 2015 01:06
i am pretty sure this might work @jjordan88
while (i++ < arr[1].length)
though it might not so go try
Jacob Jordan
@jjordan88
Aug 27 2015 01:07
You can do that? ^^ Neat.
Hans van Riet
@hansinla
Aug 27 2015 01:08
@jjordan88 You make var i=0; but never update that value in the code you pasted above.
Tim
@timmcallister
Aug 27 2015 01:08
@jjordan88 just fyi, if you have an evaluation, loop, etc with just one line after it, you don't need brackets
*braces
Jacob Jordan
@jjordan88
Aug 27 2015 01:10

Nope, same result, @ninjatron .

Oh! That i has to be set that way for the incrementer to work @hansinla . Or at least I think it does... lol

Really, @timmcallister ? I never knew that. Thanks!
CamperBot
@camperbot
Aug 27 2015 01:10
:star: 183 | @timmcallister | http://www.freecodecamp.com/timmcallister
jjordan88 sends brownie points to @timmcallister :sparkles: :thumbsup: :sparkles:
DTing
@dting
Aug 27 2015 01:10
@ninjatron that still skips the first element and you get out of bounds before it exits
Tim
@timmcallister
Aug 27 2015 01:10
np
Hans van Riet
@hansinla
Aug 27 2015 01:11
@jjordan88 Right but you don’t increment i
Jacob Jordan
@jjordan88
Aug 27 2015 01:12
function mutation(arr) {
  var firstElement = arr[0].toLowerCase();
  var secondElement = arr[1].toLowerCase();
  var i = 0;

 /*This loop says while i is less than the length of the the element being searched in var secondElement,
 if i encounters a number < 0, i.e. - 1, when indexing secondElement, that means the inputted strings
 are different. Thus, return false. If not, the element in var secondElement contains the same string as
 the element in var firstElement, and the loop will return a positive index, i.e. true.*/
  while(i < arr[1].length) {
  if (firstElement.indexOf(secondElement[i]) < 0) {
  return false;
    i++
}
  return true;  
  }
}

/*Function call. */
mutation(['hello', 'hey']);
Hans van Riet
@hansinla
Aug 27 2015 01:13
@jjordan88 That’s better. Close with ; though
ninjatron
@ninjatron
Aug 27 2015 01:13
@dting apparently js first increments
jmsynp
@jmsynp
Aug 27 2015 01:13
$($(".slot")[0]).html(slotOne); Use the above selector to display each number in its corresponding slot. << what the heck does this even mean?
ninjatron
@ninjatron
Aug 27 2015 01:13
hahaha what's the point of postfix increment then?
DTing
@dting
Aug 27 2015 01:13
@ninjatron no it increments after the evaluation
ninjatron
@ninjatron
Aug 27 2015 01:14
@dting but before the loop ends
DTing
@dting
Aug 27 2015 01:14
of the condition but before the loop is run
ninjatron
@ninjatron
Aug 27 2015 01:14
@dting k i assumed it would work c++ way
Tim
@timmcallister
Aug 27 2015 01:15
a for loop can make this much easier
for i in arr[1]
ninjatron
@ninjatron
Aug 27 2015 01:15
yeah i said that as well no reason to use while
@timmcallister
Jacob Jordan
@jjordan88
Aug 27 2015 01:16
Well, I can write a for loop again, but I'm not sure what it'll do... it just outputs the same error. I know I'm doing something wrong, I just don't know what it is.... lol
I'm sorry to bug you guys with this.
Thanks for helping me.
CamperBot
@camperbot
Aug 27 2015 01:16
if you want to thank someone, put an @ before their name!
Tim
@timmcallister
Aug 27 2015 01:17
@dting how bout that, now I know
ninjatron
@ninjatron
Aug 27 2015 01:17
for (var i = 0; i < arr_length; i++) {
Jacob Jordan
@jjordan88
Aug 27 2015 01:18
function mutation(arr) {
  var firstElement = arr[0].toLowerCase();
  var secondElement = arr[1].toLowerCase();


 /*This loop says while i is less than the length of the the element being searched in var secondElement,
 if i encounters a number < 0, i.e. - 1, when indexing secondElement, that means the inputted strings
 are different. Thus, return false. If not, the element in var secondElement contains the same string as
 the element in var firstElement, and the loop will return a positive index, i.e. true.*/
 for(var x = 0; x < arr[1].length; x++) {
  if (firstElement.indexOf(secondElement[x]) < 0) {
  return false;
    i++;
}
  return true;  
  }
}

/*Function call. */
mutation(['hello', 'hey']);
ninjatron
@ninjatron
Aug 27 2015 01:18
@jjordan88 you can't do while (i++ < arr[1].length) because apparently i becomes i + 1 as soon as it enters loop
@jjordan88 look above
Jacob Jordan
@jjordan88
Aug 27 2015 01:20
So it'll skip a letter from the start then?
DTing
@dting
Aug 27 2015 01:20
@jjordan88 think of what happens in your first loop
Jacob Jordan
@jjordan88
Aug 27 2015 01:20
Is what you're saying.
DTing
@dting
Aug 27 2015 01:20
if element is found
err not found. will you ever get to x = 1?
@jjordan88 for the code inside the for loop. you ALWAYS return. that means you will never get to the second value of the for loop.
ninjatron
@ninjatron
Aug 27 2015 01:22
return true; put it after the loop
Tim
@timmcallister
Aug 27 2015 01:23
brb everyone
Jacob Jordan
@jjordan88
Aug 27 2015 01:23
I did, now the top one's the ONLY one that works. lol
headdesk
ninjatron
@ninjatron
Aug 27 2015 01:25
i can't remember this question
function mutation(arr) {
  var arr_length = arr[1].length;
  var s1 = arr[0].toLowerCase();
  var s2 = arr[1].toLowerCase();
  for (var i = 0; i < arr_length; i++) {
    if (s1.indexOf(s2[i]) < 0) {
      return false;
    }
  }
  return true;
}

mutation(['hello', 'hey']);
^ solution
Jacob Jordan
@jjordan88
Aug 27 2015 01:28
When I compare to this:
function mutation(arr) {
  var firstElement = arr[0].toLowerCase();
  var secondElement = arr[1].toLowerCase();


 /*This loop says while i is less than the length of the the element being searched in var secondElement,
 if i encounters a number < 0, i.e. - 1, when indexing secondElement, that means the inputted strings
 are different. Thus, return false. If not, the element in var secondElement contains the same string as
 the element in var firstElement, and the loop will return a positive index, i.e. true.*/

 for(var x = 0; x < arr[1].length; x++) {
  if (firstElement.indexOf(secondElement[x]) < 0) {
  return false;
}
  return true;  
  }
}

/*Function call. */
mutation(['hello', 'hey']);
The only thing I can see different is flipped return statements w/ curly braces. I'll try that.
Nope. Now nothing passes. I officially have no clue, you guys. Thanks for your help, though.
CamperBot
@camperbot
Aug 27 2015 01:30
if you want to thank someone, put an @ before their name!
Jacob Jordan
@jjordan88
Aug 27 2015 01:31
Holy a;dlkfja;ldfa;lkdfj it worked....!
lol

All that over ONE curly brace. Behold:

function mutation(arr) {
  var firstElement = arr[0].toLowerCase();
  var secondElement = arr[1].toLowerCase();


 /*This loop says while i is less than the length of the the element being searched in var secondElement,
 if i encounters a number < 0, i.e. - 1, when indexing secondElement, that means the inputted strings
 are different. Thus, return false. If not, the element in var secondElement contains the same string as
 the element in var firstElement, and the loop will return a positive index, i.e. true.*/

 for(var x = 0; x < arr[1].length; x++) {
  if (firstElement.indexOf(secondElement[x]) < 0) {
  return false;
}
 }
  return true;  
  }
/*Function call. */
mutation(['hello', 'hey']);

In the words of Jubal Early, 'Does that seem right to you?' haha

Couldn't have done it without you, guys! A thousand thanks. Now it's bedtime. Night!
CamperBot
@camperbot
Aug 27 2015 01:34
if you want to thank someone, put an @ before their name!
ninjatron
@ninjatron
Aug 27 2015 01:34
@jjordan88 night
Patrick McWilliams
@patrickmac110
Aug 27 2015 01:58
I think I'm confused here:
function purge(l){
  for(var j = 1; j<arr.length; j++){
    if(arr[m]===arr[j]){
      return true
    }
    else{
      return false
    }
  }

}


function destroyer(arr) {
  // Remove all the values
  var out =arr[0];
  var ary = arr;
  var y = 0;
  for(var m =1; m<arr.length; m++){

    out[y].filter(purge);
    y++;
  }
  return ary;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Rachel
@noeladd
Aug 27 2015 01:59
bonfire: mutations
CamperBot
@camperbot
Aug 27 2015 01:59

: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

Rachel
@noeladd
Aug 27 2015 01:59
hint
CamperBot
@camperbot
Aug 27 2015 01:59
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Patrick McWilliams
@patrickmac110
Aug 27 2015 02:07
how would I account for a varied number of inputs in my function??
@dting are you on rn?
DTing
@dting
Aug 27 2015 02:11
bf links
DTing
@dting
Aug 27 2015 02:11
bf seek
CamperBot
@camperbot
Aug 27 2015 02:11

: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
Aug 27 2015 02:11
bf links
CamperBot
@camperbot
Aug 27 2015 02:11
DTing
@dting
Aug 27 2015 02:11
use the argument's object
Patrick McWilliams
@patrickmac110
Aug 27 2015 02:15
it's saying .filter is not a function
function purge(l){
  for(var j = 1; j<arr.length; j++){
    if(arr[m]===arr[j]){
      return true
    }
    else{
      return false
    }
  }
}

function destroyer(arr) {
  // Remove all the values
  var out =arr[0];
  var ary = arr;
  var y = 0;
  for(var m =1; m<arr.length; m++){
    out[y].filter(purge);
    y++;
  }
  return ary;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Tim P
@xTimpi
Aug 27 2015 02:16
@patrickmac110 filter is a array function, you are calling it on an integer
DTing
@dting
Aug 27 2015 02:16
arr[0] is a number
Patrick McWilliams
@patrickmac110
Aug 27 2015 02:17
I thought it was an array
I see that it's just the first in the array in the first input... which confuses me
DTing
@dting
Aug 27 2015 02:19
use the arguments object of the function that link explains what it is
chriscrosscutler
@chriscrosscutler
Aug 27 2015 02:21
function mutation(arr) {

  var word = arr[1];
  var source = arr[0];
  var lower = word.toLowerCase();
  var tempArr = [];
  var find;
  tempArr = lower;
   for ( var i = 0; i < word.length; i++)
     {
       if (find = source.indexOf(word[i]) == -1)
         {
             return false;
         }
     }


  return true;
}

mutation(['hello', 'hey']);
how can I make this search the first word in an array to see if it contains all the letters of the first word in the array? right now my code is only passing some test cases.
DTing
@dting
Aug 27 2015 02:23
@chriscrosscutler you should toLowercase both words
Patrick McWilliams
@patrickmac110
Aug 27 2015 02:25
@dting thanks, I'm getting somewhere now... idk why but the mozilla site confuses me and/or is hard to read, I always get somewhere when I find the equivalent article on w3schools
CamperBot
@camperbot
Aug 27 2015 02:25
patrickmac110 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 715 | @dting | http://www.freecodecamp.com/dting
chriscrosscutler
@chriscrosscutler
Aug 27 2015 02:25
ok, I did that but now it's not working...
function mutation(arr) {

  var word = arr[1];
  var source = arr[0];
  var lowerOne = word.toLowerCase();
  var lowerTwo = source.toLowerCase();
  var tempArr = [];
  var find;
  tempArr = lower;
   for ( var i = 0; i < word.length; i++)
     {
       if (find = lowerTwo.indexOf(lowerOne[i]) == -1)
         {
             return false;
         }
     }


  return true;
}

mutation(['hello', 'hey']);
@dting
DTing
@dting
Aug 27 2015 02:26
you should be lowerOne.indexOf(lowerTwo[i]) === -1
oh wait
nm
chriscrosscutler
@chriscrosscutler
Aug 27 2015 02:28
@dting yeah that's the bit that im struggling with. As in that particular line. it's weird that it's passing some cases but not all
DTing
@dting
Aug 27 2015 02:29
which case is failing?
you should get rid of the code that isnt used
chriscrosscutler
@chriscrosscutler
Aug 27 2015 02:29
i did, and now it worked! man I love coding!!! Thanks @dting
CamperBot
@camperbot
Aug 27 2015 02:29
chriscrosscutler sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 716 | @dting | http://www.freecodecamp.com/dting
Fernando Rodriguez
@Fernan24
Aug 27 2015 02:32
i need help in bonfire:factorize a Number
CamperBot
@camperbot
Aug 27 2015 02:32
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Sandra
@scuya
Aug 27 2015 02:32
This message was deleted
Hi! I think I solved the factorial Bonfire but I keep getting an error. My code is outputting the correct answers outlined on the left side. Am I doing something wrong?
var fac = 1;
function factorialize(num) {
  for(i=num; i>1;i--){
    fac = fac * i
  }
  return fac;
};

factorialize(10);
Fernando Rodriguez
@Fernan24
Aug 27 2015 02:33
i have this
code but it wont work
DTing
@dting
Aug 27 2015 02:34
@scuya move your fac var into the function
Sandra
@scuya
Aug 27 2015 02:35
Thanks @dting , I feel silly. Just for my own sanity, why can't fac be a global variable?
CamperBot
@camperbot
Aug 27 2015 02:35
scuya sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 717 | @dting | http://www.freecodecamp.com/dting
Fernando Rodriguez
@Fernan24
Aug 27 2015 02:36

function factorialize(num) {
for(var i=1; i<num; i++){
num=num*i;
}
return num;
}

factorialize(5);

DTing
@dting
Aug 27 2015 02:36
bf factor
CamperBot
@camperbot
Aug 27 2015 02:36

:fire:Bonfire: Factorialize a Number :link:

function factorialize(num) {
  return num;
}

factorialize(5);

Return the factorial of the provided integer.

more info:  bf details | bf links | hint

Slade
@theDigEx
Aug 27 2015 02:36
local scope vs. global scope ...can be a doozy
Fernando Rodriguez
@Fernan24
Aug 27 2015 02:37
how do i write the code so that its in the format of the compiler?
DTing
@dting
Aug 27 2015 02:37
help formatting
CamperBot
@camperbot
Aug 27 2015 02:37

:point_right: code formatting [wiki]

Inline code

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

Code Block

``` ⇦ Type 3 backticks, 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

Fernando Rodriguez
@Fernan24
Aug 27 2015 02:39
'''
CamperBot
@camperbot
Aug 27 2015 02:39
:bulb: to format code use backticks! ``` more info
Fernando Rodriguez
@Fernan24
Aug 27 2015 02:39
```
DTing
@dting
Aug 27 2015 02:39
@Fernan24 you need to use another variable to use as an intermediate result. you are mutating num and using it as your loop condition. your num grows faster than your i so it shouldnt ever end.
Fernando Rodriguez
@Fernan24
Aug 27 2015 02:39
function factorialize(num) {
  for(var i=1; i<num; i++){
   num=num*i;
  }
  return num;
}

factorialize(5);
ok thnk you
CamperBot
@camperbot
Aug 27 2015 02:40
if you want to thank someone, put an @ before their name!
DTing
@dting
Aug 27 2015 02:40
@scuya it could be global. but then it is reused for all the tests and the way you use that var you expect it to start at 1
deaninous
@deaninous
Aug 27 2015 02:41
@Fernan24 you could use the factorial method. it would make things easier
Fernando Rodriguez
@Fernan24
Aug 27 2015 02:41
well at elast it runs now, how do i use the factorial method
ok i was abel to make it work, thank you guys so much!!!
CamperBot
@camperbot
Aug 27 2015 02:42
if you want to thank someone, put an @ before their name!
deaninous
@deaninous
Aug 27 2015 02:43
I didnt see that you @Fernan24 had @dting .
You have him you have a coach and a teacher in one
Geri Escandor
@geriesc
Aug 27 2015 02:43

Can someone help me? Why is my code not working:

<script>
$(document).ready(function() {
$("button").addClass(shake);
$(".btn").addClass(animated);
$("#target1").addClass("animated shake btn-primary");

});
</script>

DTing
@dting
Aug 27 2015 02:44
@geriesc you should put quots areound "shake" and "animated"
@Fernan24 recursive?
Geri Escandor
@geriesc
Aug 27 2015 02:45
@dting did it:
$("#target1").addClass("animated" "shake" "btn-primary");
then this appeared:
missing ) after argument list
DTing
@dting
Aug 27 2015 02:45
@geriesc no i meant on lines 3 and 4
$("button").addClass(shake); // quotes
$(".btn").addClass(animated); // quotes
Geri Escandor
@geriesc
Aug 27 2015 02:46
@dting I understand. Need to look at the little things.
Thank you @dting for helping me
CamperBot
@camperbot
Aug 27 2015 02:46
geriesc sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 718 | @dting | http://www.freecodecamp.com/dting
Sandra
@scuya
Aug 27 2015 02:46
Makes sense, thanks @dting
CamperBot
@camperbot
Aug 27 2015 02:46
scuya sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: scuya already gave dting points
DTing
@dting
Aug 27 2015 02:46
nps
JC
@cowick22
Aug 27 2015 02:46
I am on the first waypoint of the jquery section. It says to create a script element so I type <script> </script> and it still is marked with red x, also it says to add the code $(document).ready(function() {
});
When I add the code into the script element I still only get red x's, what am I doing wro
wrong
DTing
@dting
Aug 27 2015 02:48
@cowick22 paste your code here
Prashanth Chandra
@prashcr
Aug 27 2015 02:49
What's wrong with this? It looks perfectly fine to me.
myDog.bark = function() {console.log("WOOF");};
JC
@cowick22
Aug 27 2015 02:49
<script>$(document).ready(function() {
});
</script>
Prashanth Chandra
@prashcr
Aug 27 2015 02:51
@cowick22 Where did you add the script element? It should be at the top, before any other html
JC
@cowick22
Aug 27 2015 02:51
yes I put it on line 1
DTing
@dting
Aug 27 2015 02:51
@cowick22 try putting a new line for $(document) ....
JC
@cowick22
Aug 27 2015 02:52
still nothing, the page is still saying I haven't even created a script element
Rex Schrader
@SaintPeter
Aug 27 2015 02:53
thanks @1hella
CamperBot
@camperbot
Aug 27 2015 02:53
saintpeter sends brownie points to @1hella :sparkles: :thumbsup: :sparkles:
:star: 210 | @1hella | http://www.freecodecamp.com/1hella
DTing
@dting
Aug 27 2015 02:54
@cowick22 try using a different browser
Stephen Wanhella
@1hella
Aug 27 2015 02:54
Thank you @SaintPeter
CamperBot
@camperbot
Aug 27 2015 02:54
1hella sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 375 | @saintpeter | http://www.freecodecamp.com/saintpeter
chriscrosscutler
@chriscrosscutler
Aug 27 2015 02:55
how could I use .filter to remove falsy values from an array? I guess I'm just confused about how to compare or recognize falsy values in array. any tips?
ryana11
@ryana11
Aug 27 2015 02:55
does some of the waypoints sometimes let you pass even though you didnt type in the right thing?
Tim
@timmcallister
Aug 27 2015 02:55
So I'm workin on that same zipline,
JC
@cowick22
Aug 27 2015 02:55
got this is firefox: expected expression, got keyword 'do'
Tim
@timmcallister
Aug 27 2015 02:55
and sometimes my tweet function works right and sometimes it doesn't
Prashanth Chandra
@prashcr
Aug 27 2015 02:56
@chriscrosscutler
arr.filter(function(item) {return item;});
DTing
@dting
Aug 27 2015 02:56
the !! isn't needed you can just return the item. but ya
Prashanth Chandra
@prashcr
Aug 27 2015 02:56
true
Will Moody
@willmoody
Aug 27 2015 02:56
Hey guys! Looking for some help on my portfolio site: http://codepen.io/fractalmind/pen/xwKxwG
I'm trying to use the parallax effect detailed at http://code.tutsplus.com/tutorials/a-simple-parallax-scrolling-technique--net-27641 , and I also put together a fixed header, which works great right up until it gets lost under the first foreground element :\
If I try to put it above/outside the background section, it simply vanishes. Could really use some guidance!
Apologies in advance for my ugly, ugly code :P
Prashanth Chandra
@prashcr
Aug 27 2015 02:59
@dting I can't wait for es6 to be more widely used
That same code
arr.filter(x => x);
Gabriel
@gdedi001
Aug 27 2015 03:01
your site is pretty nice man @fractal-mind
JC
@cowick22
Aug 27 2015 03:01
@dting thanks for the suggestion but so far I have tried the code in ms edge, chrome and firefox to which none let me move on to the next page or will even give me a green check for anything I have done in this lesson
CamperBot
@camperbot
Aug 27 2015 03:01
cowick22 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 719 | @dting | http://www.freecodecamp.com/dting
Tim P
@xTimpi
Aug 27 2015 03:01
@fractal-mind I had the same issue, I can’t really go through your code right now, but putting the background an content into 2 seperate containers fixed that for me, my portfolio is a complete mess but if you want you can look through the code: http://codepen.io/xtimpi/pen/bdPGwZ
Gabriel
@gdedi001
Aug 27 2015 03:01
I like how the background changes as the user scrolls down
Glen Roberts
@ZeroAccess
Aug 27 2015 03:01
Ok, thought I had this but apparently I don't...tried a couple different things and I think I'm just trying random things at this point. I'm working on Chunky Monkey and the splice is easy but trying to push both arrays into a multidimensional is giving me a hard time. Any tips?
Will Moody
@willmoody
Aug 27 2015 03:01
@gdedi001 Thanks, I appreciate it! been working on it on and off all day :]
CamperBot
@camperbot
Aug 27 2015 03:01
fractal-mind sends brownie points to @gdedi001 :sparkles: :thumbsup: :sparkles:
:star: 178 | @gdedi001 | http://www.freecodecamp.com/gdedi001
Tim P
@xTimpi
Aug 27 2015 03:02
@fractal-mind it looks really bad in the chat preview, so you might want to look at it in your browser lol
DTing
@dting
Aug 27 2015 03:02
@cowick22 hmm it looks like this?
Tim
@timmcallister
Aug 27 2015 03:02
anyone know how to reliably change tweet content based on what's in the page?
Will Moody
@willmoody
Aug 27 2015 03:02
@xTimpi Thanks! I'll take a look.
CamperBot
@camperbot
Aug 27 2015 03:02
fractal-mind sends brownie points to @xtimpi :sparkles: :thumbsup: :sparkles:
:star: 267 | @xtimpi | http://www.freecodecamp.com/xtimpi
Tim P
@xTimpi
Aug 27 2015 03:03
@fractal-mind let me know if you have any questions
DTing
@dting
Aug 27 2015 03:03
Screen Shot 2015-08-26 at 8.02.29 PM.png
but it didn't work
JC
@cowick22
Aug 27 2015 03:04
@dting yes that's exactly what I have
IllusionElements
@IllusionElements
Aug 27 2015 03:04
@timmcallister are you referinf to the quote app?
Tim
@timmcallister
Aug 27 2015 03:04
that's the one
DTing
@dting
Aug 27 2015 03:05
@timmcallister the short answer is basically you cant dynamically change the contents
IllusionElements
@IllusionElements
Aug 27 2015 03:05
Are you using an Api call or just an array?
DTing
@dting
Aug 27 2015 03:05
@timmcallister when you use the widget
Tim
@timmcallister
Aug 27 2015 03:05
api call @IllusionElements
@dting what are my other options?
DTing
@dting
Aug 27 2015 03:05
@dting you have to either add and remove the button or create your own button that acts like their tweet button
IllusionElements
@IllusionElements
Aug 27 2015 03:06
To have dynamic content in it just put a html append onto a tweet link in your success function with your quote
Gabriel
@gdedi001
Aug 27 2015 03:06
Ok, so I using an API for the first time ever (building my local weather zip line) and I was provided with a client ID and client secret from the API I'm using (yahoo). Can anyone shed some light on what this actually is and how to use it?
DTing
@dting
Aug 27 2015 03:06
their js creates an iframe when the element is loaded so you can't alter it on the fly. if you remove the element and add a new one with your desired text it will create a new iframe
Gabriel
@gdedi001
Aug 27 2015 03:06
I am using*
DTing
@dting
Aug 27 2015 03:07
however this causes it to flash a bit. the other option is to use a button that looks like their tweet button but doesnt use their js. and then you can just modify an href
IllusionElements
@IllusionElements
Aug 27 2015 03:07
Something like $('#tweet').html(tweet link/quote callback)
Tim
@timmcallister
Aug 27 2015 03:08
@dting @IllusionElements roger dodger, thanks
CamperBot
@camperbot
Aug 27 2015 03:08
timmcallister sends brownie points to @dting and @illusionelements :sparkles: :thumbsup: :sparkles:
:star: 240 | @illusionelements | http://www.freecodecamp.com/illusionelements
:star: 720 | @dting | http://www.freecodecamp.com/dting
IllusionElements
@IllusionElements
Aug 27 2015 03:08
JC
@cowick22
Aug 27 2015 03:09
I know that I am at a very elementary level of coding but can anyone give me any suggestions as to why this doesn't work?<script>
$(document).ready(function() {
});
</script>
Tim
@timmcallister
Aug 27 2015 03:10
explain format
CamperBot
@camperbot
Aug 27 2015 03:10

:point_right: code formatting [wiki]

Inline code

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

Code Block

``` ⇦ Type 3 backticks, 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

Tim
@timmcallister
Aug 27 2015 03:10
@cowick22 well, it doesn't seem to do anything. How do you know it doesn't work?
chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:10
arr.filter(function(item) {return item;});So the item is the thing I want to find in the array? but how do I search for "null" or NaN? I tried making those falsy values variables but it wouldnt let me. @dting @prashcr
JC
@cowick22
Aug 27 2015 03:11
@timmcallister well its the very first waypoingt in the jquery section of free code camp
Prashanth Chandra
@prashcr
Aug 27 2015 03:11
Do you want to keep the falsy values or the truthy values?
@chriscrosscutler
DTing
@dting
Aug 27 2015 03:11
@chriscrosscutler its kind of a trick question. the filter function will evaluate the value you return from the callback and check for falsyness
if you just return the element from the callback function it will filter out the falsy values.
JC
@cowick22
Aug 27 2015 03:12
the page will not let me move on to the next waypoint until this one is correct
Tim
@timmcallister
Aug 27 2015 03:13
@cowick22 there's a bug on that one, put a blank line after $(document).ready(function() {
Prashanth Chandra
@prashcr
Aug 27 2015 03:13
If you want just null and NaN then do
arr.filter(function(item) {return item === null || item.isNan();});
chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:15
@prashcr the anything that is not a falsy
DTing
@dting
Aug 27 2015 03:15
isNaN(item)
Prashanth Chandra
@prashcr
Aug 27 2015 03:16
@chriscrosscutler if you want anything that is not falsy then the previous code works
DTing
@dting
Aug 27 2015 03:16
bf falsy
CamperBot
@camperbot
Aug 27 2015 03:16
Sorry, can't find a bonfire called falsy. [ Check the map? ]
DTing
@dting
Aug 27 2015 03:16
bf falsey
CamperBot
@camperbot
Aug 27 2015 03:16

:fire:Bonfire: Falsey Bouncer :link:

function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  return arr;
}

bouncer([7, 'ate', '', false, 9]);

Remove all falsey values from an array.

more info:  bf details | bf links | hint

DTing
@dting
Aug 27 2015 03:16
bf links
CamperBot
@camperbot
Aug 27 2015 03:16
JC
@cowick22
Aug 27 2015 03:17
@timmcallister thanks I have been pulling my hair out for an hour trying to find out what I did wrong
Tim
@timmcallister
Aug 27 2015 03:17
np
DTing
@dting
Aug 27 2015 03:17

i wonder why Boolean Objects is a link.

function bouncer(arr) {
  return arr.filter(Boolean);
}

seems like a worse answer

chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:17
@prashcr do I have to declare the variable item?
Prashanth Chandra
@prashcr
Aug 27 2015 03:18
no, you can name it anything you want.
chipymunk
@chipymunk
Aug 27 2015 03:18
He y everyone.. I'm trying to add an item to an array in line. Its giving me an error.. Any ideas? myDog.sound = "bark";
Prashanth Chandra
@prashcr
Aug 27 2015 03:18
Filter takes a callback function, which it uses to evaluate whether an item should exist in the new array
simpler example
var arr = [1, 2, 3, 4];
arr.filter(function(n) {return n > 2;}); // returns [3, 4]
@chipymunk you can't add stuff to an array using dot notation..
ascended2
@ascended2
Aug 27 2015 03:21
Hey I am having an issue with the Learn how to script waypoint. I can't seem to get the script element right.
This is what I have
<script>
  $(document).ready(function() {});
</script>
Prashanth Chandra
@prashcr
Aug 27 2015 03:22
@ascended2
<script>
  $(document).ready(function() {

  });
</script>
Justin Crawford
@JCrawford1122
Aug 27 2015 03:22
This message was deleted
ascended2
@ascended2
Aug 27 2015 03:22
Well that seems like a silly thing. Thanks @prashcr!
CamperBot
@camperbot
Aug 27 2015 03:22
ascended2 sends brownie points to @prashcr :sparkles: :thumbsup: :sparkles:
:star: 287 | @prashcr | http://www.freecodecamp.com/prashcr
Prashanth Chandra
@prashcr
Aug 27 2015 03:22
@chipymunk Did you mean object?
Justin Crawford
@JCrawford1122
Aug 27 2015 03:24
heh never mind what I said. that doesn't work
chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:24
thanks @prashcr
CamperBot
@camperbot
Aug 27 2015 03:24
chriscrosscutler sends brownie points to @prashcr :sparkles: :thumbsup: :sparkles:
:star: 288 | @prashcr | http://www.freecodecamp.com/prashcr
Patrick McWilliams
@patrickmac110
Aug 27 2015 03:24
what's wrong with my thinking here?
var j = 0;

function purge(l, n, j){
  j++;
    if(l===n[j]){
      return true
    }
    else{
      return false
    }
}

function destroyer(arr) {
  // Remove all the values
  var out = arguments[0];
  var ary = arguments;

  out = out.filter(purge, ary, j);

  return out;  
}

destroyer([1, 2, 3, 1, 2, 3], 27, 3);
bonfire: seek and destroy
CamperBot
@camperbot
Aug 27 2015 03:24

: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

Glen Roberts
@ZeroAccess
Aug 27 2015 03:25
OMFG, I'm going to lose my mind. So I've spent hours maybe like 3-4 with breaks on Chunky Monkey. Read a TON of stuff of multidimensional arrays, chunked arrays, and just everything I could think of in an array. NOT ONE TIME did anything mention that Chrome's Console doesn't display multidimensional arrays correctly.... I was console.log(result) if I would of done return result instead I would of been done like 2 hours ago.
chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:25
can someone elxplain what we need to do in bonfire: where art thou? I don'e understand what I'm suppposed to be looking for or coding. "Make a function that looks through an array (first argument) and returns an array of all objects that have equivalent property values (second argument)."
and the test case is:where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });
chipymunk
@chipymunk
Aug 27 2015 03:26
I have an object named dog, with assorted properties. I want to add sound inline and assign the property of bark to it... [ ] didnt work..
Patrick McWilliams
@patrickmac110
Aug 27 2015 03:26
@chriscrosscutler it should return [Tybalt, capulet]
you're trying to find matches to the "search parameter" and return whatever else is with it in the array
chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:27
@patrickmac110 why is that? just trying to understand. haha i'm confused
Prashanth Chandra
@prashcr
Aug 27 2015 03:28
@chipymunk I was just there..I tried assigning a function to dog.bark, didn't work either. Must be a bug
I just gave it a plain string and it worked
Patrick McWilliams
@patrickmac110
Aug 27 2015 03:28
@chriscrosscutler I think the bonfires here are preparing us to work with the things you'll be using in websites
Prashanth Chandra
@prashcr
Aug 27 2015 03:28
try dog.bark = "woof";
Patrick McWilliams
@patrickmac110
Aug 27 2015 03:29
like searching for a last name and finding all matches and returning their first names too
chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:30
oh... but how are Tybalt and capulet related? why does it return those two?
Patrick McWilliams
@patrickmac110
Aug 27 2015 03:30
real world: I wanna find all the students in my school with the first name john, but I want their last names and their ages
they're in the curly brakets
Prashanth Chandra
@prashcr
Aug 27 2015 03:30
@patrickmac110
purge(l, n, j)
out = out.filter(purge, ary, j);
you declared purge with 3 arguments but you're calling it with 0
Arik
@Alikdv
Aug 27 2015 03:30
hey guys somebody can explain to me Bonfire: Factorialize a Number thx
CamperBot
@camperbot
Aug 27 2015 03:30
if you want to thank someone, put an @ before their name!
chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:31
why wouldnt it return : Romeo, Montague? Sorry for the trouble
Prashanth Chandra
@prashcr
Aug 27 2015 03:31
So l, n, j are undefined
Patrick McWilliams
@patrickmac110
Aug 27 2015 03:32
@prashcr then how do I have purge search through my arrays or the initial inputs for that matter?
DTing
@dting
Aug 27 2015 03:32
@prashcr thats not really correct. purge is called with arguments element, index, arrayof the out array
chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:33
oh wait, so im looking through the first array to find a pair that has to do with the second word they give me? @patrickmac110
Patrick McWilliams
@patrickmac110
Aug 27 2015 03:33
@chriscrosscutler yes, basically
chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:33
haha I feel stupid! thanks @patrickmac110
CamperBot
@camperbot
Aug 27 2015 03:33
chriscrosscutler sends brownie points to @patrickmac110 :sparkles: :thumbsup: :sparkles:
:star: 210 | @patrickmac110 | http://www.freecodecamp.com/patrickmac110
Prashanth Chandra
@prashcr
Aug 27 2015 03:34
@patrickmac110
oops, you're right
But still, purge doesn't know about ary
Patrick McWilliams
@patrickmac110
Aug 27 2015 03:35
@prashcr yeah, that's my problem
how do I show it ary
DTing
@dting
Aug 27 2015 03:35
@patrickmac110 @prashcr actually purge does know. since you are using ary as the this argument of the callback
Prashanth Chandra
@prashcr
Aug 27 2015 03:35
Put all your logic you had in destroyer inside purge
@dting That's true as well. You can refer to ary as this[n] inside purge
Justin Crawford
@JCrawford1122
Aug 27 2015 03:36
bf truncate a string
CamperBot
@camperbot
Aug 27 2015 03:36

:fire:Bonfire: Truncate a string :link:

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

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

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

more info:  bf details | bf links | hint

Patrick McWilliams
@patrickmac110
Aug 27 2015 03:37
@dting so it has element, index, array, ary??
chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:37
@camperbot hint
Justin Crawford
@JCrawford1122
Aug 27 2015 03:37
links
bf links
chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:37
bf where art thou
CamperBot
@camperbot
Aug 27 2015 03:37

:fire:Bonfire: Where art thou :link:

function where(collection, source) {
  var arr = [];
  // What's in a name?
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });

Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).

more info:  bf details | bf links | hint

chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:39
bf where art thou hint
CamperBot
@camperbot
Aug 27 2015 03:39
Sorry, can't find a bonfire called where art thou hint. [ Check the map? ]
DTing
@dting
Aug 27 2015 03:39
function purge(element) {
  for (var i = 0; i < this.length; i++) {
    if (this[i] === element) {
      return false;
    }
  }
  return true;
}

function destroyer(arr) {
  return arr.filter(purge, arguments);
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Prashanth Chandra
@prashcr
Aug 27 2015 03:40
@dting i should start from 1..shouldn't it?
DTing
@dting
Aug 27 2015 03:40
this is how you can make your code work but i agree with prashcr. I'd just use an anon function inside destoryer
chipymunk
@chipymunk
Aug 27 2015 03:41
I'm going with that. Cuz I've stared at it for a few days and tried
DTing
@dting
Aug 27 2015 03:42
ya probably but the answer will be the same unless the array contains itself
Patrick McWilliams
@patrickmac110
Aug 27 2015 03:42
so use something like .pop and some logic loops
.filter() is confusing
DTing
@dting
Aug 27 2015 03:44
highly recommend you understand https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter and play with it somewhere like repl.it or your dev console
Tim
@timmcallister
Aug 27 2015 03:54
if I'm making a url with a string, would I need to replace spaces with %20?
chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:54

```
function destroyer(arr) {

for (var i = 0; i < arr.length; i++)
{
if(arr[i] === arguments)
{
arr[i].slice();
}
}
return arr;
}

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

``` am I calling the arguments wrong here?

chriscrosscutler
@chriscrosscutler
Aug 27 2015 03:54
am I calling the arguments wrong here?
Matt Everson
@matteverson
Aug 27 2015 03:54
@timmcallister in brief, yes, but there's more to it
Tim
@timmcallister
Aug 27 2015 03:55
@matteverson ok thx
CamperBot
@camperbot
Aug 27 2015 03:55
timmcallister sends brownie points to @matteverson :sparkles: :thumbsup: :sparkles:
:star: 293 | @matteverson | http://www.freecodecamp.com/matteverson
Matt Everson
@matteverson
Aug 27 2015 03:56
@chriscrosscutler Yes, arguments is an array. think arguments[0], arguments[1]
Justin Crawford
@JCrawford1122
Aug 27 2015 03:57
bf chunky monkey
CamperBot
@camperbot
Aug 27 2015 03:57

:fire:Bonfire: Chunky Monkey :link:

function chunk(arr, size) {
  // Break it up.
  return arr;
}

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

Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.

more info:  bf details | bf links | hint

Justin Crawford
@JCrawford1122
Aug 27 2015 03:57
hint
CamperBot
@camperbot
Aug 27 2015 03:57
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
DTing
@dting
Aug 27 2015 03:57
@chriscrosscutler arguments is an array like object you are comparing that object to a number. you would need to compare the number to each element in the arguments object. the other problem is I think you are trying to mutate the size of the object you are iterating. (arr[i].slice() isnt correct either). Use another strategy for storing the elements you want to return.
Jon Deng
@dengjonathan
Aug 27 2015 03:58
I'm working on bonfires and am trying to develop good process- anybody have a good system for how to solve a code problem, like first define goal, second sketch out solution on paper, third test hypothesis, etc.?
@dengjonathan But seriously, there's many ways to approach this. I was taught to break the problem into pieces by writing the goal down, then the steps needed to reach that goal, then the steps to reach each of the first-level steps.
I like to get each level of that down in code, so I write dummy statements when I don't actually know how to calculate a value.
Jon Deng
@dengjonathan
Aug 27 2015 04:04
@matteverson what is an example of a dummy statement?
i.e. i am working on a bonfire where you have to return longest word in a string
Matt Everson
@matteverson
Aug 27 2015 04:06
Say I have a function that will return a single value, but I don't know how I'm going to calculate it yet. I just make the function body return "test", to validate that the rest of the code (before and after this function) is working properly.
or return true;, or an array. Whatever rough structure that function will return when I'm done.
Jon Deng
@dengjonathan
Aug 27 2015 04:08
can you explain above further?
say in my example i have to return longest word in a string
so intermediate steps are:
  1. split string into array of individual words
  1. find length of words
  1. determine longest word
return length
Matt Everson
@matteverson
Aug 27 2015 04:09
ok
justjoolz
@justjoolz
Aug 27 2015 04:09
hello people of the camp!
Bonfire: Finders Keepers....
CamperBot
@camperbot
Aug 27 2015 04:10

:fire:Bonfire: Finders Keepers :link:

function find(arr, func) {
  var num = 0;
  return num;
}

find([1, 2, 3, 4], function(num){ return num % 2 === 0; });

Create a function that looks through an array (first argument) and returns the first element in the array that passes a truth test (second argument).

more info:  bf details | bf links | hint

Matt Everson
@matteverson
Aug 27 2015 04:10
Since this is a pretty short algorithm, you're probably not going to use many functions. So we'll take it step-by-step instead. I'd start by figuring out that first step, and just return that value. See what that looks like in the results.
justjoolz
@justjoolz
Aug 27 2015 04:10
I've finished it using a for loop
Matt Everson
@matteverson
Aug 27 2015 04:10
@justjoolz hello
justjoolz
@justjoolz
Aug 27 2015 04:10
@matteverson hi matt....
here has two versions that both work correctly
when I post the 2nd as an answer to FreeCodeCamp the second piece of code returns 3 not 8.....
Matt Everson
@matteverson
Aug 27 2015 04:12
@justjoolz you're pushing the index, not the value
justjoolz
@justjoolz
Aug 27 2015 04:12
( I made it into an array as I thought it was not exiting early.... now I'm not sure what the problem is )
haha
Matt Everson
@matteverson
Aug 27 2015 04:12
8 is in index 3
justjoolz
@justjoolz
Aug 27 2015 04:12
doh!
Matt Everson
@matteverson
Aug 27 2015 04:14
@dengjonathan After you see the array, write the next step, and then return or console.log() that, so you see what you're getting. The point is to only take small steps so you know what's changed and what needs to be fixed if something is wrong.
justjoolz
@justjoolz
Aug 27 2015 04:14
cheers :)
Matt Everson
@matteverson
Aug 27 2015 04:14
@justjoolz And can't you use Array.any() ?
justjoolz
@justjoolz
Aug 27 2015 04:15
codecamp recommended using array.some
which has different specifications..... one with an early return one that you can use like I did with the array....
that's what was catching me out....
Matt Everson
@matteverson
Aug 27 2015 04:16
@justjoolz nevermind, that's not in base JS
justjoolz
@justjoolz
Aug 27 2015 04:17
that's what I thought :)
Tim P
@xTimpi
Aug 27 2015 04:18
anyone else having MASSIVE lag on the codeschool angular.js course? its near impossible to write code because of the lag
Jon Deng
@dengjonathan
Aug 27 2015 04:19
@matteverson thanks! i guess what I am going with is commenting out the steps i want to take to solve problem, then console.log each step to make sure it returns the values i wanted it to
CamperBot
@camperbot
Aug 27 2015 04:19
dengjonathan sends brownie points to @matteverson :sparkles: :thumbsup: :sparkles:
:star: 294 | @matteverson | http://www.freecodecamp.com/matteverson
Matt Everson
@matteverson
Aug 27 2015 04:19
@dengjonathan That's a good approach
Patrick McWilliams
@patrickmac110
Aug 27 2015 04:29
@dting okay I understand it now, and thanks for showing me repl.it and helping me out
CamperBot
@camperbot
Aug 27 2015 04:29
patrickmac110 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 722 | @dting | http://www.freecodecamp.com/dting
Patrick McWilliams
@patrickmac110
Aug 27 2015 04:30
console.log() is my friend
Jon Deng
@dengjonathan
Aug 27 2015 04:31
hmm
my for loop is only returning first value
 for (i=0; i< (array.length + 1); i++) {

    return (array[i].length);
  }
Jon Deng
@dengjonathan
Aug 27 2015 04:39
@oab00 fudge me hmm so i will put return outside for loop
how do i call the array.length function without using return?
Patrick McWilliams
@patrickmac110
Aug 27 2015 04:40
thanks @\all
CamperBot
@camperbot
Aug 27 2015 04:40
if you want to thank someone, put an @ before their name!
Patrick McWilliams
@patrickmac110
Aug 27 2015 04:40
@/all
thanks @/all
CamperBot
@camperbot
Aug 27 2015 04:41
patrickmac110 sends brownie points to @all :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for all
Patrick McWilliams
@patrickmac110
Aug 27 2015 04:41
night
Absalon Castañon Avila
@absalnC
Aug 27 2015 04:45
hi everyone
Prashanth Chandra
@prashcr
Aug 27 2015 04:45
Why doesn't this work? It functions as expected, but doesn't pass the test "use selectors shown in the description"
// Only change code below this line.
    $($('.slot')[0]).html(slotOne);
    $($('.slot')[1]).html(slotTwo);
    $($('.slot')[2]).html(slotThree);
waypoint: bring your javascript slot machine to life
@absalnC hi
Omar
@oab00
Aug 27 2015 04:47
@dengjonathan what do u want to do exactly?
logging to console ?
Absalon Castañon Avila
@absalnC
Aug 27 2015 04:47
I have a problem with one of my scripting exercises, when the page loads it gets stuck and i can't do anything. I haven't solved it
Omar
@oab00
Aug 27 2015 04:48
@absalnC clear ur local storage
type wiki storage to see how to do it
Absalon Castañon Avila
@absalnC
Aug 27 2015 04:51
@oab00 thanks, but type where?
CamperBot
@camperbot
Aug 27 2015 04:51
absalnc sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 260 | @oab00 | http://www.freecodecamp.com/oab00
Omar
@oab00
Aug 27 2015 04:51
here in the chat ! ;)
Absalon Castañon Avila
@absalnC
Aug 27 2015 04:51
wiki storage
CamperBot
@camperbot
Aug 27 2015 04:51

:point_right: clear your browser's local storage [wiki]

Removing all your locally stored challenges will solve many problems related to the browser crashing on FreeCodeCamp

In Chrome:

  • On 'freecodecamp.com' open your console
    • Windows: Ctrl + Shift + J
    • Mac OS: Cmd + Opt + J
  • Go to resources tab(chrome).
    • There click on the localStorate link in the nav bar on the right.
  • Delete all the entries on the right side.
  • See if this solves your issue

Alternatively, if you are having issue's with a specific challenge freezing your browser find the name of that challenge in local storage and delete just that one.
:pencil: read more about clear your browsers local storage on the FCC Wiki

Jon Deng
@dengjonathan
Aug 27 2015 04:52
@oab00 I am staring with array of strings, and I want to convert into an array with all the lengths of the strings
Omar
@oab00
Aug 27 2015 04:53
@dengjonathan right so u want to convert each item in the array from string to length not return
 for (i=0; i< (array.length + 1); i++) {

    return (array[i].length);
  }
instead of return access the item to change it array[i] = 'something'
Absalon Castañon Avila
@absalnC
Aug 27 2015 04:54
@oab00 it worked perfectly, thanks again
CamperBot
@camperbot
Aug 27 2015 04:54
absalnc sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:warning: absalnc already gave oab00 points
Omar
@oab00
Aug 27 2015 04:55
nice :)
Haremantra
@haremantra
Aug 27 2015 04:56
Hi, I have a question related to the HTML-CSS course. The lesson teaches the order of conflicting style assignments of color. In this lesson, the Hello World text is to have the color white, which the emulator did represent. However, the program states the classes for orange, pink and blue are not correct, where did I go wrong?
CamperBot
@camperbot
Aug 27 2015 04:56

welcome to FreeCodeCamp @haremantra!

Haremantra
@haremantra
Aug 27 2015 04:56

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

orange-text {

color: orange;

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

<h1 style="color: white" class="orange-text"class="pink-text" "blue-text">Hello World!</h1>

the hi element should have the id of orange text, the "orange-text {" does have the # before it
Jon Deng
@dengjonathan
Aug 27 2015 05:00
@oab00 like
array[i] = array.length
Omar
@oab00
Aug 27 2015 05:09
@dengjonathan yep
@prashcr u there?
@prashcr You should have used the the selector given in the description to select each slot
Prashanth Chandra
@prashcr
Aug 27 2015 05:13
@oab00 that's exactly what I used.
Omar
@oab00
Aug 27 2015 05:13
@prashcr seems like it literally means to use $($(".slot")[0]).html(slotOne);
with double air quotes
Prashanth Chandra
@prashcr
Aug 27 2015 05:13
I literally copy-pasted
Hans van Riet
@hansinla
Aug 27 2015 05:13
@haremantra color: white is missing ; Then your classes should be together separated by a space for example class=“orange-text pink-text"
Omar
@oab00
Aug 27 2015 05:14
@prashcr yeah just change it from single quotes to double quotes and it will work :)
Prashanth Chandra
@prashcr
Aug 27 2015 05:15
Oh!
Omar
@oab00
Aug 27 2015 05:15
seems like a bug that needs reporting xD
Prashanth Chandra
@prashcr
Aug 27 2015 05:16
Indeed, I'll do that
thanks @oab00
CamperBot
@camperbot
Aug 27 2015 05:16
prashcr sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 261 | @oab00 | http://www.freecodecamp.com/oab00
ascended2
@ascended2
Aug 27 2015 05:30
lastName = Lovelace
The third last letter of lastName should be a "v"
that is a tad misleading
Javed Khan
@JavedKhan1588
Aug 27 2015 05:35
blob
what is the problem in the above code??
ascended2
@ascended2
Aug 27 2015 05:38
@JavedKhan1588 you should have
<style>
  body {
    background-color: black;
    color: green;
      font-family: Monospace;

  }

</style>
Dhananjay Mehrotra
@dj8923
Aug 27 2015 05:40
@JavedKhan1588 @ascended2 is correct :)
davidjvieira
@davidjvieira
Aug 27 2015 05:41
@JavedKhan1588 Monspace with a capital M and 'color' not 'background-color'
Dhananjay Mehrotra
@dj8923
Aug 27 2015 05:41
@ascended2 thanks
CamperBot
@camperbot
Aug 27 2015 05:41
dj8923 sends brownie points to @ascended2 :sparkles: :thumbsup: :sparkles:
:star: 133 | @ascended2 | http://www.freecodecamp.com/ascended2
Javed Khan
@JavedKhan1588
Aug 27 2015 05:43
@ascended2 how could you figure out that background-color should be black?? as per mentioned in problem statement??
James Niroomand
@jniro
Aug 27 2015 05:43
did anyone else had problem with this $("#left-well").parent().css("background-color", "red");
ascended2
@ascended2
Aug 27 2015 05:44
@JavedKhan1588 I just remembered the waypoint. Been doing a bunch today.
@JavedKhan1588 it is just extra code from the previous waypoint as well.
James Niroomand
@jniro
Aug 27 2015 05:47
never mind got it
$("#target1").parent().css("background-color", "red");
ahmeddin
@ahmeddin
Aug 27 2015 05:56
anyone doing bonfires
Joey Lopez
@joeylopez21
Aug 27 2015 06:30
Screen Shot 2015-08-27 at 2.29.12 AM.png
hi guys, so im doing the bonfire: reverse a string and im completely lost, i've tried searching all over but with no luck
:worried: help...
Nnxoxo
@Nnxoxo
Aug 27 2015 06:31
@joyelopez21 do u have some code?
Joey Lopez
@joeylopez21
Aug 27 2015 06:35
i know im suppose to use the str.split().reverse().join() but i dont have a clue as to even how to start
Nnxoxo
@Nnxoxo
Aug 27 2015 06:36
@joyelopez21 so u have to have 2 strings
@joyelopez21 one reversed and the other not and check their equality
Joey Lopez
@joeylopez21
Aug 27 2015 06:37
Screen Shot 2015-08-27 at 2.36.59 AM.png
that's what i have to do
Nnxoxo
@Nnxoxo
Aug 27 2015 06:38
@joyelopez21 show the code
thefacilitator
@thefacilitator
Aug 27 2015 06:38
Hi everyone, I'm stuck on the http://www.freecodecamp.com/challenges/waypoint-use-conditional-logic-with-ifelse-statements section of Basic Javascript. Apparently I need to use if-else to show heads when the number is 0, and tails if 1. However, my code just doesn't work at all:

```if (flip === 0) {

return(heads);

}

else {

return(tails);

}

```if (flip === 0) {

return(heads);

}

else {

return(tails);

}```

Well damn, my formatting efforts aren't working. I won't try again :/
Mbos95
@Mbos95
Aug 27 2015 06:39
Hey guys, I am slightly confused at Bonfire: Palindrome. Can someone tell me all the words I need to check if they are a palindrome?
Nnxoxo
@Nnxoxo
Aug 27 2015 06:40
@Mbos95 do u have code?
Joey Lopez
@joeylopez21
Aug 27 2015 06:40
@Nnutthowze i dont even know how to start it
Mbos95
@Mbos95
Aug 27 2015 06:41
@Nnutthowze Well, it doesn't even have to do with the code yet. I just don't know what words to use
bonfire palindrome
CamperBot
@camperbot
Aug 27 2015 06:41

: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

Mbos95
@Mbos95
Aug 27 2015 06:41
bf details
CamperBot
@camperbot
Aug 27 2015 06:41

: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.
A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.
You'll need to remove punctuation and turn everything lower case in order to check for palindromes.
We'll pass strings with varying formats, such as "racecar", "RaceCar", and "race CAR" among others.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Nnxoxo
@Nnxoxo
Aug 27 2015 06:41
@joyelopez21 I said what u should do. To have 2 strings one reversed and other not
Mbos95
@Mbos95
Aug 27 2015 06:42
See, they say "We'll pass strings with varying formats, such as "racecar", "RaceCar", and "race CAR" among others."
Nnxoxo
@Nnxoxo
Aug 27 2015 06:42
and check their equality, ofc, u need to do couple of things there
Mbos95
@Mbos95
Aug 27 2015 06:42
but they don't clearly tell me what they are going to pass through! so how am I to know what kind of discrepancies will be in there
Omar
@oab00
Aug 27 2015 06:43
hey @Mbos95 :)
Nnxoxo
@Nnxoxo
Aug 27 2015 06:43
@Mbos95, do u have smth written?
Mbos95
@Mbos95
Aug 27 2015 06:43
@Nnutthowze No not yet. Just confused at the beginning xD
Omar
@oab00
Aug 27 2015 06:43
they tell u all the tests at the bottom left after u run the code :p
Mbos95
@Mbos95
Aug 27 2015 06:43
@oab00 Hey! :D Back with my bonfire monsters
Omar
@oab00
Aug 27 2015 06:44
xD
example: assert.deepEqual(palindrome("not a palindrome"), false); means this shouldn't pass
so return false
thefacilitator
@thefacilitator
Aug 27 2015 06:44
Alright, I'll try again with (hopefully) better formatting this time. Currently doing Use Conditional Logic with IfElse Statements but can't get my code to work
Nnxoxo
@Nnxoxo
Aug 27 2015 06:44
@joyelopez21 sorry, dude, it's the simplest challenge, u need to split ur string reverse it and join
Mbos95
@Mbos95
Aug 27 2015 06:45
a tip for FCC is to make it more clear xD javascript is confusing to begin with and then they make it some weird poetry to figure out what to do
thefacilitator
@thefacilitator
Aug 27 2015 06:45
if (0 === flip) {

  return("heads");

}

else {

  return("tails");

}
Nnxoxo
@Nnxoxo
Aug 27 2015 06:45
@Mbos95 so u need to have 2 strings raceCar and the other reversed and check them
Joey Lopez
@joeylopez21
Aug 27 2015 06:45
@Nnutthowze thanks man, i figured it out
CamperBot
@camperbot
Aug 27 2015 06:45
joyelopez21 sends brownie points to @nnutthowze :sparkles: :thumbsup: :sparkles:
:star: 289 | @nnutthowze | http://www.freecodecamp.com/nnutthowze
Mbos95
@Mbos95
Aug 27 2015 06:45
hmm oke oke. Thank you @oab00 I'll just get started. I'll probably be back within a minute!
Omar
@oab00
Aug 27 2015 06:46
@Mbos95 good luck :sweat_smile:
@thefacilitator formatting worked !
Mbos95
@Mbos95
Aug 27 2015 06:46
thanks @Nnutthowze
CamperBot
@camperbot
Aug 27 2015 06:46
mbos95 sends brownie points to @nnutthowze :sparkles: :thumbsup: :sparkles:
:star: 290 | @nnutthowze | http://www.freecodecamp.com/nnutthowze
thefacilitator
@thefacilitator
Aug 27 2015 06:47
@oab00 Well I worked out one thing today at least! Unfortunately my code still doesn't work, though I'm not sure if it's the code itself or my rubbish web browser
Actually, worked it out - I needed an extra } on the end of the code, duh!
Omar
@oab00
Aug 27 2015 06:49
@thefacilitator haha great .. another thing working :)
thefacilitator
@thefacilitator
Aug 27 2015 06:50
@oab00 Just trying to improve a little every day, haha
Mbos95
@Mbos95
Aug 27 2015 06:50
@oab00 Hey oab! does it need to work for all words in general or can I make it so these words all pass?
Omar
@oab00
Aug 27 2015 06:51
of course they should work for everything .. but these are the test they run to check if ur code is correct to their standards lol
Mbos95
@Mbos95
Aug 27 2015 06:51
aww oke
Could've solved it with ease otherwise xD
Omar
@oab00
Aug 27 2015 06:51
u can't just take each test and run if else for them that's just way too lazy xD
sid9394
@sid9394
Aug 27 2015 06:53
Hey guys, How would I nest all the HTML that iv written in a div element and add a class to it?
Mbos95
@Mbos95
Aug 27 2015 06:53
@oab00 that is why I am sidekick
Omar
@oab00
Aug 27 2015 06:54
@Mbos95 u want to be one of the greatest javascripters.. remember? :p
Mbos95
@Mbos95
Aug 27 2015 06:58
@oab00 Oh yea.. true!
Mbos95
@Mbos95
Aug 27 2015 07:04
@oab00 You like my new picture? ^^
Omar
@oab00
Aug 27 2015 07:08
@Mbos95 lol it's alright
Mbos95
@Mbos95
Aug 27 2015 07:08
@oab00 a random picture xD
Binny Kim
@removed~BinnyK
Aug 27 2015 07:15

Hi guys been working on this problem on and off for a few days. Trying to find a solution to a problem I'm facing

The code...

function smallestCommons(arr) {

  // Check both numbers in arr. Put small number first followed by larger.
  var orderedArr = [];

  if (arr[1] > arr[0]) {
    orderedArr = [arr[0], arr[1]];
  } else {
    orderedArr = [arr[1], arr[0]];
  }

  // Create a new array "expandedArr" with ALL values, lowest to highest.
      // Find the product of all elements in expandedArr, place into totalProduct

  var expandedArr = [];
  var totalProduct = 1;

  for (var i = orderedArr[0]; i <= orderedArr[1]; i++) {
    expandedArr.push([i]);
    totalProduct *= i;
  }

  for (var j = 1; j <= totalProduct; j++) {

      // replace the 5,4,3,2,1 numbers with newArr numbers without hardcoding.
      if (j % 5 === 0 &&
          j % 4 === 0 &&
          j % 3 === 0 &&
          j % 2 === 0 &&
          j % 1 === 0
         ) {
        return j;
      }
  }
}

smallestCommons([1,5]);
// problem if the array passed into the function = [1,13] for example.

The problem in on line 23+. Looping through each number (total product i) to check if it is divisible by the full array (expanded array)

Any help would be awesome.... Also I have no idea why the code looks white...
BTW it is the smallest common multiple bonfire
Omar
@oab00
Aug 27 2015 07:24
@BinnyK so for each number from 1 to totalProduct check if it's divisible by all elements of expandedArr
= two loops one inside the other
Binny Kim
@removed~BinnyK
Aug 27 2015 07:25
@oab00 Yeah checking if each number from 1 to totalProduct is div by all elements of expandedArr
Santhosh Devaraj
@santhoshdevaraj
Aug 27 2015 07:26
@sid9394 i would just write likethis..<div class=“watever”>my other html elements</div>
Omar
@oab00
Aug 27 2015 07:27
@BinnyK yeah so u need two loops
for (each number from 1 to totalProduct) {
    for (each element of expandedArr) {
       check if it's divisable
    }
}
Woolwit
@Woolwit
Aug 27 2015 07:30
Was really motoring along there for a few months but not anymore...
Bonfire: Convert HTML Entities Aug 13, 2015
Bonfire: Spinal Tap Case Aug 19, 2015
Bonfire: Sum All Odd Fibonacci Numbers Aug 25, 2015
tjstinso
@tjstinso
Aug 27 2015 07:32
losing interest?
Binny Kim
@removed~BinnyK
Aug 27 2015 07:33
@oab00 Oh crap I just created an endless loop haha
Mbos95
@Mbos95
Aug 27 2015 07:36
Oh no, I can see your endless loop!Oh no, I can see your endless loop!Oh no, I can see your endless loop!Oh no, I can see your endless loop!Oh no, I can see your endless loop!Oh no, I can see your endless loop!Oh no, I can see your endless loop!
Binny Kim
@removed~BinnyK
Aug 27 2015 07:39

I'm having trouble writing that part out...

```

  for (var j = 1; j <= totalProduct; j++) {

    for (var k = 0; k < expandedArr.length; k++) {

      if ( j % expandedArr[k] !== 0) {

      } else {

      }

    }
  }
What should i be writing in the if loop?
If j (total Product number) is divisible by expandedArr[k]... then what?
Todd Johnson
@TJohnson93
Aug 27 2015 07:40

Hey Guys, another Angular issue: I have the following:
HTML

<div class="menu" ng-controller="MainController">
    <div class="item" ng-repeat="client in clients">
        <img ng-src="{{ client.logo }}" alt=""> {{ client.name }}
    </div>
</div>

Controller

app.controller('MainController', ['$scope', function($scope) {
    $scope.clients = {
           name: 'Epworth Healthcare',
           name_short: 'Epworth',
        logo: 'assets/img/client/logo_epworth_avatar.png',
        industry: 'Healthcare'
      },
    {
        name: 'Telstra',
        name_short: 'Telstra',
        logo: 'assets/img/client/logo_telstra_avatar.png',
        industry: 'Telecommunications'
    }
}]);

However I get the following error in the console:

TypeError: null is not an object

I have attached the app to the body tag like so <body ng-app="coeus”> with this the app initialisation in the app.js file: like so:

var app = angular.module('coeus', []);

And I include both the app.js and Controller in the HTML like so:

<!-- Modules -->
<script type="text/javascript" src="js/app.js"></script>

<!-- Controllers -->
<script type="text/javascript" src="js/controllers/MainController.js"></script>

Can anyone see why I’m getting a Null object error

CamperBot
@camperbot
Aug 27 2015 07:40
:trollface: troll problems? notify admins here
DTing
@dting
Aug 27 2015 07:44
@TJohnson93 your clients is malformed
@TJohnson93 that should be an array of objects right now its just werid
app.controller('MainController', ['$scope', function($scope) {
    $scope.clients = [{
           name: 'Epworth Healthcare',
           name_short: 'Epworth',
        logo: 'assets/img/client/logo_epworth_avatar.png',
        industry: 'Healthcare'
      },
    {
        name: 'Telstra',
        name_short: 'Telstra',
        logo: 'assets/img/client/logo_telstra_avatar.png',
        industry: 'Telecommunications'
    }];
}]);
CamperBot
@camperbot
Aug 27 2015 07:45
:trollface: troll problems? notify admins here
Todd Johnson
@TJohnson93
Aug 27 2015 07:50
@dting OH DEEEERRRR… I’ve been looking at it for too long… Thank you so much
CamperBot
@camperbot
Aug 27 2015 07:50
tjohnson93 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 724 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 27 2015 07:50
nps
Binny Kim
@removed~BinnyK
Aug 27 2015 07:52
@dting Would love some help on this problem im having if you get a chance!
DTing
@dting
Aug 27 2015 07:53
hmm
i solved that problem using a different approach with euclid's greatest common divisor formula and lowest common multiple
Binny Kim
@removed~BinnyK
Aug 27 2015 07:54
Ah i see... I'm having trouble with what to do when the number IS divisible by the first element of the array...
DTing
@dting
Aug 27 2015 07:55
you can use another nested for loop
Binny Kim
@removed~BinnyK
Aug 27 2015 07:56
For example... when the number is divisible by the first element it loops through... then what? How do I tell it to do the next array? And if it isnt... how do i tell it to jump to the next number to try it on? When i try return something, it breaks the whole code....
DTing
@dting
Aug 27 2015 07:56
you can use continue
continue
or actually you might use break lemme look at it again
Binny Kim
@removed~BinnyK
Aug 27 2015 07:58
Argh I keep making endless loops haha. Also I didn't think if statements could use breaks
Costas Chaitas
@CostasChaitas
Aug 27 2015 08:02
i want to create a contact form for my portfolio zipline
can i make it happen without backend?(php,nodejs and so)?
Ian Hyndman
@ian-splintercell-splinter
Aug 27 2015 08:02

Hi im stuck on this. ? please can any one help. //var ourArray = [1,2,3];
//var ourData = ourArray[0]; // equals 1

var myArray = [1,2,3];

DTing
@dting
Aug 27 2015 08:05
  for (var j = expandedArr[expandedArr-1]; j <= totalProduct; j++) {
    // if every j % value in expandedArr  === 0, return j
  }
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every
@ian-splintercell-splinter what waypoint is that?
Ian Hyndman
@ian-splintercell-splinter
Aug 27 2015 08:07
135 Waypoint: Access Array Data with Indexes
DTing
@dting
Aug 27 2015 08:08
Create a variable called myData and set it to equal the first value of myArray.
this is the example `//var ourData = ourArray[0]; // equals 1"
Ian Hyndman
@ian-splintercell-splinter
Aug 27 2015 08:10
brilliant thank you for helping var myData = myArray[0]; // equals 1
CamperBot
@camperbot
Aug 27 2015 08:10
if you want to thank someone, put an @ before their name!
Ian Hyndman
@ian-splintercell-splinter
Aug 27 2015 08:11
@dting
@ dting
DTing
@dting
Aug 27 2015 08:11
nps
Ian Hyndman
@ian-splintercell-splinter
Aug 27 2015 08:15
could not find it any where. just the wrong answers
Costas Chaitas
@CostasChaitas
Aug 27 2015 08:18
@dting do you know about contact forms?
i am workin on the porfolio zipline and i want to make a contact form work
Binny Kim
@removed~BinnyK
Aug 27 2015 08:19
@dting Hey thanks for your help. Still not solved but I need to head off.
CamperBot
@camperbot
Aug 27 2015 08:19
binnyk sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 725 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 27 2015 08:22
@BinnyK nps. good luck!
how?
Erik Kynast
@carnivean
Aug 27 2015 08:38
I just finished the first advanced algo scripting, I am so proud xD
Pete McGlone
@MoggyPete
Aug 27 2015 08:38
Congrats
Farhad ali
@alifarhad
Aug 27 2015 08:45

can anyone help me understand what this is trying to ask me ?
`Now you know three ways of targeting elements: by type: $("button"), by class: $(".btn"), and by id $("#target1").

Use each of these jQuery selectors to target your button element with the class btn and the id target1.

Use the addClass() jQuery function to give the element one new class for each selector: animated, shake, and btn-primary.`

I can't quite follow the directions here
guys? -_-
Simeon
@Boasbabs
Aug 27 2015 08:47
This message was deleted
CamperBot
@camperbot
Aug 27 2015 08:47
no wiki entry for: div tag not working
:pencil: click here to create one now!after creating your page type update to reload it here
Simeon
@Boasbabs
Aug 27 2015 08:48
This message was deleted
This message was deleted
CamperBot
@camperbot
Aug 27 2015 08:49
no wiki entry for: div tag not working link hrefhttpfontsgoogleapiscomcssfamilylobster relstylesheet typetextcssstyle h2 font-family lobster monospace thick-green-border border-color green border-width 10px border-style solid border-radius 50 stylediv classcontainer-fluid div classrow div classcol-xs-8h2 classtext-primary text-centercatphotoapph2div div classcol-xs-4img classimg-responsive thick-green-border srchttpsbitlyfcc-relaxing-catdiv div img srchttpbitlyfcc-running-cats classimg-responsive div classrow div classcol-xs-4 button classbtn btn-block btn-primarylikebutton div div classcol-xs-4 button classbtn btn-block btn-infoinfobutton div div classcol-xs-4 button classbtn btn-block btn-dangerdeletebutton div div pthings cats span classtext-dangerlovespanp ul licat nipli lilaser pointersli lilasagnali ul ptop 3 things cats hatep ol liflea treatmentli lithunderli liother catsli ol form actionsubmit-cat-photo labelinput typeradio nameindoor-outdoor indoorlabel labelinput typeradio nameindoor-outdoor outdoorlabel labelinput typecheckbox namepersonality lovinglabel labelinput typecheckbox namepersonality lazylabel labelinput typecheckbox namepersonality crazylabel input typetext placeholdercat photo url required button typesubmitsubmitbutton formdiv
:pencil: click here to create one now!after creating your page type update to reload it here
Owen
@owencampbell
Aug 27 2015 08:49
@alifarhad Hi, it's asking you to make the JQuery call 3 times using each different selector and for each call assign 1 of those properties.
Farhad ali
@alifarhad
Aug 27 2015 08:51
but there are only two properties namely, btn-primary and animated shake given and I have got 3 selectors
thank you @owencampbell got it worked
CamperBot
@camperbot
Aug 27 2015 08:53
alifarhad sends brownie points to @owencampbell :sparkles: :thumbsup: :sparkles:
:star: 169 | @owencampbell | http://www.freecodecamp.com/owencampbell
Paweł
@ridlez
Aug 27 2015 08:58
hi, could anyone help me with zipline building quote machine? I've set background image, but I do not know how to write text over it
when I do standart <h1> etc then background image breaks
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 09:00
@ridlez how do you set the background ? as an html element using <img> or a css property ?
Paweł
@ridlez
Aug 27 2015 09:01
<div id="bg">
<img src="http://i.imgur.com/fU0XhVE.jpg" alt="background image">

</div>
and I have css property that makes it full screen
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 09:03
don't do so, try to remove it from your html . and go to your style sheet and write:

bg{background-image: url(http://i.imgur.com/fU0XhVE.jpg" alt="background image);}

Costas Chaitas
@CostasChaitas
Aug 27 2015 09:04
i have a question!i am making my portfolio zipline in codepen!when i put on the editor to turn on full page i see the contact form first and not the 'home' as i wanted !!!anyone can help??http://codepen.io/rasakos/full/PqMvmG/
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 09:04
target your div by id "#bg"
Omar
@oab00
Aug 27 2015 09:06
@ridlez should do it like this
http://codepen.io/anon/pen/pjzEEj
Peter Daily
@thepeted
Aug 27 2015 09:06
@rasakos it appears last for me.. using Chrome.
Costas Chaitas
@CostasChaitas
Aug 27 2015 09:07
you see normally the 'home section' first?
i use chrome too
i mean when you refresh the page what it appears?
Omar
@oab00
Aug 27 2015 09:10
hmm it's because selector goes to first input box not sure how to fix that
Paweł
@ridlez
Aug 27 2015 09:10
contact appears first for me
try to change the order of those
@oab00 @Abdelaziz18003 yea, but when you make the window smaller it changes into more photos
Vanja Valent
@walent021
Aug 27 2015 09:11
Hello... Is there explanation somewhere how "Math.floor(Math.random() * (1 - 0 + 1)) + 0" works?
Peter Daily
@thepeted
Aug 27 2015 09:13
@rasakos yes, even when I refresh. I am using quite an old version of Chrome (I'm at work)
odd!
Aleksandar B.
@aleksandar-b
Aug 27 2015 09:15
I want my div to have the height of window, but how to do that in Bootstrap?
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 09:15
@walent021 this expression give you a random number ( 0 or 1) .. you got it or you need explanation ?
Omar
@oab00
Aug 27 2015 09:15
@rasakos try add this to js $('input').blur();
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 09:16
@ridlez I did not understand your prblem well
Soumya Rauth
@soumyaRauth
Aug 27 2015 09:16
I need a api link from which I can fetch JASON data for zipline local weather . Help please.
Paweł
@ridlez
Aug 27 2015 09:18
@samosale http://jsfiddle.net/ntLpg/17/ check this
@Abdelaziz18003 thanks anyway for help :D
CamperBot
@camperbot
Aug 27 2015 09:18
ridlez sends brownie points to @abdelaziz18003 :sparkles: :thumbsup: :sparkles:
:star: 168 | @abdelaziz18003 | http://www.freecodecamp.com/abdelaziz18003
Paweł
@ridlez
Aug 27 2015 09:18
@oab00 thanks
Vanja Valent
@walent021
Aug 27 2015 09:19
@dting @Abdelaziz18003 So the 1 and 0 are just max and min, and it's always (max - min + 1 ) + min? and it can only be those two numbers... i think i got it...
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 09:19
you are welcom @ridlez
Soumya Rauth
@soumyaRauth
Aug 27 2015 09:19
I need a api link from which I can fetch JASON data for zipline local weather . Help please.
Vanja Valent
@walent021
Aug 27 2015 09:21
I'm just speeding through the waypoints not sure if i'll remember anything :D
Aleksandar B.
@aleksandar-b
Aug 27 2015 09:21
@ridlez but your height is dependent on the content..I just deleted the content and it shinked. I just want to make a page that is splited verticaly by half, and to give each side it's on background color.
Peter Daily
@thepeted
Aug 27 2015 09:23
@soumyaRauth check out https://www.mashape.com/ - its a searchable directory of APIs
DTing
@dting
Aug 27 2015 09:24
basically multiplying math.random() by a number n will give you a number between [0, n) inclusive, exclusive. then using the floor function will round it down. adding a number x to it will give you a number between [x, x+n]
Rabin Shrestha
@jyapujuju
Aug 27 2015 09:28
function end(str, target) {
  // "Never give up and good luck will find you."
  var i=str.length-1;
  var q=str.split("");
  console.log(i);
  console.log(q);
  console.log(q[i]);
  if (q[i]=target){
    return 'true';
  }
  // -- Falcor
  return str;
}
end('Bastian', 'n');
i can't pass with this code
DTing
@dting
Aug 27 2015 09:30
@jyapujuju you are only checking if the ith letter of str (which is also out of bounds in your case) is equal to the target you need to check if the last target.length characters are = the the last target.length characters of str
bf end
CamperBot
@camperbot
Aug 27 2015 09:30

:fire:Bonfire: Confirm the Ending :link:

function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  return str;
}

end('Bastian', 'n');

Check if a string (first argument) ends with the given target string (second argument).

more info:  bf details | bf links | hint

DTing
@dting
Aug 27 2015 09:30
bf links
CamperBot
@camperbot
Aug 27 2015 09:30
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 09:32
@walent021 the Math.random() function generate a random number between 0 and 1. let's assume it is 0.6**. when you multiply this number by 2 it will be 1.2** . the Math.floor() function return the natural part of the number it means in this case it returns 1.
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 09:34
hi campers, what's wrong with my code in bonefire seek and destroy
function destroyer(arr) {
  // Remove all the values
  var filtred = arr;
  for(var i = 1; i < arguments.length; i++){
    filtred = filtred.filter(function(value){
      return value !== arguments[i];
    });
  }
  return filtred;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
could some one show a working code ?
Omar
@oab00
Aug 27 2015 09:35
@samosale even better one https://jsfiddle.net/obncr1wf/1/
Aleksandar B.
@aleksandar-b
Aug 27 2015 09:36
@oab00 thanks for your help, but I wanted to know how to do this in bootstrap
CamperBot
@camperbot
Aug 27 2015 09:36
samosale sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 265 | @oab00 | http://www.freecodecamp.com/oab00
Omar
@oab00
Aug 27 2015 09:36
why ?
Aleksandar B.
@aleksandar-b
Aug 27 2015 09:37
@oab00 i am learning bootstrap, that's all
DTing
@dting
Aug 27 2015 09:37
@Abdelaziz18003 the anonymous function has it's own arguments object.
Costas Chaitas
@CostasChaitas
Aug 27 2015 09:37
@oab00 what's this $('input').blur(); ??/
DTing
@dting
Aug 27 2015 09:38
@Abdelaziz18003 you need to make another name in the outside scope to use it in the anonymous function
for example:
var args = arguments;
Rabin Shrestha
@jyapujuju
Aug 27 2015 09:39
@dting
function end(str, target) {
  // "Never give up and good luck will find you."
  var i=str.length-1;
  var j=target.length-1;

  var q=str.split("");
  var p=str.split("");
  console.log(i);
  console.log(q);
  console.log(q[i]);
  if (q[i]=p[j]){
    return 'true';
  }
  else{
    return 'false';
  }
  // -- Falcor
  return str;
}
end('Bastian', 'n');
even this is error
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 09:40
thanks a lot @dting it works
CamperBot
@camperbot
Aug 27 2015 09:40
abdelaziz18003 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 727 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 27 2015 09:40
you either need to loop over the letters. or you need to use str.substr to get a the last part of the str to compare to target.
right now you are still just comparing the last letter
Omar
@oab00
Aug 27 2015 09:41
@samosale this is with bootstrap lol https://jsfiddle.net/obncr1wf/2/
Abel
@Oroko
Aug 27 2015 09:43
How does one use the unshif function in javascript ?
Aleksandar B.
@aleksandar-b
Aug 27 2015 09:46
@oab00 tnx
CamperBot
@camperbot
Aug 27 2015 09:46
samosale sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:warning: samosale already gave oab00 points
Rabin Shrestha
@jyapujuju
Aug 27 2015 09:51
@dting
function end(str, target) {
  // "Never give up and good luck will find you."
  var i=str.substr(str.length-1);
  var j=target.substr(target.length-1);


  console.log(i);
  console.log(j);
  if (i=j){
    return 'true';
  }
  else{
    return 'false';
  }
  // -- Falcor
  return str;
}
end('Bastian', 'n');
what did i wrong here?
Abel
@Oroko
Aug 27 2015 09:52
@dting Thank you very much
CamperBot
@camperbot
Aug 27 2015 09:52
oroko sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 729 | @dting | http://www.freecodecamp.com/dting
Abel
@Oroko
Aug 27 2015 09:52
@oab00 thank you very much
DTing
@dting
Aug 27 2015 09:53
function end(str, target) {
  // "Never give up and good luck will find you."
  var i=str.substr(str.length-1); // this still gives you the last letter for str
  var j=target.substr(str.length-1); // this isnt needed


  console.log(i);
  console.log(j);
  if (i=j){ // this should compare i to target
    return 'true';
  }
  else{
    return 'false';
  }
  // -- Falcor
  return str; // this can't be reached and should just be removed
}
end('Bastian', 'n');
bf end
CamperBot
@camperbot
Aug 27 2015 09:53

:fire:Bonfire: Confirm the Ending :link:

function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  return str;
}

end('Bastian', 'n');

Check if a string (first argument) ends with the given target string (second argument).

more info:  bf details | bf links | hint

DTing
@dting
Aug 27 2015 09:53
bf links
CamperBot
@camperbot
Aug 27 2015 09:53
DTing
@dting
Aug 27 2015 09:53
click that link
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.)
Nnxoxo
@Nnxoxo
Aug 27 2015 09:54
@dting could u help?
DTing
@dting
Aug 27 2015 09:55
what's up?
Rabin Shrestha
@jyapujuju
Aug 27 2015 09:57
@dting
function end(str, target) {
  // "Never give up and good luck will find you."
  var i=str.substr(str.length-1);
  console.log(i);
  if (i===target){
    return 'true';
  }
  else{
    return 'false';
  }
}
end('Bastian', 'n');
not working
Nnxoxo
@Nnxoxo
Aug 27 2015 09:57
@dting open private msgs
DTing
@dting
Aug 27 2015 09:57
@jyapujuju you are doing an assignment inside your if statement that should be a comparsion
@Nnutthowze just ask here please
Nnxoxo
@Nnxoxo
Aug 27 2015 09:58
@dting a lot to write...
DTing
@dting
Aug 27 2015 09:58
then i probably can't help. i'm heading off soon
Rabin Shrestha
@jyapujuju
Aug 27 2015 09:59
@dting updated
Soumya Rauth
@soumyaRauth
Aug 27 2015 10:00
I need a api link from which I can fetch JSON data for zipline local weather . Help please.
DTing
@dting
Aug 27 2015 10:00
you need the last "target.length" number of characters of str.
@soumyaRauth try simpleweatherjs
@jyapujuju var i=str.substr(str.length-1); this is wrong. what should this be?
Kelvin O
@kerukelw
Aug 27 2015 10:03
Hi guys
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 10:04
@jyapujuju try to assign str.length - 1 to a variable first
Rabin Shrestha
@jyapujuju
Aug 27 2015 10:05
@dting can i use slice??
Omar
@oab00
Aug 27 2015 10:05
@rasakos :/
DTing
@dting
Aug 27 2015 10:06
yes you can also use str.substr
Omar
@oab00
Aug 27 2015 10:06
@rasakos took me too long to figure out the problem.......
DTing
@dting
Aug 27 2015 10:07
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.)
Omar
@oab00
Aug 27 2015 10:07
@rasakos one of ur inputs has autofocus ... remove it and u're good
that's what's causing your page to scroll all the way down to #contacts on page load
Costas Chaitas
@CostasChaitas
Aug 27 2015 10:09
which input?
Omar
@oab00
Aug 27 2015 10:10
first one
Costas Chaitas
@CostasChaitas
Aug 27 2015 10:10
home page you mean?
Omar
@oab00
Aug 27 2015 10:10
ctrl+f autofocus
in #contacts
DTing
@dting
Aug 27 2015 10:11
console.log("hello".substr(-1))
// "o"

console.log("hello".substr(-2))
// "lo"

console.log("hello".substr(-3))
// "llo"

console.log("hello".substr(-4))
// "ello"
Costas Chaitas
@CostasChaitas
Aug 27 2015 10:12
@oab00 cant find it mate
:(
Omar
@oab00
Aug 27 2015 10:12
the input where u put the name..
Costas Chaitas
@CostasChaitas
Aug 27 2015 10:13
ooo shit
found it
thanks @oab00
CamperBot
@camperbot
Aug 27 2015 10:13
rasakos sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 266 | @oab00 | http://www.freecodecamp.com/oab00
Costas Chaitas
@CostasChaitas
Aug 27 2015 10:13
and again and again
:)
i take the contact form another recourse
it works:)
Omar
@oab00
Aug 27 2015 10:17
glad it does :)
Omar Lashkar
@xxx-mar
Aug 27 2015 10:18
hey guyz , I would appreciate some help here
$(document).ready(function() {
$("button" ).addclass("animated shake ");
$(".btn").addclass("shake");
$("#target1").addclass("btn-primary")
in ex "Waypoint: Target the same element with multiple jQuery Selectors"
Soumya Rauth
@soumyaRauth
Aug 27 2015 10:20
How do I set the value of the variable of "Latitude" and "Longditude " in this link: ""api.openweathermap.org/data/2.5/weather?lat=35&lon=139""; in place of 35 and 139
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 10:21
@xxx-mar try to remove shake from the first line
Omar
@oab00
Aug 27 2015 10:21
@xxx-mar hala Omar :)
change addclass to addClass <- notice capital case
Omar Lashkar
@xxx-mar
Aug 27 2015 10:22
@Abdelaziz18003 no change :(
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 10:23
oh yeah you forgot the Uppercase C in addClass
Omar Lashkar
@xxx-mar
Aug 27 2015 10:23
@oab00 shokran ya 3'aly :D
Omar
@oab00
Aug 27 2015 10:24
np ^^
Omar Lashkar
@xxx-mar
Aug 27 2015 10:24
thanks for you both :+1: @oab00 @Abdelaziz18003
CamperBot
@camperbot
Aug 27 2015 10:24
if you want to thank someone, put an @ before their name!
amir
@Rimabo
Aug 27 2015 10:24
If I wanted to add Jquery code into my website, Do I put it in my css file or javscript file?
(I got the feeling that it is a stupid question, but I need to be sure. The code is like Javascript)
Costas Chaitas
@CostasChaitas
Aug 27 2015 10:26
in the html file include the jQuery library
and if you use codenpen include the jquery to your js file
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 10:27
@Aubaroo you have to put it in a js file ... jquey is a js library ..
amir
@Rimabo
Aug 27 2015 10:28
Thanks guys
CamperBot
@camperbot
Aug 27 2015 10:28
if you want to thank someone, put an @ before their name!
semyonaut
@semyonaut
Aug 27 2015 10:32
Hey guys i just started and going through the html course, but i can't seem to finish this course while my syntax is correct, anyone else encountered this?
Rabin Shrestha
@jyapujuju
Aug 27 2015 10:33
function end(str, target) {
  // "Never give up and good luck will find you."
  var j=str.length-1;
  var i=str.substr(j);
  console.log(i);
  if (target===i){
    return 'true';
  }
  else{
    return 'false';
  }
}
end('Bastian', 'n');
sorry i could not figure out where did i miss the chip
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 10:34
@jyapujuju what's the title of this bonefire
Rabin Shrestha
@jyapujuju
Aug 27 2015 10:35
Bonfire: Confirm the Ending @Abdelaziz18003
CamperBot
@camperbot
Aug 27 2015 10:35
Sorry, can't find a bonfire called confirm the ending @abdelaziz18003 . [ Check the map? ]
Owen
@owencampbell
Aug 27 2015 10:35
@jyapujuju I completed this using String.slice() -- You can work backwards using the targets length...
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 10:37
@jyapujuju the target is not always one letter it can be more
@jyapujuju this is my code
function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  var str1 = str.substr(-(target.length));
  return target === str1;
}

end('Bastian', 'n');
Rabin Shrestha
@jyapujuju
Aug 27 2015 10:38
oh!!
thanks @Abdelaziz18003 :+1:
CamperBot
@camperbot
Aug 27 2015 10:39
jyapujuju sends brownie points to @abdelaziz18003 :sparkles: :thumbsup: :sparkles:
:star: 171 | @abdelaziz18003 | http://www.freecodecamp.com/abdelaziz18003
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 10:39
you are welcome @jyapujuju
justjoolz
@justjoolz
Aug 27 2015 10:42
hey guys
the 'typeof' waypoint seems to be not working properly....
forget it it's working now
haha
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 27 2015 10:46
you are welcome @justjoolz
Lucas Vorsteveld
@Lucashv
Aug 27 2015 10:59
has anyone done the twitch front end zipline? I am using two $.ajax calls and both are receiving data, but only one of them is updating the other parts of the code and it makes no sense at all
Thomas Farla
@TFarla
Aug 27 2015 11:03
@Lucashv yes, here is my solution http://codepen.io/tfarla/full/pJaqmX.
Show me the code and I might be able to help you out :D
Lucas Vorsteveld
@Lucashv
Aug 27 2015 11:06
I'm a little reluctant to look at yours just because I don't want to see all the answers but idk i have been struggling with this one for a couple hours
Thomas Farla
@TFarla
Aug 27 2015 11:12
@Lucashv What exactly do you mean with the not updating? Can you clarify that a little?
Ian Hyndman
@ian-splintercell-splinter
Aug 27 2015 11:13
Manipulate JavaScript Objects //Let's add the property "bark", and delete the property "tails". been stuck on this for hours
Lucas Vorsteveld
@Lucashv
Aug 27 2015 11:15
@TFarla yeah, in the function "online" i do a ajax request and it was supposed to change data2.icon to either "null" or "on"
Ian Hyndman
@ian-splintercell-splinter
Aug 27 2015 11:15
var myDog = {
"name": "Camper",
"legs": 4,
"friends": ['bark']
myDog.bark : "bark;
};
Lucas Vorsteveld
@Lucashv
Aug 27 2015 11:16
it wasn't working but I think i figured out why, its because i had a line in the first function setting it to an empty string
Thomas Farla
@TFarla
Aug 27 2015 11:17

@Lucashv Then you might want to look into making the online function a callback of the $.ajax request in the requests function.

The problem lies with the asynchronous execution. The second ajax call is being executed before the original is done

Lucas Vorsteveld
@Lucashv
Aug 27 2015 11:21
@TFarla ok I will look into that I haven't used callbacks before but i should learn, thank you :)
CamperBot
@camperbot
Aug 27 2015 11:21
lucashv sends brownie points to @tfarla :sparkles: :thumbsup: :sparkles:
:star: 2 | @tfarla | http://www.freecodecamp.com/tfarla
Thomas Farla
@TFarla
Aug 27 2015 11:21

@Lucashv What you are doing is the equivalent of two setTimeouts executed when the page gets loaded.

What you are doing is this:

setTimeout(function() {
   console.log('A');
}, 100)

setTimeout(function() {
   console.log('B');
}, 50);

When you want the B timeout to be executed after A. Then do it as follows

setTimeout(function() {
   console.log('A');
   setTimeout(function() {
      console.log('B');
   }, 50);
}, 100);
@ian-splintercell-splinter can you send me a link to the assignment?
Thomas Farla
@TFarla
Aug 27 2015 11:28

@ian-splintercell-splinter
Look into your browser console. It will probably note that you have a syntax error.
When creating an object with values. The syntax is:

{ 
  key: "value"
}

For deleting you might want to look at the description ^.^
I encourage you to read up on Javascript objects here

Ian Hyndman
@ian-splintercell-splinter
Aug 27 2015 11:29
@TFarla
TY but im still stuck
Thomas Farla
@TFarla
Aug 27 2015 11:32
@ian-splintercell-splinter What seems to be the problem?
Ian Hyndman
@ian-splintercell-splinter
Aug 27 2015 11:37

http://freecodecamp.com/challenges/waypoint-manipulate-javascript-objects // Waypoint: Manipulate JavaScript Objects
There are many ways to add and remove properties from objects.

For example, we can add properties to objects like this:

myObject.myProperty = "myValue";

We can also delete them like this:

delete myObject.myProperty;

Let's add the property "bark", and delete the property "tails".

I'm stuck on this for ages

Thomas Farla
@TFarla
Aug 27 2015 11:42

@ian-splintercell-splinter I did a little snooping on your github page and I saw that you have experience with PHP.

When we want to make an associative array in PHP. We would do something like:

$myArray = ["one" => 1];

Simple enought, right?
It's a key and a value.
Well, javascript objects are the exact same thing.

I noticed in your code you are doing this:

var dog = {
   dog.bark = ""
}

This is invalid because like you cant do this in PHP:

$myArray = [$myArray[0]];

You can not refer to the object before it has been created.

Ian Hyndman
@ian-splintercell-splinter
Aug 27 2015 11:44
this is one of my weaker areas
Thomas Farla
@TFarla
Aug 27 2015 11:46
@ian-splintercell-splinter the problem with your code is that the myDog variable does not exists yet. You can add the bark property in two different ways.
Look at the myDog object and the other properties. Mimic that for bark
Greg Noble
@gregnoble
Aug 27 2015 12:00
Has anyone done this bonfire: Bonfire: Smallest Common Multiple ?
it expects a least common multiple of 1 and 5 to be 60.
wow i feel dumb, it wants the range between 1 and 5
nevermind
Erik Kynast
@carnivean
Aug 27 2015 12:01
Which means, I literally can't correct the code as the browser window hangs itself, before I can change it
Anyone know how I can reset the local storage, so that chrome doesn't load the code it had saved?
Ian Hyndman
@ian-splintercell-splinter
Aug 27 2015 12:02
@TFarla
Im working on a work around
Thomas Farla
@TFarla
Aug 27 2015 12:03
@ian-splintercell-splinter a work around? Please share, I'm curious c:
Betsey Biggs
@betsbillabong
Aug 27 2015 12:08
Hey @gregnoble I am not on the bonfires yet, but you may find more help a the Bonfire Help page, https://gitter.im/FreeCodeCamp/HelpBonfires. I think they changed it so that this is for waypoints. I'm almost there - good luck!
CamperBot
@camperbot
Aug 27 2015 12:08
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Omar
@oab00
Aug 27 2015 12:11
@carnivean type wiki storage in chat to see how to clear local storage
Greg Noble
@gregnoble
Aug 27 2015 12:13
@betsbillabong yeah i just misread the text in the bonfire so i was trying to solve for something completely different. Thanks though
CamperBot
@camperbot
Aug 27 2015 12:13
gregnoble sends brownie points to @betsbillabong :sparkles: :thumbsup: :sparkles:
:star: 240 | @betsbillabong | http://www.freecodecamp.com/betsbillabong
amir cohen
@amir0900
Aug 27 2015 12:28
ummm

any 1 see a problem here?:

<script>
function runSlots(){
var slotOne;
var slotTwo;
var slotThree;

var images = ["http://i.imgur.com/9H17QFk.png", "http://i.imgur.com/9RmpXTy.png", "http://i.imgur.com/VJnmtt5.png"];

slotOne = Math.floor(Math.random() (3 - 1 + 1)) + 1;
slotTwo = Math.floor(Math.random()
(3 - 1 + 1)) + 1;
slotThree = Math.floor(Math.random() * (3 - 1 + 1)) + 1;

$('.logger').html('');
$('.logger').html('Not A Win');

// Only change code below this line.
$($('.slot')[0]).html('<img src = "' + images[slotOne-0] + '">');
$($('.slot')[1]).html('<img src = "' + images[slotTwo-1] + '">');
$($('.slot')[2]).html('<img src = "' + images[slotThree-2] + '">');


// Only change code above this line.

if(slotOne !== slotTwo || slotTwo !== slotThree){
return(null);
}

if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){
$('.logger').html(slotOne);
$('.logger').append(' ' + slotTwo);
$('.logger').append(' ' + slotThree);
}

return([slotOne, slotTwo, slotThree]);
}

$(document).ready(function(){
$('.go').click(function(){
runSlots();
});
});
</script>

cole570
@cole570
Aug 27 2015 12:28
http://freecodecamp.com/challenges/bonfire-check-for-palindromes I can get it to return true as long as there are no punctuation or spaces . I know I need to use .replace() in some form but I can't figure out how to target punctuation and spaces.
Prashanth Chandra
@prashcr
Aug 27 2015 12:31
@amir0900 use double quotes for the jquery selector
It's a bug with the exercise
amir cohen
@amir0900
Aug 27 2015 12:32
@prashcr where exacly?
Daniel O'Mahony
@OMahonyD
Aug 27 2015 12:32
@TFarla There might be an obvious answer to this but how do you get the screenshots of the code in the way you're doing? Cheers
Lucas Vorsteveld
@Lucashv
Aug 27 2015 12:32
@cole570 go here: http://regexone.com, and look on the right side for non-alphanumeric characters
Prashanth Chandra
@prashcr
Aug 27 2015 12:32
$($('.slot')[0])
amir cohen
@amir0900
Aug 27 2015 12:33
ye i did...
didnt work...
cole570
@cole570
Aug 27 2015 12:33
@Lucashv ok ty
amir cohen
@amir0900
Aug 27 2015 12:33

'''

<script>
function runSlots(){
var slotOne;
var slotTwo;
var slotThree;

var images = ["http://i.imgur.com/9H17QFk.png", "http://i.imgur.com/9RmpXTy.png", "http://i.imgur.com/VJnmtt5.png"];

slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
slotThree = Math.floor(Math.random() * (3 - 1 + 1)) + 1;

$('.logger').html('');
$('.logger').html('Not A Win');

// Only change code below this line.
$($(".slot")[0]).html('<img src = "' + images[slotOne-0]     + '">');
 $($(".slot")[1]).html('<img src = "' + images[slotTwo-1]     + '">');
 $($(".slot")[2]).html('<img src = "' + images[slotThree-2]     + '">');


// Only change code above this line.

if(slotOne !== slotTwo || slotTwo !== slotThree){
  return(null);
}

if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){
  $('.logger').html(slotOne);
  $('.logger').append(' ' + slotTwo);
  $('.logger').append(' ' + slotThree);
}

return([slotOne, slotTwo, slotThree]);

}

$(document).ready(function(){
$('.go').click(function(){
runSlots();
});
});
</script>
'''

CamperBot
@camperbot
Aug 27 2015 12:33
:bulb: to format code use backticks! ``` more info
Thomas Farla
@TFarla
Aug 27 2015 12:33
@OMahonyD do you mean?
console.log("something")
Prashanth Chandra
@prashcr
Aug 27 2015 12:34
@amir0900 Also, it should all be slotOne - 1, slotTwo - 1, etc.
Daniel O'Mahony
@OMahonyD
Aug 27 2015 12:34
@TFarla Yep.
Prashanth Chandra
@prashcr
Aug 27 2015 12:34
for the images[] part
Thomas Farla
@TFarla
Aug 27 2015 12:35
@OMahonyD that is standard markdown.
in short type 3 backtick write your code and end with 3 times backtick
amir cohen
@amir0900
Aug 27 2015 12:35
_<"
@prashcr still...
Prashanth Chandra
@prashcr
Aug 27 2015 12:35
The slot numbers are from 1 - 3. Indexes are from 0 -2. So we need to minus one from the slot numbers to get the corresponding index @amir0900
Daniel O'Mahony
@OMahonyD
Aug 27 2015 12:36
Cool. Thanks @TFarla
CamperBot
@camperbot
Aug 27 2015 12:36
omahonyd sends brownie points to @tfarla :sparkles: :thumbsup: :sparkles:
:star: 3 | @tfarla | http://www.freecodecamp.com/tfarla
amir cohen
@amir0900
Aug 27 2015 12:36
@prashcr but we have 3 pictures
Thomas Farla
@TFarla
Aug 27 2015 12:36
@OMahonyD was hard to type without it being interpet xD
Prashanth Chandra
@prashcr
Aug 27 2015 12:36
$($(".slot")[0]).html('<img src = "' + images[slotOne-1] + '">');
$($(".slot")[1]).html('<img src = "' + images[slotTwo-1] + '">');
$($(".slot")[2]).html('<img src = "' + images[slotThree-1] + '">');
This must work. I did it earlier today
@amir0900 And there's three slot numbers
amir cohen
@amir0900
Aug 27 2015 12:37
@prashcr hoo thx
CamperBot
@camperbot
Aug 27 2015 12:37
amir0900 sends brownie points to @prashcr :sparkles: :thumbsup: :sparkles:
:star: 304 | @prashcr | http://www.freecodecamp.com/prashcr
Prashanth Chandra
@prashcr
Aug 27 2015 12:37
slot numbers start from one, image indexes start from 0
amir cohen
@amir0900
Aug 27 2015 12:37
but still get error "Use the provided code three times. One for each slot"
Daniel O'Mahony
@OMahonyD
Aug 27 2015 12:38
'''test(test_1)'''
CamperBot
@camperbot
Aug 27 2015 12:38
:bulb: to format code use backticks! ``` more info
Daniel O'Mahony
@OMahonyD
Aug 27 2015 12:38
Woops wrong backtick
console.log(test)
amir cohen
@amir0900
Aug 27 2015 12:38
@prashcr but still get error "Use the provided code three times. One for each slot"
Thomas Farla
@TFarla
Aug 27 2015 12:39
@OMahonyD follow the first set of backticks with an empty line and write your code in there c:
Prashanth Chandra
@prashcr
Aug 27 2015 12:40
ehh try copy-pasting this exactly. It works for me.
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
$($('.slot')[1]).html('<img src = "' + images[slotTwo-1] + '">');
$($('.slot')[2]).html('<img src = "' + images[slotThree-1] + '">');
Daniel O'Mahony
@OMahonyD
Aug 27 2015 12:40
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
$($('.slot')[1]).html('<img src = "' + images[slotTwo-1] + '">');
$($('.slot')[2]).html('<img src = "' + images[slotThree-1] + '">');
tinako97
@tinako97
Aug 27 2015 12:40

What does * as a key in an object mean? e.g.

Object {*: "<div>↵<table class=   // etc

How do I access the value?

Lucas Vorsteveld
@Lucashv
Aug 27 2015 12:40
@TFarla so I made the function a callback, and it still doesn't work :( I don't know what I'm doing wrong
amir cohen
@amir0900
Aug 27 2015 12:41
@prashcr thx =]
CamperBot
@camperbot
Aug 27 2015 12:41
amir0900 sends brownie points to @prashcr :sparkles: :thumbsup: :sparkles:
:warning: amir0900 already gave prashcr points
Thomas Farla
@TFarla
Aug 27 2015 12:41
@Lucashv can you send the code again?
Michael Bomholt
@bomholtm
Aug 27 2015 12:45
hey everyone i used <br> to have space between two elements. and the space is perfectly fine for mobile. on bigger resolutions i would like the space to turn to the size of two times <br>. is there a elegant solution for it? can i use an element sized with em instead of <br>. which size should i use then?
Aadith V Menon
@cysys
Aug 27 2015 12:45
I need help with the palindromes bonfitr
bonfire*
CamperBot
@camperbot
Aug 27 2015 12:45
we're talking about bonfire :fire: Bonfire: Return Largest Numbers in Arrays
Michael Bomholt
@bomholtm
Aug 27 2015 12:46
maybe someone encountered they same problem and knows a elegant solution. otherwise i will just play around with it
Thomas Farla
@TFarla
Aug 27 2015 12:46
@Lucashv I found a bug
Aadith V Menon
@cysys
Aug 27 2015 12:46
Help for the palindromes checking bonfire
CamperBot
@camperbot
Aug 27 2015 12:46
no wiki entry for: for the palindromes checking bonfire
:pencil: click here to create one now!after creating your page type update to reload it here
Thomas Farla
@TFarla
Aug 27 2015 12:47
@Lucashv
"null" is not equal to null
so
data.stream == "null" //wrong
data.stream == null //right
Lucas Vorsteveld
@Lucashv
Aug 27 2015 12:50
@TFarla thanks, I changed it and according to console.log statements everything should be working but for some reason its not translating into the css, basically they should all have little blue boxes and one should have a little red box for online, its really strange
CamperBot
@camperbot
Aug 27 2015 12:50
lucashv sends brownie points to @tfarla :sparkles: :thumbsup: :sparkles:
:star: 4 | @tfarla | http://www.freecodecamp.com/tfarla
Thomas Farla
@TFarla
Aug 27 2015 12:56
@Lucashv found the problem!
Appending the template to the view was still being executed outside the success method.
place $(".twitcherbox").append(template(data2));
Change it like this:
          if (data.stream == null){
            data2.icon = "null";
            console.log("trees");
          }
          else {
            data2.icon = "on";
          }
        data2.icon = "on";
               $(".twitcherbox").append(template(data2));
Prashanth
@dgprashanth
Aug 27 2015 12:57
Guys, I'm trying to generate a quote from an array based on user input of a number, but the number keeps getting posted instead of the array element. Can someone point out where my error lies?
Thomas Farla
@TFarla
Aug 27 2015 12:57
@Lucashv On a side note. Don't use "null". Always use null to not cause confusion c:
@dgprashanth sure, share the code
Prashanth
@dgprashanth
Aug 27 2015 12:57

HTML: '' '<h1 id="title">Javascript example no.2</h1>

<input type="text" id="myTextField" />

<input type="submit" id="byBtn" value="Change" onclick="Quote()" />'''

CamperBot
@camperbot
Aug 27 2015 12:57
:bulb: to format code use backticks! ``` more info
Prashanth
@dgprashanth
Aug 27 2015 12:58

```<h1 id="title">Javascript example no.2</h1>

<input type="text" id="myTextField" />

<input type="submit" id="byBtn" value="Change" onclick="Quote()" />

How do i get it to show up right?
Thomas Farla
@TFarla
Aug 27 2015 12:58
@dgprashanth end with 3 backticks too
Prashanth
@dgprashanth
Aug 27 2015 12:58
ah okay
let me try again

```<h1 id="title">Javascript example no.2</h1>

<input type="text" id="myTextField" />

<input type="submit" id="byBtn" value="Change" onclick="Quote()" />```

Thomas Farla
@TFarla
Aug 27 2015 12:59
end with the same backticks ```
Hans van Riet
@hansinla
Aug 27 2015 12:59
@dgprashanth backticks option-enter (need a newline to start code. End the same way.
help format
CamperBot
@camperbot
Aug 27 2015 12:59

:point_right: code formatting [wiki]

Inline code

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

Code Block

``` ⇦ Type 3 backticks, 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