These are chat archives for FreeCodeCamp/Help

8th
Oct 2015
max77p
@max77p
Oct 08 2015 00:00
@DoRm is it right to say if(x!==NaN)?
will that pick up all things that are not a number?
Jessica Davis
@jessieinsidecode
Oct 08 2015 00:02
``
DoRm
@DoRm
Oct 08 2015 00:02
@max77p it should
max77p
@max77p
Oct 08 2015 00:03
if(arr!=NaN){
  newarr.push(arr); 
 }
 else
 {
  return false; 
 }
Jessica Davis
@jessieinsidecode
Oct 08 2015 00:03
Is there a way to change text color and centering the text in markdown Im currently creating a resume for an application I'm applying and they want everything in markdown language! Even the 4 essay questions!
max77p
@max77p
Oct 08 2015 00:03
oops i added the == equal sings
Jessica Davis
@jessieinsidecode
Oct 08 2015 00:03
sorry this isn't related to fcc
max77p
@max77p
Oct 08 2015 00:03
@DoRm but that still pushes the "ate" into my new array

```js

function bouncer(arr) {
var newarr=[];
function filterbynill(arr){
if(arr!=NaN){
newarr.push(arr);
}
else
{
return false;
}
}
var filtered = arr.filter(filterbynill);
}

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

function bouncer(arr) {
var newarr=[];
 function filterbynill(arr){
 if(arr!=NaN){
  newarr.push(arr); 
 }
 else
 {
  return false; 
 }
}
var filtered = arr.filter(filterbynill);
}

bouncer([7, "ate", "", false, 9], "");
Dillon Klein
@DillonKlein
Oct 08 2015 00:05
How do you post the text editor format?
Herman Fassett
@HermanFassett
Oct 08 2015 00:06
wiki code format
CamperBot
@camperbot
Oct 08 2015 00:06

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Dillon Klein
@DillonKlein
Oct 08 2015 00:06
...
fail
Got it. Thanks @camperbot
CamperBot
@camperbot
Oct 08 2015 00:07
dillonklein sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 306 | @camperbot | http://www.freecodecamp.com/camperbot
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:09
@max77p no, since NaN does not equal NaN, you'll have to use the isNaN() function to check it. (or a switch where NaN is one of the cases)
KnittingInCode
@infoalisaa
Oct 08 2015 00:09
Hello! Has anyone done any of the Ziplines yet?
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:10
I did the quote generator,
Jessica Davis
@jessieinsidecode
Oct 08 2015 00:10
is it possible to change text -color and center-text with markdown? If so how?
code
KnittingInCode
@infoalisaa
Oct 08 2015 00:11
@jedpimentel What are they looking for exactly in terms of replication? I am working on the Personal Portfolio page one, and I was wondering how close they want you to come to the page you are trying to reverse engineer?
Herman Fassett
@HermanFassett
Oct 08 2015 00:12
@infoalisaa it doesn't have to be like it at all though reverse engineering is a good way to learn.
KnittingInCode
@infoalisaa
Oct 08 2015 00:12
@HermanFassett so as far as the scrolling functionality of it, do they want to see it?
@HermanFassett I'm just wondering how detailed should I get.
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:13
@infoalisaa the important part is for you to remake all the features. In the portfolio case, you have the static backgrounds, which is something new, also, the way the buttons "collapse" when viewed in a small window. You should keep the functionality,
Herman Fassett
@HermanFassett
Oct 08 2015 00:13
No one's really going to grade your ziplines, you can submit whatever you want, but they're publicly visible on your profile and having a good portfolio to show future potential employers is helpful
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:14
the portfolio is the one that's hardest to change the "format", but using your own images etc will make it unique
Dillon Klein
@DillonKlein
Oct 08 2015 00:14
Well. I will be back at it later. Going to watch some MLB postseason.
Thanks all for the help and fun.
CamperBot
@camperbot
Oct 08 2015 00:14
if you want to thank someone, put an @ before their name!
Herman Fassett
@HermanFassett
Oct 08 2015 00:14
I've started a few iterations of a portfolio but I still haven't submitted one because I feel I haven't created one I'm personally satisfied with.
KnittingInCode
@infoalisaa
Oct 08 2015 00:15
@HermanFassett @jedpimentel Ah, okay. I was just wondering how much they are looking for as far as how close you come to replicating the sample website. Thanks for letting me know.
CamperBot
@camperbot
Oct 08 2015 00:15
infoalisaa sends brownie points to @hermanfassett and @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 330 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
:star: 328 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:15
I actually found the portfolio to be pretty hard, due to all the little things, I think I'll leave it until after the basic ziplines
KnittingInCode
@infoalisaa
Oct 08 2015 00:15
@HermanFassett @jedpimentel So would it be more productive to continue to work on other Ziplines and Bonfires and not to worry so much on the portfolio?
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:15
this is my quote generator if you'd like to compare it with the sample http://s.codepen.io/JedPimentel/debug/zvGOdd?
KnittingInCode
@infoalisaa
Oct 08 2015 00:17
@jedpimentel Ah, I see. It's not like the example at all, but still works the same.
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:17
@infoalisaa Try your best, if you don't feel you're up to it it should be fine to try another zipline, though (not that they are much easier, they just have a more specific scope)
Making my portfolio, I coded myself into a corner, which is why I skipped it for now
jdreiser1
@jdreiser1
Oct 08 2015 00:19
function palindrome(str) {
  // Good luck
  var str = str.replace(/[,\.]/g,'');
  var str = str.toLowerCase();
  var array = str.split("");
  for (i=0; i < (array.length - 1); i++){
    if (array[i] != array[(array.length-1)-i]){
      return false;
    }
      return true;
  }
}



palindrome("almostomla");
KnittingInCode
@infoalisaa
Oct 08 2015 00:19
@jedpimentel Yeah, I just want to keep my flow going as far as my javascript and I am a terrible perfectionist, so working on a portfolio page would probably burn me out.
jdreiser1
@jdreiser1
Oct 08 2015 00:19
"almostomla" should return false, but instead it returns true
max77p
@max77p
Oct 08 2015 00:20
@jdreiser1 If value is omitted or is 0, -0, null, false, NaN, undefined, or the empty string (""), the object has an initial value of false
so putting if(Boolean()); means if it has any of the values above?
sorry question meant for anyone who knows
thanks
CamperBot
@camperbot
Oct 08 2015 00:20
if you want to thank someone, put an @ before their name!
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:21
@jdreiser1 try getting it to console.log the letters being compared, it might not be looping until the middle characters
James Smith
@matthew02
Oct 08 2015 00:22
@infoalisaa I'm a perfectionist too and felt a lot like you. I also felt like I had learned a lot of syntax, but net enough practical skills to duplicate the portfolio page. I actually went to Udacity and took their quick Intro to HTML and CSS class before I attempted the Ziplines and I felt like it helped me out a lot.
Herman Fassett
@HermanFassett
Oct 08 2015 00:23
@matthew02 cool. I feel like I need to learn a lot more css and html because everything I make looks bad
Travis
@TravisHi
Oct 08 2015 00:23
@HermanFassett check out bootstrap!
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:23
@max77p Boolean() will coerce it into either true or false, I think all those would be coerced into false (ie are 'falsey')
Herman Fassett
@HermanFassett
Oct 08 2015 00:23
Even then
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:24
@HermanFassett try drawing what you want the page to be like on a piece of paper. Then learn whatever your missing to make it like that.
Herman Fassett
@HermanFassett
Oct 08 2015 00:25
My quote generator is fine enough, nothing fancy but functional, and I feel I'm starting to learn more while restarting my portfolio for at least the third time, but my weather app looks like it stepped right out of the 90s and I can only stare at the ziplines of others
KnittingInCode
@infoalisaa
Oct 08 2015 00:25
@matthew02 Thanks! I might actually do that or go through my Code School account because I feel as though after doing all of the javascript algorithms that I haven't a clue as to how to build a webpage at all.
CamperBot
@camperbot
Oct 08 2015 00:25
infoalisaa sends brownie points to @matthew02 :sparkles: :thumbsup: :sparkles:
:star: 321 | @matthew02 | http://www.freecodecamp.com/matthew02
James Smith
@matthew02
Oct 08 2015 00:25
@HermanFassett I felt exactly the same way. I really didn't want to get discouraged at that point and quit, so I figured I needed to supplement. I've had some great experiences with Udacity, so I went there. I'm glad I did.
KnittingInCode
@infoalisaa
Oct 08 2015 00:26
@jedpimentel I think I'll try that out too and just focus on one piece at a time.
James Smith
@matthew02
Oct 08 2015 00:26
Their Intro to HTML and CSS class is quick and it really helps you learn how to break down a mockup into real HTML and CSS.
Including Bootstrap.
KnittingInCode
@infoalisaa
Oct 08 2015 00:26
@matthew02 Did you use the sample page that was provided as a starting point or did you just start from scratch?
max77p
@max77p
Oct 08 2015 00:27
@jedpimentel iam having trouble trying to figure out how to make this boolean work so that "" won't pick up
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:28
in my chrome console, Boolean("") gives false,
James Smith
@matthew02
Oct 08 2015 00:28
@infoalisaa I rebuilt the sample page as if it was a screenshot someone sent me. I have zero design skills, so I really just focused on writing the cleanest HTML and CSS I could.
max77p
@max77p
Oct 08 2015 00:28
@jedpimentel so you are saying i have to do this for each one?
Herman Fassett
@HermanFassett
Oct 08 2015 00:28
Ok thanks @matthew02 ... I guess I'm just kind of frustrated because I'm great with Javascript and have been programming for awhile.. Just can't seem to get css styling right
CamperBot
@camperbot
Oct 08 2015 00:28
hermanfassett sends brownie points to @matthew02 :sparkles: :thumbsup: :sparkles:
:star: 322 | @matthew02 | http://www.freecodecamp.com/matthew02
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:29
@max77p not if you pass the input value into Boolean(),
Herman Fassett
@HermanFassett
Oct 08 2015 00:29
@max77p Looping through each value in the array preferably with filter and calling Boolean(val) on each index should work fine
Travis
@TravisHi
Oct 08 2015 00:29
@HermanFassett check out devtips on youtube if I haven't already preached his channel to you yet :p
KnittingInCode
@infoalisaa
Oct 08 2015 00:29
@matthew02 Okay, I'll give it a go that way because doing it from the sample page is driving me bonkers! LOL
Herman Fassett
@HermanFassett
Oct 08 2015 00:30
Ok thanks @TravisHi
CamperBot
@camperbot
Oct 08 2015 00:30
hermanfassett sends brownie points to @travishi :sparkles: :thumbsup: :sparkles:
:star: 207 | @travishi | http://www.freecodecamp.com/travishi
Travis
@TravisHi
Oct 08 2015 00:30
@HermanFassett he has at least 2 vids on sketching up websites that helped heaps
James Smith
@matthew02
Oct 08 2015 00:31
@HermanFassett Just know that you're not alone. It's a struggle, but I definitely think it's worth it. I'm just like you... great with JavaScript, been programming for a long time, just feel like the "layout" stuff is a hurdle for me. I know we'll all be great at it if we stick with it.
Travis
@TravisHi
Oct 08 2015 00:31
@matthew02 and @HermanFassett you guys have worked out the hard stuff already! interface will be easy
James Smith
@matthew02
Oct 08 2015 00:32
@infoalisaa I hear you! I was super frustrated at first. Keep at it! You'll get it and it will feel great when you do. Good luck!
KnittingInCode
@infoalisaa
Oct 08 2015 00:32
@matthew02 Yeah, I would agree. I want to get to professional level stuff as far as my work, but I have to realize that I just started to learn how to code part-time a few months ago, and I'm not expected to be a rock star just yet. Thanks for your thoughts and help!
CamperBot
@camperbot
Oct 08 2015 00:32
infoalisaa sends brownie points to @matthew02 :sparkles: :thumbsup: :sparkles:
:warning: infoalisaa already gave matthew02 points
Herman Fassett
@HermanFassett
Oct 08 2015 00:32
Lol ok @TravisHi FCC is really the most I've tried with CSS and HTML so I haven't really given up. Before that it was all desktop software and userscripts or the like
@infoalisaa feel good. I've been coding for 6 years and my stuff looks awful.
Maria
@artlifestyle
Oct 08 2015 00:34
I am feeling a bit despondent . I am almost finished with basic javascript and I am looking back at old lesson and querying Google for everything. Shouldn't I get this by now? Am I missing something?
Herman Fassett
@HermanFassett
Oct 08 2015 00:34
Looking back is usual. You shouldn't be expected to remember everything at first @artlifestyle . Repition makes it easier, but you'll always need to consult the docs eventually
jdreiser1
@jdreiser1
Oct 08 2015 00:35
Is there a way to console.log an iteration through the "Bonfire" challenges? does that even make sense?
Herman Fassett
@HermanFassett
Oct 08 2015 00:35
You can console.log anything you want and view it in your browser console
Maria
@artlifestyle
Oct 08 2015 00:35
Oh really? Thank you, @HermanFassett
CamperBot
@camperbot
Oct 08 2015 00:35
artlifestyle sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 329 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Jordan Bourne
@JordanBourne
Oct 08 2015 00:36
Bonfire: Sum All Primes
CamperBot
@camperbot
Oct 08 2015 00:36

:fire:Bonfire: Sum All Primes :link:

function sumPrimes(num) {
  return num;
}

sumPrimes(10);

Sum all the prime numbers up to and including the provided number.

more info:  bf details | bf links | hint

Jordan Bourne
@JordanBourne
Oct 08 2015 00:36
Is there a more elegant solution that isn't just making an array of all primes and comparing to that and adding if it exists
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:37
@artlifestyle I'm reading a JavaScript book right now... I usually have to rest between chapters and might even re-read a chapter without noticing I already went over it
DTing
@dting
Oct 08 2015 00:37
@JordanBourne you can use a sieve
KnittingInCode
@infoalisaa
Oct 08 2015 00:38
@HermanFassett I think for me I like doing the algorithm coding way more than designing stuff.
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:38
I second dting, sieve is about as elegant as calculating prime numbers can get
KnittingInCode
@infoalisaa
Oct 08 2015 00:38
@HermanFassett I have been wondering if I should switch over to Java development instead of doing web stuff since I am not much of a designer.
Jordan Bourne
@JordanBourne
Oct 08 2015 00:38
What do you mean @dting ?
Herman Fassett
@HermanFassett
Oct 08 2015 00:39
Yes @infoalisaa me too :) I'm probably going to do these last couple bonfires before jumping back onto the ziplines
DTing
@dting
Oct 08 2015 00:39
https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes is a popular method of getting primes to n
also sieve of sundaram
Jordan Bourne
@JordanBourne
Oct 08 2015 00:39
Alright thanks @dting
CamperBot
@camperbot
Oct 08 2015 00:39
jordanbourne sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1343 | @dting | http://www.freecodecamp.com/dting
KnittingInCode
@infoalisaa
Oct 08 2015 00:41
@HermanFassett How far are you into the bonfires?
Herman Fassett
@HermanFassett
Oct 08 2015 00:41
@infoalisaa I have 2 left
KnittingInCode
@infoalisaa
Oct 08 2015 00:41
@HermanFassett Of which level?
Herman Fassett
@HermanFassett
Oct 08 2015 00:41
Advanced
jdreiser1
@jdreiser1
Oct 08 2015 00:42
@HermanFassett thanks
CamperBot
@camperbot
Oct 08 2015 00:42
jdreiser1 sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 330 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
KnittingInCode
@infoalisaa
Oct 08 2015 00:43
@HermanFassett Oh, wow, so you've just skipped the Ziplines and went straight to the Bonfires?
Herman Fassett
@HermanFassett
Oct 08 2015 00:44
@infoalisaa well previously I had only skipped the Portfolio zipline, but they just updated the order so now I have a total of 6 ziplines behind me to look forward to no pun
And I should probably redo or fix up a couple of the ones I've done
KnittingInCode
@infoalisaa
Oct 08 2015 00:45
@HermanFassett It seems like they keep updating it and I even feel like somedays I'll never catch up. X-D
Garrett Schultz
@garettschultz
Oct 08 2015 00:45
is there any way to rurn off the mint colored text boxes that pop up on the left side here in chat?
KnittingInCode
@infoalisaa
Oct 08 2015 00:47
@HermanFassett I just checked the order on the map, and I see they flipped the Intermediate Algorithms before the Ziplines now. I'm actually happy about that. LOL
jdreiser1
@jdreiser1
Oct 08 2015 00:53
function palindrome(str) {
  // Good luck
  var str = str.replace(/[,\.]/g,'');
  var str = str.toLowerCase();
  var array = str.split("");
  for (i=0; i < (array.length - 1); i++){
    if (array[i] != array[(array.length-1)-i]){
      return false;
    }
      return true;
  }
}



palindrome("almostomla");
I can't figure out what's wrong
Should return false, but returns true
Travis
@TravisHi
Oct 08 2015 00:55
hint bonfire diff two arrays
CamperBot
@camperbot
Oct 08 2015 00:55
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
KnittingInCode
@infoalisaa
Oct 08 2015 00:56
@jdreiser1 I think it is because you're not comparing your reversed array to the original str in your for loop.
Jose E. Pimentel
@jedpimentel
Oct 08 2015 00:59
@jdreiser1 you're returning true within the for loop.... it's returning true before the loop is over
KnittingInCode
@infoalisaa
Oct 08 2015 01:01
@jedpimentel Yeah, you're right. @jdreiser1 also doesn't have an else statement, so it's going to always return true.
Jose E. Pimentel
@jedpimentel
Oct 08 2015 01:02
actually, it would have to be moved outside the loop entirely
KnittingInCode
@infoalisaa
Oct 08 2015 01:03
really? wouldn't that make everything true outside of that for loop?
Jose E. Pimentel
@jedpimentel
Oct 08 2015 01:03
yes! it will, but only if it's NOT false would it ever actually get outside that for loop
only once you've checked all the characters (the whole loop) is when you're sure it isnt false
KnittingInCode
@infoalisaa
Oct 08 2015 01:04
ah, gotcha.
Jose E. Pimentel
@jedpimentel
Oct 08 2015 01:05
@jdreiser1 you can try using debug code like this to check the function flow
function palindrome(str) {
  // Good luck
  var str = str.replace(/[,\.]/g,'');
  var str = str.toLowerCase();
  var array = str.split("");
  for (i=0; i < (array.length - 1); i++){
    console.log("comparing",array[i],"and",array[(array.length-1)-i])
    if (array[i] != array[(array.length-1)-i]){
      return false;
    }
      return true;
  }
}



palindrome("almostomla");
KnittingInCode
@infoalisaa
Oct 08 2015 01:05
i did mine an entirely different way where i just reversed the string and compared them from there, so seeing it this way is different.
Okay, I'm going to eat dinner now. It was nice chatting with everyone! Thanks for the input! :D
CamperBot
@camperbot
Oct 08 2015 01:06
if you want to thank someone, put an @ before their name!
Jose E. Pimentel
@jedpimentel
Oct 08 2015 01:06
yeah, that's the suggested/readable method. Checking one character at a time is the "cpu efficient" method that a language like C would force,
jdreiser1
@jdreiser1
Oct 08 2015 01:15
thanks @infoalisaa and @jedpimentel
CamperBot
@camperbot
Oct 08 2015 01:15
jdreiser1 sends brownie points to @infoalisaa and @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 243 | @infoalisaa | http://www.freecodecamp.com/infoalisaa
:star: 334 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
mjeff7
@mjeff7
Oct 08 2015 01:40
Any suggestions on this? I'd like to have four columns that stack into four rows on small screen size, except that I want to the columns to maintain their natural widths, not having to be the same.
Very much like <div class="row"><div class="col-sm-3">...</div><div class="col-sm-3">...</div><div class="col-sm-3">...</div><div class="col-sm-3">...</div></div>, except that I do not wish to require the columns to be equal width.
James Smith
@matthew02
Oct 08 2015 01:42
@mjeff7 I'm no Bootstrap pro, but have you tried just removing the col-sm-3 class from the inner divs?
mjeff7
@mjeff7
Oct 08 2015 01:43
@matthew02 I will right now.
@matthew02 In that case, they always stack and are never in a row.
max77p
@max77p
Oct 08 2015 01:45
can someone help me understand the arguments function?
what (arguments, 1) actually means?
James Smith
@matthew02
Oct 08 2015 01:48
@mjeff7 Maybe change them from <div>s to <span>s or use custom css to make them display: inline-block.
mjeff7
@mjeff7
Oct 08 2015 01:49
@matthew02 I was just thinking the same thing and tried just that. I get rows that wrap rather than stacking all at once.
James Smith
@matthew02
Oct 08 2015 01:50
@mjeff7 With display: inline-block?
mjeff7
@mjeff7
Oct 08 2015 01:51
@matthew02 Yes. Likewise with just inline.
James Smith
@matthew02
Oct 08 2015 01:54
@mjeff7 You changed the inner divs to inline-block? Did you try adjusting their margin? What do you mean "rows that wrap"?
mjeff7
@mjeff7
Oct 08 2015 01:55
Actually, what I want to do would be simply to switch from display: inline to display: block when the width gets too small for everything to be side-by-side. Anyone know how to do that?
Or even md and larger it's inline and sm and smaller it's block.
James Smith
@matthew02
Oct 08 2015 01:57
@mjeff7 I'm guessing you need to use media-queries for that.
@mjeff7 Maybe something like the following...
@media only screen and (max-width: 500px) {
    div {
        display: block;
    }
}
mjeff7
@mjeff7
Oct 08 2015 02:02
@matthew02 Oh, that's new to me. I'll need a bit to digest it.
mjeff7
@mjeff7
Oct 08 2015 02:08
@matthew02 Solving it for now with <br class="visible-xs"> appropriately placed.
@matthew02 Thanks for the help, and the suggestion about @media. I'm gonna look into that now.
CamperBot
@camperbot
Oct 08 2015 02:09
mjeff7 sends brownie points to @matthew02 :sparkles: :thumbsup: :sparkles:
:star: 323 | @matthew02 | http://www.freecodecamp.com/matthew02
Trish Snyder
@TrishSnyder
Oct 08 2015 02:09
Thank you @SaintPeter for the help!
CamperBot
@camperbot
Oct 08 2015 02:09
trishsnyder sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 907 | @saintpeter | http://www.freecodecamp.com/saintpeter
James Smith
@matthew02
Oct 08 2015 02:10
@mjeff7 Sure thing! Glad you found a solution. Wish I was more skilled at CSS and could have helped you out better.
mjeff7
@mjeff7
Oct 08 2015 02:15
@matthew02 You helped plenty. And sometimes just having someone to bounce ideas around with is the biggest help of all.
James Smith
@matthew02
Oct 08 2015 02:17
@mjeff7 For sure. Sometimes I just need to talk through it with someone else. Rubber duck debugging ftw.
Tyler Moeller
@TylerMoeller
Oct 08 2015 02:18
function myFunction(str) {
  if (str === "string") {
    return true;
  }
  return false;
}
myFunction("string");

function myFunction(str) {
  if (str === "string") {
    return true;
  } else {
    return false;
  }
}
myFunction("string");
curious - which way is preferred? With or without 'else'
James Smith
@matthew02
Oct 08 2015 02:19
@TylerMoeller Without the else seems more clear to me, but it's probably simpler to just
function myFunction(str) {
  return str === "string";
}
Tyler Moeller
@TylerMoeller
Oct 08 2015 02:20
Without else also seems clearer, but not sure if it's more readable in a larger function.
Or if there's a difference for perf
mixa97
@mixa97
Oct 08 2015 02:23
blob
DragonKahn
@DragonKahn
Oct 08 2015 02:24
I need some sliiight help on the Use the Bootstrap Grid to Put Elements Side By Side, the only issue I have is nesting all the button codes
James Smith
@matthew02
Oct 08 2015 02:24
@TylerMoeller I would imagine it's more relevant when there are more than two conditions, but I'm pretty sure switch is more performant in that case (if not more readable).
Tyler Moeller
@TylerMoeller
Oct 08 2015 02:24
Thanks @matthew02
CamperBot
@camperbot
Oct 08 2015 02:24
tylermoeller sends brownie points to @matthew02 :sparkles: :thumbsup: :sparkles:
:star: 324 | @matthew02 | http://www.freecodecamp.com/matthew02
James Smith
@matthew02
Oct 08 2015 02:25
And that's how you use the word "more" four times in one statement!
Tyler Moeller
@TylerMoeller
Oct 08 2015 02:26
Lol - didn't catch that
James Smith
@matthew02
Oct 08 2015 02:27
:joy:
Tyler Moeller
@TylerMoeller
Oct 08 2015 02:30
@DragonKahn The button codes look fine. That last test is failing because your p element is still using the monospace font
I think you're on a different one: Waypoint: Ditch Custom CSS for Bootstrap, right?
Sorry - getting Mixa mixed up with dragons...maybe time for dinner
DragonKahn
@DragonKahn
Oct 08 2015 02:46
Wrong Dragon lol
Im on Use the Bootstrap Grid to Put Elements Side By Side
vere perrot
@perrot
Oct 08 2015 02:51
find the change due
CamperBot
@camperbot
Oct 08 2015 02:51
find the change due
nothing found
David Klein
@dwklein49
Oct 08 2015 02:51

I'm looking for a little help with the longest word challenge. This is the code I wrote:
function findLongestWord(str) {
var words = str.split(" ");
var count = words.length;
for(i = 0; i < count; i++) {

 if(longWord < words[i].length) {
    longWord = words[i].length;
}

}

return longWord;
}
findLongestWord("The quick brown fox jumped over the lazy dog");

EngineeredEdge
@EngineeredEdge
Oct 08 2015 02:52
@dwklein49 take a look at how to paste code wiki code format
David Klein
@dwklein49
Oct 08 2015 02:52
ok. where can I find that?
EngineeredEdge
@EngineeredEdge
Oct 08 2015 02:52
wiki code format
CamperBot
@camperbot
Oct 08 2015 02:52

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

vere perrot
@perrot
Oct 08 2015 02:52
Bonfire Exact Change
CamperBot
@camperbot
Oct 08 2015 02:52

:fire:Bonfire: Exact Change :link:

function drawer(price, cash, cid) {
  var change;
  // Here is your change, ma'am.
  return change;
}

// Example cash-in-drawer array:
// [['PENNY', 1.01],
// ['NICKEL', 2.05],
// ['DIME', 3.10],
// ['QUARTER', 4.25],
// ['ONE', 90.00],
// ['FIVE', 55.00],
// ['TEN', 20.00],
// ['TWENTY', 60.00],
// ['ONE HUNDRED', 100.00]]

drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);

Design a cash register drawer function that accepts purchase price as the first argument, payment as the second argument, and cash-in-drawer (cid) as the third argument.

more info:  bf details | bf links | hint

David Klein
@dwklein49
Oct 08 2015 02:52
thanks be right back.
CamperBot
@camperbot
Oct 08 2015 02:52
if you want to thank someone, put an @ before their name!
David Klein
@dwklein49
Oct 08 2015 02:53
@camperbot
vere perrot
@perrot
Oct 08 2015 02:54
Hi , I don't know what is "the change due". I am work in "Bonfire: Exact Change". Have someone can explain this? Thanks.
EngineeredEdge
@EngineeredEdge
Oct 08 2015 02:54
@perrot what don't you understand?
David Klein
@dwklein49
Oct 08 2015 02:54

Trying to get a little help with the longest word challenge.
```function findLongestWord(str) {
var words = str.split(" ");
var count = words.length;
for(i = 0; i < count; i++) {

 if(longWord < words[i].length) {
    longWord = words[i].length;
}

}

return longWord;
}
findLongestWord("The quick brown fox jumped over the lazy dog");
I keep getting a Program Execution Failure

sorry. I guess did it again.
James Smith
@matthew02
Oct 08 2015 02:55
@dwklein49 Put a newline after the backticks.
EngineeredEdge
@EngineeredEdge
Oct 08 2015 02:55
function findLongestWord(str) {
var words = str.split(" ");
var count = words.length;
for(i = 0; i < count; i++) {

 if(longWord < words[i].length) {
    longWord = words[i].length;
}

}

return longWord;
}
findLongestWord("The quick brown fox jumped over the lazy dog");
James Smith
@matthew02
Oct 08 2015 02:55
@dwklein49 You need three backticks, newline, your code, newline, three more backticks.
EngineeredEdge
@EngineeredEdge
Oct 08 2015 02:55
1) where is longWord first defined?
David Klein
@dwklein49
Oct 08 2015 02:56
ah. it's not I probably should have declared it outside the For loop, right?
EngineeredEdge
@EngineeredEdge
Oct 08 2015 02:56
si
David Klein
@dwklein49
Oct 08 2015 02:56
and there ya go. @EngineeredEdge gracias. I'll work on my pasting code, too.
EngineeredEdge
@EngineeredEdge
Oct 08 2015 02:57
:) have you been introduced to array.reduce yet?
and camperbot doesn't speak spanish, apparently
David Klein
@dwklein49
Oct 08 2015 02:57
I believe so.
It removes an array item, right? The last one?
EngineeredEdge
@EngineeredEdge
Oct 08 2015 02:57
nope. you are thinking .pop
Oliver Ai
@OliverAi27
Oct 08 2015 02:58
@DustinBaker22 Finally got it. I had to apply the CSS class declaration to the html using those two you mentioned. Google was overwhelming lol. Continuing my lessons...
EngineeredEdge
@EngineeredEdge
Oct 08 2015 02:58
did you do this waypoint?
[it's admittedly a very vague introduction]
David Klein
@dwklein49
Oct 08 2015 02:59
yes, I did. I had to go back and look it up.
EngineeredEdge
@EngineeredEdge
Oct 08 2015 02:59
you can write a good solution using .reduce
vere perrot
@perrot
Oct 08 2015 03:00

@EngineeredEdge Like this sentence <Return the string "Insufficient Funds" if cash-in-drawer is less than the change due.>.

I think the sentence means that
If the parameters like this:
19.50, 20.00, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.10], ["QUARTER", 4.25], ["ONE", 90.00], ["FIVE", 55.00], ["TEN", 20.00], ["TWENTY", 60.00], ["ONE HUNDRED", 100.00]]

The change due is 20.00-19.50=0.5. Right?

EngineeredEdge
@EngineeredEdge
Oct 08 2015 03:00
i believe so yes
David Klein
@dwklein49
Oct 08 2015 03:01
The sum displayed is easy to miss, but that's good, I will take a look at that as a to perform these functions.
thanks @EngineeredEdge
CamperBot
@camperbot
Oct 08 2015 03:01
dwklein49 sends brownie points to @engineerededge :sparkles: :thumbsup: :sparkles:
:star: 355 | @engineerededge | http://www.freecodecamp.com/engineerededge
vere perrot
@perrot
Oct 08 2015 03:03
@EngineeredEdge Thank you for your help. I got it.
CamperBot
@camperbot
Oct 08 2015 03:03
perrot sends brownie points to @engineerededge :sparkles: :thumbsup: :sparkles:
:star: 356 | @engineerededge | http://www.freecodecamp.com/engineerededge
EngineeredEdge
@EngineeredEdge
Oct 08 2015 03:04
@dwklein49 can you accomplish find the longest word with .reduce?
Herman Fassett
@HermanFassett
Oct 08 2015 03:04
Herman Fassett sends brownie points to @camperbot :sparkles: :+1: :sparkles:
:star: 1000000 | @camperbot | http://www.freecodecamp.com/camperbot
David Klein
@dwklein49
Oct 08 2015 03:04
I'll give it a shot. But I'm at work right now. And coding one line at a time will take a while.
@EngineeredEdge
EngineeredEdge
@EngineeredEdge
Oct 08 2015 03:05
:) lucky for you, the solution is a simple one liner!
Herman Fassett
@HermanFassett
Oct 08 2015 03:06
reduce generally combines all elements in array somehow, yes? So how would that work for longest word? I haven't used reduce much...
EngineeredEdge
@EngineeredEdge
Oct 08 2015 03:07
like so
function findLongestWord(str) {
  // and now, using recursion
  function cmp(longest, word) {
    return (longest < word.length) ? word.length : longest;
  }
  return str.split(' ').reduce(cmp,0);
}

findLongestWord("The quick brown fox jumped over the lazy dog");
forget that no using recursion comment, that was for my last solution that i deleted. (using recursion is stupid for this problem, but I did it just to practice)
Herman Fassett
@HermanFassett
Oct 08 2015 03:08
Brilliant :P
EngineeredEdge
@EngineeredEdge
Oct 08 2015 03:09
when did you start FCC herman?
the curriculum a few months ago had a much longer introduction to functional programming
i'd recommend it, certainly, if i could remember what it was
[it was not content created by FCC]
Herman Fassett
@HermanFassett
Oct 08 2015 03:13
I joined September 4, skipped a few weeks and now am on a streak
EngineeredEdge
@EngineeredEdge
Oct 08 2015 03:14
so did your curriculum include what i'm talking about or no
Herman Fassett
@HermanFassett
Oct 08 2015 03:14
I don't think so. This past change is the first one for me
EngineeredEdge
@EngineeredEdge
Oct 08 2015 03:16
the first time i really understood how powerful reduce could be was when I came across this answer
Herman Fassett
@HermanFassett
Oct 08 2015 03:17
Ok @EngineeredEdge thanks
CamperBot
@camperbot
Oct 08 2015 03:17
hermanfassett sends brownie points to @engineerededge :sparkles: :thumbsup: :sparkles:
:star: 357 | @engineerededge | http://www.freecodecamp.com/engineerededge
mjeff7
@mjeff7
Oct 08 2015 03:28
Anyone know of any tricks to make JS more workable as a language? It seems just a tad off in a lot of ways. For example, it's missing convenient iteration and member inclusion tests among other things, Math.max doesn't work as an argument to reduce, etc. There are a lot of little things that would make it much nicer to work with.
Herman Fassett
@HermanFassett
Oct 08 2015 03:28
I prefer it to a lot of languages actually
for loops are fine
And you can use for (something in somethingelse) in some cases
Brian Herron
@bherron87
Oct 08 2015 03:29
Hello all,
Herman Fassett
@HermanFassett
Oct 08 2015 03:30
@bherron87 hi
Sarkunan V (Rax)
@raxIsBlur
Oct 08 2015 03:30
@bherron87 hey :)
Brian Herron
@bherron87
Oct 08 2015 03:30
Can someone tell me why this jQuery code won't work:
$('body').addclass('animated hinge');
mjeff7
@mjeff7
Oct 08 2015 03:30
@HermanFassett Have you checked out underscore.js?
Brian Herron
@bherron87
Oct 08 2015 03:30
it wont let me pass a lesson
Sarkunan V (Rax)
@raxIsBlur
Oct 08 2015 03:30
addClass ?
Herman Fassett
@HermanFassett
Oct 08 2015 03:30
addClass with a capital
I think
Sarkunan V (Rax)
@raxIsBlur
Oct 08 2015 03:30
^ yup
Herman Fassett
@HermanFassett
Oct 08 2015 03:31
@mjeff7 no
Brian Herron
@bherron87
Oct 08 2015 03:32
@HermanFassett that worked, Thanks!
CamperBot
@camperbot
Oct 08 2015 03:32
bherron87 sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 332 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Oct 08 2015 03:32
Yep
Yoav Farkash
@yfarkash
Oct 08 2015 03:58
Hi there. I'm kinda new and have a question regarding one of the first ziplines.
Travis
@TravisHi
Oct 08 2015 03:59
@yfarkash sure
Yoav Farkash
@yfarkash
Oct 08 2015 03:59
im trying to figure out of to debug a "program execution failure" message.
Travis
@TravisHi
Oct 08 2015 03:59
can you post your code in between ```?
(in the chat here so we can see it)
Yoav Farkash
@yfarkash
Oct 08 2015 04:00
I think it means something is wrong with the syntax so it can not be evaluated, but I can't see whats wrong with the syntax.
Travis
@TravisHi
Oct 08 2015 04:00
generally yeah
Yoav Farkash
@yfarkash
Oct 08 2015 04:00
sure/

' function palindrome(str) {
// Good luck!

// make the string lower case
var string = str.toLowerCase;

// keep only the letters a-z with a replace funciton using the [^a-z] regexp
string = string.replace([^a-z],'',g);

// make a reversed string using the change to an array
var reverseString = string.split('');
reverseString = reversString.reverse();

// compare the two strings while setting the return value
if (string === reverseString) {
return true;
}
else {return false;
}
}'

Herman Fassett
@HermanFassett
Oct 08 2015 04:01
toLowerCase should have parentheses first off @yfarkash
Yoav Farkash
@yfarkash
Oct 08 2015 04:01
damn... :-)
Herman Fassett
@HermanFassett
Oct 08 2015 04:01
reverseString gets typed wrong at one point
Yoav Farkash
@yfarkash
Oct 08 2015 04:02
ok, now im feeling silly...
Herman Fassett
@HermanFassett
Oct 08 2015 04:02
Also check to make sure your regex is working right for all tests
Yoav Farkash
@yfarkash
Oct 08 2015 04:02
ok, thats actually another question I have.
there is no live console or any way to trace variabes.
Herman Fassett
@HermanFassett
Oct 08 2015 04:03
Regex is usually shown as replace(/[^a-z]/g, '');
Yoav Farkash
@yfarkash
Oct 08 2015 04:03
how can I check things in my logic as I go about writing code? I can't do a step-and-evalute, can I?:
Herman Fassett
@HermanFassett
Oct 08 2015 04:03
You can use your browsers console to help testing, or write your code on a separate site such as http://repl.it
Yoav Farkash
@yfarkash
Oct 08 2015 04:04
ok, well, the palindrome challenge at least is not ""program execution failure" anymore. :-)
now just to fixing my logic.
Herman Fassett
@HermanFassett
Oct 08 2015 04:05
If you're chrome
Boris
@boris-in-london
Oct 08 2015 04:05
@ykocak if you're using chrome, press Ctrl + shift + j. console pops up.
Herman Fassett
@HermanFassett
Oct 08 2015 04:05
Or F12 I think
Ctrl+Shift+K for Firefox
Boris
@boris-in-london
Oct 08 2015 04:05
paste your code there... and add a debugger; tag at the line you want to start debugging. chrome does the rest.
press f10 to move through the code. step by step.
Herman Fassett
@HermanFassett
Oct 08 2015 04:06
I love chrome
Boris
@boris-in-london
Oct 08 2015 04:06
^
me too!
Yoav Farkash
@yfarkash
Oct 08 2015 04:06
oh wow! I got to try that. But ctrl+shift+j doesnt seem to do anything...
Herman Fassett
@HermanFassett
Oct 08 2015 04:06
Are you on chrome?
Herman Fassett
@HermanFassett
Oct 08 2015 04:08
Try F12 or go to menu, More Tools, Developer tools
Lol @boris-in-london I just posted that link 3 minutes ago
Yoav Farkash
@yfarkash
Oct 08 2015 04:09
hhmm... ok, I got the console open, added a debugger; tag, but how do I now test my function with a value? I mean, how do I initiate a call to the function?
Boris
@boris-in-london
Oct 08 2015 04:09
loool sorry... i'm two screening.
Herman Fassett
@HermanFassett
Oct 08 2015 04:09
palindrome("A man, a plan, a canal - panama");
Yoav Farkash
@yfarkash
Oct 08 2015 04:11
ok. Plus, I'll check out the link, seems like it will have all the instructions there. slowly moving into the real world! :-)
Herman Fassett
@HermanFassett
Oct 08 2015 04:11
:yum:
Yoav Farkash
@yfarkash
Oct 08 2015 04:11
thanks for the help, i'll go do some reading!
CamperBot
@camperbot
Oct 08 2015 04:11
if you want to thank someone, put an @ before their name!
vere perrot
@perrot
Oct 08 2015 04:53
Hi,
I am work in the unit "Bonfire: Exact Change".
I get stuck at the test case 5. The problem is how to output a number with two decimal point. For example: input is 60, output is 60.00. Thanks
drawer(3.26, 100.00, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.10], ["QUARTER", 4.25], ["ONE", 90.00], ["FIVE", 55.00], ["TEN", 20.00], ["TWENTY", 60.00], ["ONE HUNDRED", 100.00]]) should return [["TWENTY", 60.00], ["TEN", 20.00], ["FIVE", 15], ["ONE", 1], ["QUARTER", 0.50], ["DIME", 0.20], ["PENNY", 0.04]].
CamperBot
@camperbot
Oct 08 2015 04:53
if you want to thank someone, put an @ before their name!
Oumar diarra
@oudi15
Oct 08 2015 04:56
hi guys. for some reason i am not able to pass the "size your image" challenge
i think the code is correct and the image has been resized
but the test failed
Rex Schrader
@SaintPeter
Oct 08 2015 04:57
Can you share your link/code?
@perrot You don't need to output with the extra decimals. You may, however, need to round your numbers. There is some floating point innaccuracy.
@perrot You can use this code:
var rounded = Math.round(someChange * 100) / 100;
Oumar diarra
@oudi15
Oct 08 2015 04:59

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

<style>

.smaller-image {

width: 100px;
}

.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

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



</style>

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

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

Rex Schrader
@SaintPeter
Oct 08 2015 05:00
@oudi15 Humm, that does look correct. Let me poke at it a moment.
Oumar diarra
@oudi15
Oct 08 2015 05:01
ok
D3v1n
@D3v1n
Oct 08 2015 05:01
Hello, I'm stuck on "Waypoint: Learn How Script Tags and Document Ready Work." I've inserted the correct script and hit ctrl+enter and the "To-Do" list on the left of the screen went blank. How do I move onto the next Waypoint?
Rex Schrader
@SaintPeter
Oct 08 2015 05:01
@oudi15 I just ran your code in my browser and it passed.
@oudi15 Try resetting your code and/or refreshing your browser page and retry.
@D3v1n Can you share your code?
@D3v1n And have you tried refreshing the browser?
Oumar diarra
@oudi15
Oct 08 2015 05:02
i tried those
Rex Schrader
@SaintPeter
Oct 08 2015 05:02
@oudi15 What browser are you on?
Oumar diarra
@oudi15
Oct 08 2015 05:03
chrome
Rex Schrader
@SaintPeter
Oct 08 2015 05:03
@oudi15 Press F12 (assuming you're on windows) to open the dev console and refresh the page. Check to see if there are any errors in the dev console
Oumar diarra
@oudi15
Oct 08 2015 05:04
ok
@SaintPeter no error
D3v1n
@D3v1n
Oct 08 2015 05:05
<script>$(document).ready(function() { });</script>
yea ive tried refreshing it a few times
Rex Schrader
@SaintPeter
Oct 08 2015 05:06
@oudi15 Humm. One more thing to try. With the dev console open, press and hold the refresh button until it pops up a menu. Select "Empty Cache and Hard Reload"
@D3v1n You need a new line after your opening curly brace but before the closing curly brace.
@D3v1n
<script>
$(document).ready(function() { 
});
</script>
Oumar diarra
@oudi15
Oct 08 2015 05:07
ok
D3v1n
@D3v1n
Oct 08 2015 05:07
thats how i have it on the waypoint screen
Rex Schrader
@SaintPeter
Oct 08 2015 05:08
@D3v1n Hummmmmmm. Lemme poke
Oumar diarra
@oudi15
Oct 08 2015 05:08
@SaintPeter that didn't work either
Rex Schrader
@SaintPeter
Oct 08 2015 05:09
@D3v1n I just ran it on my local machine and it worked fine.
@oudi15 @D3v1n I'm afraid I'm out of ideas. For the moment, move on to the next Waypoint and see if that works for you. You can come back later.
Oumar diarra
@oudi15
Oct 08 2015 05:10
@SaintPeter ok. Thanks
CamperBot
@camperbot
Oct 08 2015 05:10
oudi15 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 908 | @saintpeter | http://www.freecodecamp.com/saintpeter
D3v1n
@D3v1n
Oct 08 2015 05:10
thank you @SaintPeter
CamperBot
@camperbot
Oct 08 2015 05:10
d3v1n sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 909 | @saintpeter | http://www.freecodecamp.com/saintpeter
D3v1n
@D3v1n
Oct 08 2015 05:17
None of the Jquery waypoints are working for me. Do you think there is a setting on my computer or browser i need to change for it to work properly? @SaintPeter
Logan Tegman
@ltegman
Oct 08 2015 05:31
@D3v1n What browser are you working in? I’ve seen some reports of people having issues with the JQuery waypoints in Firefox
D3v1n
@D3v1n
Oct 08 2015 05:33
im using IE11 and ive also tried it in microsoft edge and neither worked
Travis
@TravisHi
Oct 08 2015 05:48
is goto not a reserved name in javascript?
Logan Tegman
@ltegman
Oct 08 2015 06:07
@D3v1n Chrome is the only browser officially supported by FCC, so you may want to try it out in there and see if things go better.
@TravisHi Not anymore. It was in Ecmascript 1-3 but not in 5 and beyond.
Charlotte
@Charzoe
Oct 08 2015 06:08

I'm having a weird bootstrap conflict in my webpage, that's screwing with the menu bar, does anyone know how to fix it?

http://codepen.io/Charzoe/details/LpLVar/

Also, how can I move the menu bar up closer to the rest of the page, and makingthe white text disappear when the menu is clicked, giving it room to expand properly?

Travis
@TravisHi
Oct 08 2015 06:10
oh cool, thanks @ltegman
CamperBot
@camperbot
Oct 08 2015 06:10
travishi sends brownie points to @ltegman :sparkles: :thumbsup: :sparkles:
:star: 235 | @ltegman | http://www.freecodecamp.com/ltegman
Avishay
@avishayshushan
Oct 08 2015 06:14
@navicyclical maximum = maximum word length
i do not think you need to use Math.max, you can compare between str.length to the current max(start with 0)
navicyclical
@navicyclical
Oct 08 2015 06:21
@avishayshushan how do I do that, or do I use a comparison operatior like str.length>current max?
Avishay
@avishayshushan
Oct 08 2015 06:22
yes
@navicyclical if true the new current max will be str.length
str = a single word from the sentence
loop should go through all the words
navicyclical
@navicyclical
Oct 08 2015 06:24
looks like I need to rework my for loop
azaleas
@azaleas
Oct 08 2015 06:29
This message was deleted
CamperBot
@camperbot
Oct 08 2015 06:29
no wiki entry for: bonifer friendly dates
:pencil: click here to create one now!after creating your page type update to reload it here
navicyclical
@navicyclical
Oct 08 2015 06:30
I haven't added a return statement quite yet...
function findLongestWord(str) {
  var stringOfWords = str.split(" ");
  var lengths = [];
  for(var i=0; lengths[i]<stringOfWords[i]; i++){
    lengths[i] = stringOfWords[i].length;
      }
  }
azaleas
@azaleas
Oct 08 2015 06:30
This message was deleted
CamperBot
@camperbot
Oct 08 2015 06:30
no wiki entry for: bonfire friendly dates
:pencil: click here to create one now!after creating your page type update to reload it here
azaleas
@azaleas
Oct 08 2015 06:30
help bonfire friendly date
CamperBot
@camperbot
Oct 08 2015 06:30

:point_right: bonfire friendly date ranges [wiki]

Problem Explanation:

  • Create a program that will take two dates and convert them into a more easy to understand date such as January 1st, 2017. It will also check the difference between them, and handles cases with no difference, more than a day, more than a month, more than a year, and more than a month and less than a year respectively.
:pencil: read more about bonfire friendly date ranges on the FCC Wiki
Abhisek Pattnaik
@abhisekp
Oct 08 2015 06:30

Using git? Let's super charge :battery: it with hub power!! :muscle:

Abhisek Pattnaik
@abhisekp
Oct 08 2015 06:48

@SaintPeter :innocent: should this be squash or fixup?
https://github.com/freecodecamp/freecodecamp/wiki/git-rebase#squashing-multiple-commits-into-one

Leave the first commit alone, and change the rest of the pick, s to squash. Save and exit the editor.

Shouldn't it be f to fixup?

Jason
@Jauble
Oct 08 2015 06:49
I'm trying to set up my workspace in Chrome dev tools and it's not working. Is anyone familiar with that?
Abhisek Pattnaik
@abhisekp
Oct 08 2015 06:52
@Jauble
Jason
@Jauble
Oct 08 2015 06:52
For one, in the directions it says: Right click on a file and choose Map to File System Resource. When I right click it says Map to network resource. Is that the same thing?
Thanks @abhisekp !
CamperBot
@camperbot
Oct 08 2015 06:52
jauble sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 547 | @abhisekp | http://www.freecodecamp.com/abhisekp
Jason
@Jauble
Oct 08 2015 07:04
@abhisekp Am I supposed to do something to save my changes? When I refresh the changes disappear
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:04
@Jauble Press CTRL+S
Frank Moses
@fmbike2
Oct 08 2015 07:04
Has anyone else had trouble with Waypoint 20 in the Javascript section? http://freecodecamp.com/challenges/waypoint-manipulate-arrays-with-pop
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:05
@fmbike2 nope!
kaushalmathpal
@kaushalmathpal
Oct 08 2015 07:06
what does this means ---- "You should split the string by its spaces."
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:10
@kaushalmathpal split a string to create an array of strings but only where there is space.
Malcolm
@noinkling
Oct 08 2015 07:11
@kaushalmathpal For instance, if you have a string "like this one", then splitting it by its spaces would give you three strings: "like" "this" "one"
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:11
@kaushalmathpal e.g.
"I'm a bad boy".split(' '); // ["I'm", "a", "bad", "boy"]
Malcolm
@noinkling
Oct 08 2015 07:11
And yes, typically achieved like that^
kaushalmathpal
@kaushalmathpal
Oct 08 2015 07:12
@abhisekp thanks ...got it now
CamperBot
@camperbot
Oct 08 2015 07:12
kaushalmathpal sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 548 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:12
@kaushalmathpal so you accept that you're a bad boy? :P
kaushalmathpal
@kaushalmathpal
Oct 08 2015 07:13
@abhisekp there is no problem in being bad :smile:
Jason
@Jauble
Oct 08 2015 07:13
@abhisekp When I hit ctrl s it brings up the box to save it, and gives it a different name. If I change the name back to the original and save it, it freezes chrome
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:14
@Jauble where are you pressing that CTRL+S?
DefinitelyHot
@DefinitelyHot
Oct 08 2015 07:14
hello, I want to ask, if there is a way, to type somewere just line of codes to see what they return. In exemple I am not sure where my code is bad and want to check what my commands return while i am doing bonefire
whathejoe
@whathejoe
Oct 08 2015 07:14
@DefinitelyHot what language?
shitala
@shitala099
Oct 08 2015 07:15
DefinitelyHot
@DefinitelyHot
Oct 08 2015 07:15
java script , i am on basic algorithm scripting
whathejoe
@whathejoe
Oct 08 2015 07:15
@DefinitelyHot for javascript you can use jsfiddle
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:15
@Jauble You should press here
DefinitelyHot
@DefinitelyHot
Oct 08 2015 07:15
@whathejoe thank you, I will check it
CamperBot
@camperbot
Oct 08 2015 07:15
definitelyhot sends brownie points to @whathejoe :sparkles: :thumbsup: :sparkles:
:star: 25 | @whathejoe | http://www.freecodecamp.com/whathejoe
kaushalmathpal
@kaushalmathpal
Oct 08 2015 07:16
@abhisekp whts wrong with this split --- var array = string.split("Split""me""into""an""array");
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:16
explain js res
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:16
@DefinitelyHot :point_up: October 8, 2015 12:46 PM
@kaushalmathpal Read this http://devdocs.io/#q=js+String+split
vere perrot
@perrot
Oct 08 2015 07:17
@SaintPeter Thank you very much. Best explain. :+1:
CamperBot
@camperbot
Oct 08 2015 07:17
perrot sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 910 | @saintpeter | http://www.freecodecamp.com/saintpeter
Azulem Ariolu
@Meluza
Oct 08 2015 07:17
@DefinitelyHot i use jsbin.com if it help you
Avil
@Avil172
Oct 08 2015 07:18
@abhisekp what is that image anyway?
can't open in a new tab
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:18
@Avil172 which img? That devtool by pressing F12 in Chrome?
Avil
@Avil172
Oct 08 2015 07:20
You should press here
@abhisekp
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:21
@Avil172
  1. :point_up: October 8, 2015 12:22 PM
  2. :point_up: October 8, 2015 12:45 PM
Avil
@Avil172
Oct 08 2015 07:21
@abhisekp how did you capture and post it here anyways..
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:21
DefinitelyHot
@DefinitelyHot
Oct 08 2015 07:22
@Meluza i will check it too
var str = " i am new to js programming, help me.";
var str1 = str.replace(/ /gi, '');
var str2 = str1.replace(/,/gi,'');
var str3 = str2.replace(/./gi,'');
console.log(str1);
console.log(str2);
console.log(str3);
why on str3 the console return empty string "" after removing the spaces and the ","
Jason
@Jauble
Oct 08 2015 07:26
@abhisekp When I click on the tab it doesn't do anything. When I click on the file on the left, it gives me the option to save, but when I click save and hit refresh, the page doesn't update
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:26
:expressionless:
Jason
@Jauble
Oct 08 2015 07:29
@abhisekp Oh well, thanks for the help though!
CamperBot
@camperbot
Oct 08 2015 07:29
jauble sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:warning: jauble already gave abhisekp points
Yan Kozlovskiy
@YanKozlovskiy
Oct 08 2015 07:34

Variable "words" has the same name as the argument. This does not return NaN. (below)

var superCounter = function(words) {
    const string = words;
    var words = string.split(' ').length;
    var characters = string.split('').length;
    var averageLength = characters / words;
    var spaces = string.length - words;

    var table = {
        "words": words,
        "chars": characters,
        "avgLength": averageLength,
        "spaces": spaces
    };
    return table;

    // console.log(words);
}

superCounter("Count me in");

Variable "words" has been changed to another name since it has the same name as the argument. This returns NaN. (below)

var superCounter = function(words) {
    const string = words;
    var totalWords= string.split(' ').length;
    var characters = string.split('').length;
    var averageLength = characters / words;
    var spaces = string.length - words;

    var table = {
        "words": totalWords,
        "chars": characters,
        "avgLength": averageLength,
        "spaces": spaces
    };
    return table;

    // console.log(words);
}

superCounter("Count me in");

Why is it returning NaN when you use a different name for the variable?

Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:42
@YanKozlovskiy Error here var averageLength = characters / words;
and here var spaces = string.length - words;
Bob Moree
@bmoree
Oct 08 2015 07:43
Hi

I'm struggling to understand what I did wrong here:

function titleCase(str) {
// to lower case
// split to array
// for loop capitalize charAt(0)
str.toLowerCase();
var array = str.split(" ")

for(var i = 0; i <= array.length; i++) {
var tW = array[i];
return tW;
var cap = tW.charAt(0);
cap.replace(cap, function(){
cap = cap.toUpperCase();
});
}
var nStr = array.join(" ");
return nStr;
}

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

Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:43
explain format
CamperBot
@camperbot
Oct 08 2015 07:43

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:43
@bmoree :point_up: October 8, 2015 1:13 PM
Rob Simpson
@pertrai1
Oct 08 2015 07:43

I posted this a couple days ago and still at a loss for what logic is needed to solve the diff:

```
function diff(arr1, arr2) {
var newArr = [];
var newArr1 = arr1.slice(0);
var newArr2 = arr2.slice(0);
var newConcat = newArr1.concat(newArr2);
newConcat.filter(function(value, index, array) {

})
console.log(newConcat);
return newArr;
}

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

Bob Moree
@bmoree
Oct 08 2015 07:43
thanks
CamperBot
@camperbot
Oct 08 2015 07:43
if you want to thank someone, put an @ before their name!
Bob Moree
@bmoree
Oct 08 2015 07:44
thanks @abhisekp
CamperBot
@camperbot
Oct 08 2015 07:44
bmoree sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 550 | @abhisekp | http://www.freecodecamp.com/abhisekp
Bob Moree
@bmoree
Oct 08 2015 07:45
like this then:
function titleCase(str) {
  // to lower case
  // split to array
  // for loop capitalize charAt(0)
  str.toLowerCase();
  var array = str.split(" ")

  for(var i = 0; i <= array.length; i++) {
    var tW = array[i];
    return tW;
    var cap = tW.charAt(0);
    cap.replace(cap, function(){
      cap = cap.toUpperCase();
    });
  }
  var nStr = array.join(" ");
  return nStr;
}

titleCase("I'm a little tea pot", "");
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:46
ah! that's pretty!! :+1:
@bmoree so what's the issue?
Bob Moree
@bmoree
Oct 08 2015 07:47
can't read charAt of undefined
Yan Kozlovskiy
@YanKozlovskiy
Oct 08 2015 07:47
@abhisekp thanks for pointing that out! :)
CamperBot
@camperbot
Oct 08 2015 07:47
yankozlovskiy sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 551 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:48
@bmoree i <= array.length There is no array[array.length] element since arrays start with 0 index
@bmoree arrays go from 0...array.length-1
so you should rewrite it as i < array.length instead of i <= array.length
Rob Simpson
@pertrai1
Oct 08 2015 07:51
Any ideas on my diff code that has me stumped?
Bob Moree
@bmoree
Oct 08 2015 07:52
That worked, but still it doesn't save the capitalized words into the new string
Updated version:
function titleCase(str) {
  // to lower case
  // split to array
  // for loop capitalize charAt(0)
  str.toLowerCase();
  var array = str.split(" ")

  for(var i = 0; i < array.length; i++) {
    var tW = array[i];
    var cap = tW.charAt(0);
    tW = tW.replace(cap, cap.toUpperCase());
   }
  var nStr = array.join(" ");
  return nStr;
}
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:53
@pertrai1 You don't need to write slice(0). Just write slice()
var newArr1 = arr1.slice(0);
var newArr2 = arr2.slice(0);
Arrangedfoot325
@Arrangedfoot325
Oct 08 2015 07:54
Hey, when I click test it gets rid of the check boxes and nothing happens
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:54
@bmoree cap is just a character which can match any of the characters in the string while replacing.
@Arrangedfoot325 Where?
bf diff
CamperBot
@camperbot
Oct 08 2015 07:55

:fire:Bonfire: Diff Two Arrays :link:

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

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

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

more info:  bf details | bf links | hint

Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:55
bf details
CamperBot
@camperbot
Oct 08 2015 07:55

:fire:Bonfire: Diff Two Arrays :link:

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

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Compare two arrays and return a new array with any items not found in both of the original arrays.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Aleksander Gębicki
@Takumar
Oct 08 2015 07:55
@abhisekp but what for @pertrai1 have to slice these arrays. @pertrai1 if you want to concatenate these arrrays and assign it to new array just do it on them.
var newConcat = arr1.concat(arr2);
Arrangedfoot325
@Arrangedfoot325
Oct 08 2015 07:55
@abhisekp Waypoint: Create a Form Element
Abhisek Pattnaik
@abhisekp
Oct 08 2015 07:56
@pertrai1 :point_up: October 8, 2015 1:25 PM
Does this help? The instructions.
Arrangedfoot325
@Arrangedfoot325
Oct 08 2015 07:56
I click on test my work and the check boxes go away
Nothing happens after. Doesnt tell me if its right or wrong
Rob Simpson
@pertrai1
Oct 08 2015 07:56
@abhisekp I tried to put it all together with the instructions and finally was able to get it to work. Thank you
CamperBot
@camperbot
Oct 08 2015 07:57
pertrai1 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:warning: pertrai1 already gave abhisekp points
pappilino
@pappilino
Oct 08 2015 07:58

for bonfire seek and destroy

function destroyer(arr, x, y, z, a ) {
  return arr.filter(function(el){
      return el != x && el != y && el != z && el != a;
    })

}

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

why does this code work?

Bob Moree
@bmoree
Oct 08 2015 07:58
@abhisekp I don't get it, the wiki solution does it like this:
```
Arrangedfoot325
@Arrangedfoot325
Oct 08 2015 07:58
Never mind its working now
pappilino
@pappilino
Oct 08 2015 08:00
first... it doesn't matter how many arguments i add, it still works, x y z a b c just so long it's more than 3. test case is 3. it feels like the number of arguments is hard-coded. how do i make it dynamic?
Bob Moree
@bmoree
Oct 08 2015 08:01
function titleCase(str) {
  var newstr=str.toLowerCase().split(" ");
  for(var i=0;i<newstr.length;i++){
  var f=newstr[i].charAt(0);
 newstr[i]=newstr[i].replace(newstr[i].charAt(0),function replace(f){
   return f.toUpperCase();
 });
in this replace it has the same problem: newstr1.charAt(0) is also just a string, right?
and it uses f as an argument in the replace function, why?
pappilino
@pappilino
Oct 08 2015 08:02

second ... the

return arr.filter(function(el)

arr = [1, 2, 3, 1, 2, 3], 2, 3
when it reaches arr[1] and arr[2]. isn't it filtering arr[1] against arr[2] instead of arr[0] against arr[1] or arr[2] ?

Aleksander Gębicki
@Takumar
Oct 08 2015 08:05
@pappilino your code is working because in your case z==="" and a===undefined so when when you compare your first value 1 with parameters: x, y, z, a it is different from them so your function will retur true and 1 will remain in your array. And so on with next values from array.
Abhisek Pattnaik
@abhisekp
Oct 08 2015 08:06
Aleksander Gębicki
@Takumar
Oct 08 2015 08:08
@pappilino about your second question. Your filter() is processing only array arr not arguments 2, 3, "". You call arr.filter() not [[1,2,3,1,2,3], 2, 3].filter()
Abhisek Pattnaik
@abhisekp
Oct 08 2015 08:08
gtg :wave: bye everyone
Aleksander Gębicki
@Takumar
Oct 08 2015 08:08
@abhisekp bye.
Bob Moree
@bmoree
Oct 08 2015 08:08
@abhisekp So why is the newsubstr in the curlybraces and not within the parantheses?
Bye
Kim Kwanka
@kimkwanka
Oct 08 2015 08:09
Hi there!
Bob Moree
@bmoree
Oct 08 2015 08:09
Hi @kimkwanka
Aleksander Gębicki
@Takumar
Oct 08 2015 08:09
@kimkwanka hi.
pappilino
@pappilino
Oct 08 2015 08:10
@Takumar thanks. i understand the answer for 2nd question. but i still don't understand first question
CamperBot
@camperbot
Oct 08 2015 08:10
pappilino sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 414 | @takumar | http://www.freecodecamp.com/takumar
Kim Kwanka
@kimkwanka
Oct 08 2015 08:10
I need some help on the first zipline : /
Aleksander Gębicki
@Takumar
Oct 08 2015 08:11
@pappilino Do you understand how filtering works?
pappilino
@pappilino
Oct 08 2015 08:11
not really... im confused with filter
Aleksander Gębicki
@Takumar
Oct 08 2015 08:14
@pappilino I'll try to write another code:
function leave_it_alone(arr, x) {
  return arr.filter(function(el){
  return (el === x);
  })
}

leave_it_alone([1], 1);
Kim Kwanka
@kimkwanka
Oct 08 2015 08:15
My problem is this: One of the rules in the zipline is that you'd have to "reverse engineer the example pages' functionality" - but what does functionality in this context mean? Do my buttons need hover-animations too? The same style? Do navlinks need an "active" state?.etc. etc... I'm confused... The second thing I don't get is this: One of the user stories is that there should be buttons for MY (me as in creator) social media pages. But if I only create a sample portfolio for no real person - do those links really have to link to me? :O
Aleksander Gębicki
@Takumar
Oct 08 2015 08:17
@pappilino Your filter() is processing every element of array arr so first it pass its first element arr[0] === 1 to your internal function. This function will check that el === x === 1 so it will return true. When filter gets true it knows that it should keep this element, so function leave_it_alone will return array [1]
pappilino
@pappilino
Oct 08 2015 08:17
ok
so far i understand it
DefinitelyHot
@DefinitelyHot
Oct 08 2015 08:17
guys i have a problem with palindrome bonfire . The only check my programm dosent pass is this palindrome "0_0 (: /-\ :) 0-0", the problem is with th ebrackets
pappilino
@pappilino
Oct 08 2015 08:18
@DefinitelyHot last i did it, i replace the - with "" only, ignoring the brackets. and it worked
Aleksander Gębicki
@Takumar
Oct 08 2015 08:18
@pappilino Your internal function is checking argument el it gets and will always return true or false. When it returns true filter keeps value when false filter will remove value from final array.
pappilino
@pappilino
Oct 08 2015 08:19
ok
so.... is the number of arguments optional? when it's more than it's used in the function... what happen to the unused argument?
DefinitelyHot
@DefinitelyHot
Oct 08 2015 08:20
@pappilino oh i see now, to problem but should that consider as a bug, with the dash, its not a palindrome
Dustin Baker
@DustinBaker22
Oct 08 2015 08:20
@OliverAi27 AWESOME! I'm glad to have been able to help you out! Best of luck to you on your journey!
pappilino
@pappilino
Oct 08 2015 08:20
i think so too, but it passed....and i'm not sure it's me being wrong or if it's a bug
Aleksander Gębicki
@Takumar
Oct 08 2015 08:22
@pappilino I'm not sure I should also read about that, I only see that you can create a function destroy(arr, a, b, c, d, e, f, g, ..., z) and in your case d===e===f===...=== z === undefined so your code works unless someone passes it 100 parameters.
@DefinitelyHot "Palindromes" is very hot topic here, but according to current interpretations you should remove from your string everything apart letters and digits! So your palindrome should look i.e. ab22ba
Aleksander Gębicki
@Takumar
Oct 08 2015 08:27
@kimkwanka I haven't done this zipline yet, so I can only answer you to the last question. I think that you can create an empty link <a href="#">Twitter</a>. Personally I don't have Twitter account so I would do so in such way.
DefinitelyHot
@DefinitelyHot
Oct 08 2015 08:28
@Takumar i got it , will remove them :)
Kim Kwanka
@kimkwanka
Oct 08 2015 08:30
@Takumar thanks takumar :) the thing is I really don't want to put too much effort into this zipline, since I'm in the midst of building my personal website - I don't really need a second one.
CamperBot
@camperbot
Oct 08 2015 08:30
kimkwanka sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 415 | @takumar | http://www.freecodecamp.com/takumar
Kim Kwanka
@kimkwanka
Oct 08 2015 08:31
@Takumar It would be great too know how detailed it has to be though. If a really basic page is enough I would be glad. (since there really isn't much to code there)
I'd rather finish it quickly and move on to the juicer ziplines where you get to actually explore coding some more :)
pappilino
@pappilino
Oct 08 2015 08:34
thanks takumar
CamperBot
@camperbot
Oct 08 2015 08:34
if you want to thank someone, put an @ before their name!
pappilino
@pappilino
Oct 08 2015 08:43
function where(arr, num) {
  var newArray = arr.sort();
  var index = 0;
      arr.map(function(el) {
          if (el < num) {
            index = arr.indexOf(el) + 1;
          }
      })
  return index;


}

where([2, 5, 10], 15);
is this code acceptable for bonfire "where i belong" ? i honestly don't really understand my own code. is that okay? am i learning?
Malcolm
@noinkling
Oct 08 2015 08:46
@kimkwanka I think Quincy said on the latest stream that as long as the basic functionality is in place, the user stories are implemented, and there is at least some basic styling/design, you should be all good.
Kim Kwanka
@kimkwanka
Oct 08 2015 08:47
@noinkling Thank you noinkling that is great news :D Do you happen to know the streams date?
CamperBot
@camperbot
Oct 08 2015 08:47
kimkwanka sends brownie points to @noinkling :sparkles: :thumbsup: :sparkles:
:star: 286 | @noinkling | http://www.freecodecamp.com/noinkling
Malcolm
@noinkling
Oct 08 2015 08:48
He says it somewhere in here, during the Q&A part: https://www.youtube.com/watch?v=OvIdwFTrttU
You might have trouble finding it though. Basically he emphasizes functionality, design is more subjective and lenient.
Kim Kwanka
@kimkwanka
Oct 08 2015 08:51
wow thank you very much @noinkling =D
CamperBot
@camperbot
Oct 08 2015 08:51
kimkwanka sends brownie points to @noinkling :sparkles: :thumbsup: :sparkles:
:warning: kimkwanka already gave noinkling points
Malcolm
@noinkling
Oct 08 2015 08:53
And if you watch the videos for other Ziplines, he says the design is totally up to you in those as well. Not sure if he says it in the portfolio one.
So I hope that clarifies things :P
wow what a weird emote o_O
Well not weird but I made a tongue-face and it gave me a winky-tongue-face
Kim Kwanka
@kimkwanka
Oct 08 2015 09:00
XD @noinkling Yep that pretty much cleared it up for me. Thanks again :) I presume that the portfolio zipline is meant to get your hands dirty with html and css (and probably bootstrap), so I guess that the guidelines aren't too strict here.
CamperBot
@camperbot
Oct 08 2015 09:00
kimkwanka sends brownie points to @noinkling :sparkles: :thumbsup: :sparkles:
:warning: kimkwanka already gave noinkling points
Kim Kwanka
@kimkwanka
Oct 08 2015 09:00
At least I hope so....
Ankit Panwar
@coderNoob
Oct 08 2015 09:17
What does | do in JS?
Kim Kwanka
@kimkwanka
Oct 08 2015 09:17
|| is logical or
Malcolm
@noinkling
Oct 08 2015 09:18
@coderNoob single | is bitwise OR
It's more of an advanced topic
Steiakakis Stelios
@devience
Oct 08 2015 09:59

can someone help me on Waypoint: Nest an Anchor Element within a Paragraph? I type:

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

but I still get Your p element should have the text "View more " (with a space after it).
whathejoe
@whathejoe
Oct 08 2015 10:03
This message was deleted
vere perrot
@perrot
Oct 08 2015 10:03

Hi,
I get an error in the unit "Waypoint: Get Set for Basejumps" and "Check box 11.".
After I command "rm -rf * && echo "export NODE_PATH=$NODE_PATH:/home/ubuntu/.nvm/v0.10.35/lib/node_modules" >> ~/.bashrc && source ~/.bashrc && npm install -g yo grunt grunt-cli generator-angular-fullstack && yo angular-fullstack" in my cloud9 terminal, than get this error message:

# Project

? What would you like to write tests with? Mocha + Chai + Sinon
? What would you like to write Chai assertions with? Expect
You're using the fantastic NgComponent generator.

Initializing yo-rc.json configuration.


events.js:72
        throw er; // Unhandled 'error' event
              ^
TypeError: Object [object Object] has no method 'isAbsolute'
    at Generator.processDirectory (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/generator-angular-fullstack/util.js:110:19)
    at Generator.generateProject (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/generator-angular-fullstack/app/generator.js:399:14)
    at /home/ubuntu/.nvm/v0.10.35/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/lib/base.js:429:16
    at processImmediate [as _immediateCallback] (timers.js:354:15)

Have anyone can help me? Thanks.

CamperBot
@camperbot
Oct 08 2015 10:03
if you want to thank someone, put an @ before their name!
Vikram Rajput
@csbug
Oct 08 2015 10:06
thanks @camperbot :D
CamperBot
@camperbot
Oct 08 2015 10:06
csbug sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 311 | @camperbot | http://www.freecodecamp.com/camperbot
Mohith Kalyan
@thisismohith
Oct 08 2015 10:28
Anyone there ?
Blauelf
@Blauelf
Oct 08 2015 10:29
(tumbleweed) Just a few lurkers :D
Just ask and hope for an answer in time.
r007
@r007ed
Oct 08 2015 10:32
@devience , the only think i can think of is the waypoint did not request a class on the new paragraph element.
Blauelf
@Blauelf
Oct 08 2015 10:36
@devience If I copy your line into the code on my computer (using Chrome), it works. Maybe reload the page?
Or you might have accidentally damaged another line.
Steiakakis Stelios
@devience
Oct 08 2015 10:39
I had it on the bottom of the page, putting it on the beginning of the page let me through. I could see it was correct and it was driving me crazy! thanks @Blauelf
CamperBot
@camperbot
Oct 08 2015 10:39
devience sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 347 | @blauelf | http://www.freecodecamp.com/blauelf
Blauelf
@Blauelf
Oct 08 2015 10:41
@devience The test code probably expected your code where the link is placed in the default HTML.
JamesKee
@JamesKee
Oct 08 2015 11:04
bf drop
CamperBot
@camperbot
Oct 08 2015 11:04

:fire:Bonfire: Drop it :link:

function drop(arr, func) {
  // Drop them elements.
  return arr;
}

drop([1, 2, 3], function(n) {return n < 3; });

Drop the elements of an array (first argument), starting from the front, until the predicate (second argument) returns true.

more info:  bf details | bf links | hint

JamesKee
@JamesKee
Oct 08 2015 11:04
bf details
CamperBot
@camperbot
Oct 08 2015 11:04

:fire:Bonfire: Drop it :link:

function drop(arr, func) {
  // Drop them elements.
  return arr;
}

drop([1, 2, 3], function(n) {return n < 3; });
Drop the elements of an array (first argument), starting from the front, until the predicate (second argument) returns true.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
JamesKee
@JamesKee
Oct 08 2015 11:05
shouldn't the check drop([1, 2, 3, 7, 4], function(n) {return n>= 3}) return [2,3,7,4]?
or am I not understanding something?
it expects only [7,4], although 3 passes the function's test
Aleksandar B.
@aleksandar-b
Oct 08 2015 11:07
Why I keep geting html string in a console instead of an object? I typeconsole.log(this.children[0]); but all I get in console is this:
<audio src="https://s3.amazonaws.com/freecodecamp/simonSound1.mp3"></audio>
Blauelf
@Blauelf
Oct 08 2015 11:10
This is the object's string representation, I think.
D/S
@dantesolis
Oct 08 2015 11:15
hello world
CamperBot
@camperbot
Oct 08 2015 11:15

welcome to FreeCodeCamp @dantesolis!

Aleksandar B.
@aleksandar-b
Oct 08 2015 11:15
@Blauelf how to get pure object?
Blauelf
@Blauelf
Oct 08 2015 11:16
@samosale Are you sure this.children[0] is not an object? Did you try to output typeof this.children[0]?
D/S
@dantesolis
Oct 08 2015 11:17
I’ve been a long time lurker but decided to take the plunge and get more involved both in the challenges as well as in the chatroom. My javascript skills need a tune-up
Aleksandar B.
@aleksandar-b
Oct 08 2015 11:17
@Blauelf it's an object
Blauelf
@Blauelf
Oct 08 2015 11:18
You see? console.log does that conversion to give you a better human-readable output.
Aleksandar B.
@aleksandar-b
Oct 08 2015 11:18
@Blauelf typeof of that element is object
@Blauelf I need to see in object all the events and style property
Blauelf
@Blauelf
Oct 08 2015 11:20
Like in the property inspector in your browser? Not the job console.log can do on its own.
Aleksandar B.
@aleksandar-b
Oct 08 2015 11:23
@Blauelf how to do that?
Blauelf
@Blauelf
Oct 08 2015 11:26
What do you exactly want to do? Log Object.keys(this.children[0])? What is it you want to output?
Aleksandar B.
@aleksandar-b
Oct 08 2015 11:31
@Blauelf it'an empty array. I wanted to change the background on mousedown and revert the background on onmouseup . Now I see that I can do that in css with :active. I wanted to do that in Js without jQuery.
Blauelf
@Blauelf
Oct 08 2015 11:32
So why would you need to check the handlers then? Attach those two.
Aleksandar B.
@aleksandar-b
Oct 08 2015 12:03
@Blauelf yeah, but how I would do that without a click? When comp in Simon game plays it needs to change a backgroud for split second.
Blauelf
@Blauelf
Oct 08 2015 12:03
onmouseover and onmouseleave I think?
Ah, you want to change it on timer.
Aleksandar B.
@aleksandar-b
Oct 08 2015 12:04
@Blauelf where are your projects?
@Blauelf so, on setInterval I change the background for a split second and also play sound?
Blauelf
@Blauelf
Oct 08 2015 12:06
Then setTimeout is probably the way to go.
@samosale Not so many projects, as I don't like frontent development. I'm more into programming than into guess-what-which-browser-does.
Abdul Rafay Khan
@khanrafay
Oct 08 2015 12:15
Can anyone help me with (Use the jQuery addClass() function to give the classes animated and bounce to your button elements.)
Blauelf
@Blauelf
Oct 08 2015 12:18
@khanrafay That's a meta-question. Ask the real one and we'll see.
Abdul Rafay Khan
@khanrafay
Oct 08 2015 12:20
@Blauelf I am not asking about how to solve it, what i am saying that i already did add the code inside my readyfunction!
Patrick Hamil
@hamirick
Oct 08 2015 12:21
@khanrafay Then what are you asking?
Blauelf
@Blauelf
Oct 08 2015 12:21
We all wait for the question.
Abdul Rafay Khan
@khanrafay
Oct 08 2015 12:21
http://freecodecamp.com/challenges/waypoint-target-html-elements-with-selectors-using-jquery#?solution=%0Afccss%0A%20%20%24(document).ready(function()%20%7B%0A%20%20%20%0A%24(%22button%22).addClass(%22Animated%20bounce%22)%0A%20%20%7D)%3B%0Afcces%0AaddClass()%3B%0A%0A%3C!--%20You%20shouldn't%20need%20to%20modify%20code%20below%20this%20line%20--%3E%0A%0A%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%3Ch3%20class%3D%22text-primary%20text-center%22%3EjQuery%20Playground%3C%2Fh3%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23left-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22left-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target1%22%3E%23target1%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target2%22%3E%23target2%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target3%22%3E%23target3%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23right-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22right-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target4%22%3E%23target4%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target5%22%3E%23target5%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target6%22%3E%23target6%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A
Elizabeth Hatleli
@TheHighPriestess
Oct 08 2015 12:22
Are "fiddles" on jsfiddle private or not? I'm not sure. I think they are private....but want to make sure. Anyone know?
Patrick Hamil
@hamirick
Oct 08 2015 12:22
@khanrafay You have to have one addClass for each class.
Blauelf
@Blauelf
Oct 08 2015 12:22
@khanrafay Check the casing of "animated"
Patrick Hamil
@hamirick
Oct 08 2015 12:23
@khanrafay yes... check casing
Elizabeth Hatleli
@TheHighPriestess
Oct 08 2015 12:26
I guess the only way to keep "fiddles" private is not to name them?
Abdul Rafay Khan
@khanrafay
Oct 08 2015 12:26
Never knew they can be case sensitive....
@hamirick @Blauelf done..
Bob Moree
@bmoree
Oct 08 2015 12:36
Hi! Why does my function stop after two loops (instead of four)?
function largestOfFour(arr) {
  /* New Approach */
  // for array, shift sub and eval
  // for each sub, store maxNum in var
  // push maxnum to newArr
  var newArr = [];  
  for(var i = 0; i < arr.length; i++) {
    var sub = arr.shift();
    var maxNum = Math.max.apply(Math, sub);
    newArr.push(maxNum);
  }

  return newArr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
this returns :
[5, 27]
minakasiin
@minakasiin
Oct 08 2015 12:39
console log shows i=2
Bob Moree
@bmoree
Oct 08 2015 12:39
yeah, but why, the array length is 3 right?
Jason Wood
@catapixel
Oct 08 2015 12:41
@bmoree it's because each time you run arr.shift() you are changing the length of your array while your counter still goes up each loop. You are hitting the new end before you expect
Bob Moree
@bmoree
Oct 08 2015 12:43
thanks @catapixel , i get it, so I should store the arr.length in a variable before the for loop (if I were dealing with arrays of an unknown length)?
CamperBot
@camperbot
Oct 08 2015 12:43
bmoree sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 430 | @catapixel | http://www.freecodecamp.com/catapixel
Jason Wood
@catapixel
Oct 08 2015 12:46
@bmoree there are lots of ways to approach this but storing arr.length in a variable before the loop won't fix your problem. What will happen is that you will eventually try to iterate over a part of the loop/index that no longer exists because the array is now shorter. I would recommend trying to solve it without using the shift method. Your arr.length will then stay stable. Can you you think of another way to assign the subArray you want to sub without using shift?
@bmoree as a help, nested for loops would be one way to solve this issue...
Bob Moree
@bmoree
Oct 08 2015 12:49
what i did was store array.Length as a variable and then in the for statement the second part said stop when i < var arrlength, did the trick according to the waypoint thingy
Aleksandar B.
@aleksandar-b
Oct 08 2015 12:50
@Blauelf tnx for the help
CamperBot
@camperbot
Oct 08 2015 12:50
samosale sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 349 | @blauelf | http://www.freecodecamp.com/blauelf
Jason Wood
@catapixel
Oct 08 2015 12:50
@bmoree glad it worked for you with the adjustments
Bob Moree
@bmoree
Oct 08 2015 12:51
@catapixel I'm a bit bummed out because it feels like I cheated my way through. would you mind telling me if this was a correct solution:
```
```
function largestOfFour(arr) {
  /* New Approach */
  // for array, shift sub and eval
  // for each sub, store maxNum in var
  // push maxnum to newArr
  var newArr = []; 
  var arrLength = arr.length;
  for(var i = 0; i < arrLength; i++) {
    var sub = arr.shift();
    var maxNum = Math.max.apply(Math, sub);
    newArr.push(maxNum);
  }

  return newArr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Nathan
@Nathandim
Oct 08 2015 12:55
@bmoree There are many ways to solve a problem
EngineeredEdge
@EngineeredEdge
Oct 08 2015 12:55
@bmoree it looks like it works
you can go test it at www.repl.it
if for some reason FCC isn't working
Nathan
@Nathandim
Oct 08 2015 12:56
@bmoree Off the top of my head, you could sort each array then pick the last number
EngineeredEdge
@EngineeredEdge
Oct 08 2015 12:57
@Nathandim that will work. but sorting takes O(n*log(n)). finding the max should only take O(n)
[meaning, one sweep through the data]
Nathan
@Nathandim
Oct 08 2015 12:57
someone who's learning first builds a functional solution THEN optimizes
EngineeredEdge
@EngineeredEdge
Oct 08 2015 12:58
truth.
Nathan
@Nathandim
Oct 08 2015 12:58
same thing that you'll do in an interview
EngineeredEdge
@EngineeredEdge
Oct 08 2015 12:58
@bmoree can you write a function that returns the max of a single array of numbers like [3, 5 6 1]
Bob Moree
@bmoree
Oct 08 2015 13:00
@Nathandim @catapixel looks like I picked the better solution by accident :-)
@EngineeredEdge doesn't mine do that??
Nathan
@Nathandim
Oct 08 2015 13:01
@bmoree My solution is like yours more or less
EngineeredEdge
@EngineeredEdge
Oct 08 2015 13:01
:) you're using the built in Math module.
can you write your own function that finds the max of an array
Bob Moree
@bmoree
Oct 08 2015 13:01
@EngineeredEdge oh like that, nope :worried:
EngineeredEdge
@EngineeredEdge
Oct 08 2015 13:02
!? i bet you can
Bob Moree
@bmoree
Oct 08 2015 13:02
i guess sort and pick last would do that ty @Nathandim
Nathan
@Nathandim
Oct 08 2015 13:02
not gonna spoil it for him
but you don't have to sort anything
Bob Moree
@bmoree
Oct 08 2015 13:03
but take each one and compare to stored var maxNum, if arr[i] is bigger { maxNum = ...} something like that.. ?
EngineeredEdge
@EngineeredEdge
Oct 08 2015 13:03
!! yes
Bob Moree
@bmoree
Oct 08 2015 13:04
Thanks @Nathandim @EngineeredEdge
CamperBot
@camperbot
Oct 08 2015 13:04
bmoree sends brownie points to @nathandim and @engineerededge :sparkles: :thumbsup: :sparkles:
:star: 360 | @engineerededge | http://www.freecodecamp.com/engineerededge
:star: 189 | @nathandim | http://www.freecodecamp.com/nathandim
Tom Lorimer
@Ellf
Oct 08 2015 13:05
help Bonfire: Mutations
CamperBot
@camperbot
Oct 08 2015 13:05

:point_right: bonfire mutations [wiki]

Problem Explanation:

  • 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..
:pencil: read more about bonfire mutations on the FCC Wiki
Blauelf
@Blauelf
Oct 08 2015 13:05
In a scenario where you build your own "max" implementation, care has to be taken not to use a default value for a "maxNum" that limits the output in any way, as it should only depend on the input.
EngineeredEdge
@EngineeredEdge
Oct 08 2015 13:06
@bmoree did you build it?
@Ellf what kind of help do you need with mutations?
Abdul Rafay Khan
@khanrafay
Oct 08 2015 13:08
isn't this appropriate?
(<script>
$(document).ready(function() {
$("button").addClass()
$(".btn").addClass()
$("#target1").addClass("animated.shake and btn-primary")
});
</script>)
@Blauelf ?
Blauelf
@Blauelf
Oct 08 2015 13:09
help format
CamperBot
@camperbot
Oct 08 2015 13:09

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Abdul Rafay Khan
@khanrafay
Oct 08 2015 13:10

'''

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

CamperBot
@camperbot
Oct 08 2015 13:10
:bulb: to format code use backticks! ``` more info
fajkovicsasa
@fajkovicsasa
Oct 08 2015 13:11
Hi guys, I'm trying to figure out how to see the JS tests that are being run to check my code. They should be on the left side but I can't see them. Browser is Firefox. Any idea why?
Blauelf
@Blauelf
Oct 08 2015 13:11
@khanrafay You are adding no classes to button-type elements, none to elements of class btn, and the three classes "animated.shake", "and", and "btn-primary" to element with id target1. And you are lacking ;.
Abdul Rafay Khan
@khanrafay
Oct 08 2015 13:14

'''

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

});
</script>
'''
Now what i am missing?

CamperBot
@camperbot
Oct 08 2015 13:14
:bulb: to format code use backticks! ``` more info
Blauelf
@Blauelf
Oct 08 2015 13:16
@khanrafay Follow that damn link @camperbot provides.
And jQuery's addClass() allows adding multiple classes by separating them with spaces. "and" should not be in your list, that's part of the text.
Gourav K Parmar
@gouravparmar729
Oct 08 2015 13:29

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

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

};

I have omitted "this", but still there is no execution can someone help?
Peter Daily
@thepeted
Oct 08 2015 13:33
@gouravparmar729 you should be declaring your variables with var (unless you have further up the code)
also, the last }; isn't needed
try this:
var speed = 100;
function addUnit(value) {
return value + "KM/H";
}
function getSpeed() {
return addUnit(speed);
};

getSpeed();
Blauelf
@Blauelf
Oct 08 2015 13:43
The last }; is needed, as @gouravparmar729 did not post the first line which I think runs var Car = function() { or equivalent.
rickgordon86
@rickgordon86
Oct 08 2015 13:43
hi guys can i get a liitle help with Waypoint: Condense arrays with reduce

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

  return array+singleVal;

});
Gourav K Parmar
@gouravparmar729
Oct 08 2015 13:44
thanks for the help @thepeted @Blauelf
CamperBot
@camperbot
Oct 08 2015 13:44
gouravparmar729 sends brownie points to @thepeted and @blauelf :sparkles: :thumbsup: :sparkles:
:star: 316 | @thepeted | http://www.freecodecamp.com/thepeted
:star: 350 | @blauelf | http://www.freecodecamp.com/blauelf
Davoud Nasiri Mobarakeh
@Davoud
Oct 08 2015 13:45
@rickgordon86 var singleVal = array.reduce(...
@rickgordon86 var result = array.recude(function(a,b) { return a+b; });
array.reduce(...
rickgordon86
@rickgordon86
Oct 08 2015 13:47
@Davoud thanks
CamperBot
@camperbot
Oct 08 2015 13:47
rickgordon86 sends brownie points to @davoud :sparkles: :thumbsup: :sparkles:
:star: 252 | @davoud | http://www.freecodecamp.com/davoud
Yaneth Ramirez
@yanethi
Oct 08 2015 13:49
Hi @thepeted
Davoud Nasiri Mobarakeh
@Davoud
Oct 08 2015 13:50
@rickgordon86 :smile:
Justin
@Justintlai
Oct 08 2015 13:50
So I've managed to create an infinite loop and I can't get out of it. My browser locks up and everytime I reset my browser on go into the Bonfire...
Is there a "break" key that will stop the loop? :(
Ben Carson
@ben-carson
Oct 08 2015 13:51
Which browser are you using?
You could set a breakpoint using the browsers built-in development tools, if you can get there before your browser locks up.
Herman Fassett
@HermanFassett
Oct 08 2015 13:52
@Justintlai clear your cache
Davoud Nasiri Mobarakeh
@Davoud
Oct 08 2015 13:53
@Justintlai after closing the firefox, end all of its processes from the task manager
Justin
@Justintlai
Oct 08 2015 13:53
I'm in chrome
Blauelf
@Blauelf
Oct 08 2015 13:53
@Justintlai Most browsers let you stop scripts that appear going infinite after some waiting. Your code is stored inside your browser, there's one entry for each waypoint/bonfire in the "local storage".
If you can open www.freecodecamp.com, press F12, navigate to "resources".
Then "Local Storage", click on the site, get your saved code listed.
Miłosz Zalewski
@Tolinieg
Oct 08 2015 13:55
Hi
Blauelf
@Blauelf
Oct 08 2015 13:55
Lo
Justin
@Justintlai
Oct 08 2015 13:55
@HermanFassett Thanks clearing the cache worked but back at square one :P
CamperBot
@camperbot
Oct 08 2015 13:55
justintlai sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 335 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Miłosz Zalewski
@Tolinieg
Oct 08 2015 13:55
I'm trying to factorialize a number. Do you know how to do it?
Blauelf
@Blauelf
Oct 08 2015 13:55
Sure. Many ways to do that.
Justin
@Justintlai
Oct 08 2015 13:55
This message was deleted
Miłosz Zalewski
@Tolinieg
Oct 08 2015 13:56
So how would you do it?
I feel a bit lost
Blauelf
@Blauelf
Oct 08 2015 13:56
You could say n! is 1 times 2 times 3 times... times n (for-loop), but you can also say 0! is 1 and any other n!=n times (n-1)! (recursion)
Miłosz Zalewski
@Tolinieg
Oct 08 2015 13:57
I know what it is
I don't know how to write it in a code
Blauelf
@Blauelf
Oct 08 2015 13:58
You could have a variable initialized to 1, and multiply it by the numbers of 1 (or 2) to n in a for-loop. Or you could use recursion.
Miłosz Zalewski
@Tolinieg
Oct 08 2015 13:59
ok
thanks Blauelf
CamperBot
@camperbot
Oct 08 2015 13:59
if you want to thank someone, put an @ before their name!
Miłosz Zalewski
@Tolinieg
Oct 08 2015 13:59
...
Blauelf
@Blauelf
Oct 08 2015 13:59
For bonus points, try solving it both ways ;)
Miłosz Zalewski
@Tolinieg
Oct 08 2015 13:59
thanks @Blauelf
CamperBot
@camperbot
Oct 08 2015 13:59
tolinieg sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 351 | @blauelf | http://www.freecodecamp.com/blauelf
Miłosz Zalewski
@Tolinieg
Oct 08 2015 14:00
ok
Blauelf
@Blauelf
Oct 08 2015 14:00
(virtual bonus points, though)
Bob Moree
@bmoree
Oct 08 2015 14:01
Hi all,
Is what I did below with loopCount considered best practice? If not, why?
function chunk(arr, size) {
  // var new array
  // var spliced = splice of first n (size)
  // push spliced to new array
  var newArr = [];
  var loopCount = Math.ceil(arr.length/size);
  for(var i =0; i < loopCount; i++) {
    var newSub = arr.splice(0,size);
    newArr.push(newSub);
  }
  return newArr
}

chunk([0, 1, 2, 3, 4, 5], 4);
Blauelf
@Blauelf
Oct 08 2015 14:03
@bmoree No idea how "best practice" that is, you could also use a while loop to check arr.length. So while(arr.length){ //do splice+push
Seems more robust to me, but the other one should work as well.
Bob Moree
@bmoree
Oct 08 2015 14:04
@Blauelf so it returns false as long is the array has members, right?
Blauelf
@Blauelf
Oct 08 2015 14:05
Any number other than 0 is coerced to true.
Bob Moree
@bmoree
Oct 08 2015 14:06
thought so, thanks @Blauelf
CamperBot
@camperbot
Oct 08 2015 14:06
bmoree sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 352 | @blauelf | http://www.freecodecamp.com/blauelf
Bob Moree
@bmoree
Oct 08 2015 14:06
any way to 'splice' and leave the original array intact?
Blauelf
@Blauelf
Oct 08 2015 14:07

Make a copy first.

var arrCopy=arr.slice();

Or don't splice but slice(i*size,(i+1)*size)

Bob Moree
@bmoree
Oct 08 2015 14:09
i see thanks again
CamperBot
@camperbot
Oct 08 2015 14:09
if you want to thank someone, put an @ before their name!
Bob Moree
@bmoree
Oct 08 2015 14:09
thanks @camperbot
CamperBot
@camperbot
Oct 08 2015 14:09
bmoree sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 313 | @camperbot | http://www.freecodecamp.com/camperbot
Blauelf
@Blauelf
Oct 08 2015 14:09
Should work even without calculating loopCount (redefined the i to go in steps of size):
function chunk(arr, size) {
  // var new array
  // var spliced = splice of first n (size)
  // push spliced to new array
  var newArr = [];
  for(var i =0; i < arr.length; i+=size) {
    var newSub = arr.slice(i,i+size);
    newArr.push(newSub);
  }
  return newArr
}

chunk([0, 1, 2, 3, 4, 5], 4);
raghunathperam
@raghunathperam
Oct 08 2015 14:13
hey guys im new to this site and when I'm trying to run the code it is not debugging is there anything else to be added to debug
Blauelf
@Blauelf
Oct 08 2015 14:14
You can use console.log() to print to your browser's console (usually found by pressing F12)
raghunathperam
@raghunathperam
Oct 08 2015 14:16
ya I tried but still it is not debugging
Blauelf
@Blauelf
Oct 08 2015 14:16
What do you mean with "debugging"?
raghunathperam
@raghunathperam
Oct 08 2015 14:16
output
to see output
Blauelf
@Blauelf
Oct 08 2015 14:17
Which waypoint/bonfire are you on, what is your code, what do you expect, and what happens?
Then, for the browser console, which browser are you using?
raghunathperam
@raghunathperam
Oct 08 2015 14:19
IE8
Blauelf
@Blauelf
Oct 08 2015 14:19
Ouch. That one hasn't seen updates in a while.
Aayush Kapoor
@xeoneux
Oct 08 2015 14:20
@raghunathperam Which version of Windows?
raghunathperam
@raghunathperam
Oct 08 2015 14:20
7
raghunathperam
@raghunathperam
Oct 08 2015 14:23

var string = "Split me into an array";
// Only change code below this line.

var array = string.split(' ');

// Only change code above this line.
(function() {return array;})();

this is what I have done after clicking on run tests nothing I can see on console
Revathy
@revathynair
Oct 08 2015 14:24
Hello
I am unable to clear the waypoint no 124
Chris
@Shifthawke
Oct 08 2015 14:25
Which waypoint is that and why?
@revathynair
Revathy
@revathynair
Oct 08 2015 14:25
waypoint-remove-classes-from-an-element-with-jquery @Shifthawke
Chris
@Shifthawke
Oct 08 2015 14:26
So why are unable to clear it? Can't work through or is it a technical problem?
Revathy
@revathynair
Oct 08 2015 14:26

<script>
$(document).ready(function() {
$("button").addClass("animated bounce");
$(".well").addClass("animated shake");
$("#target3").addClass("animated fadeOut");
$("#target2").removeClass("btn-default");
});
</script>

<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<h4>#left-well</h4>
<div class="well" id="left-well">
<button class="btn target" id="target1">#target1</button>
<button class="btn target" id="target2">#target2</button>
<button class="btn target" id="target3">#target3</button>
</div>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn target" id="target4">#target4</button>
<button class="btn target" id="target5">#target5</button>
<button class="btn target" id="target6">#target6</button>

did as I was asked to
cant figure out the error
Chris
@Shifthawke
Oct 08 2015 14:27
Ok give me a sec to review the WP
Blauelf
@Blauelf
Oct 08 2015 14:27
@raghunathperam Do you see the different checks under the run button?
help format
Bob Moree
@bmoree
Oct 08 2015 14:27
@Blauelf that seems to work, but leaves the array intact, is that bad for performance? or is the fact of having a variable in memory just as bad as keeping the entire array?
Hope this isn't too vague ;-)
CamperBot
@camperbot
Oct 08 2015 14:27

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Chris
@Shifthawke
Oct 08 2015 14:29
@revathynair It looks like you just didn't select all of them.
Each one is it's own target
Blauelf
@Blauelf
Oct 08 2015 14:29
@bmoree I would assume splice to be an expensive operation, but have not done any testing. Maybe I should. What's the name of that site for JS performance tests? :D
Brian Herron
@bherron87
Oct 08 2015 14:29
Hello, would someone be able to help me with why my javascript variables won't work. Here is the code:
var myName = "Brian Herron";
var myFirstName = "Brian";
var myLastName = "Herron";
Chris
@Shifthawke
Oct 08 2015 14:29
$(#target1).removeClass, $(#target2).removeClass, etc
What wp is this? @bherron87
Revathy
@revathynair
Oct 08 2015 14:30
Ok!
thanks
CamperBot
@camperbot
Oct 08 2015 14:30
if you want to thank someone, put an @ before their name!
Blauelf
@Blauelf
Oct 08 2015 14:30
@bherron87 That code should work, but I have no idea what it should do. So what's your problem?
Brian Herron
@bherron87
Oct 08 2015 14:30
It won't let me pass the lesson in javascript Waypoint: Declare String Variables
Revathy
@revathynair
Oct 08 2015 14:31
ok @camperbot
thanks @Shifthawke
CamperBot
@camperbot
Oct 08 2015 14:31
revathynair sends brownie points to @shifthawke :sparkles: :thumbsup: :sparkles:
:star: 396 | @shifthawke | http://www.freecodecamp.com/shifthawke
Chris
@Shifthawke
Oct 08 2015 14:31
Link the way point and post your actual code. @bherron87
Np sweety. @revathynair
Bob Moree
@bmoree
Oct 08 2015 14:32
@Blauelf no idea...

// var name = "Alan Turing";
// var firstName = "Alan";
// var lastName = "Turing";
var myName = "Brian Herron";
var myFirstName = "Brian";
var myLastName = "Herron";

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
if(typeof(myFirstName) !== "undefined" && typeof(myLastName) !== "undefined"){(function(){return myFirstName + ', ' + myLastName;})();}

Blauelf
@Blauelf
Oct 08 2015 14:34
@bherron87 :point_up: 8. Oktober 2015 16:27
And your code works on my Chrome browser.
Chris
@Shifthawke
Oct 08 2015 14:35
Do you have another browser? @bherron87
James Smith
@matthew02
Oct 08 2015 14:35
@bherron87 Or just try refreshing the page.
Brian Herron
@bherron87
Oct 08 2015 14:36
I'm using IE, unfortunately they make us use it at work. :(
Chris
@Shifthawke
Oct 08 2015 14:36
That too. Just copy your code first so you don't have to rewrite it.
ew....
-Waits for the random IE lover hate-
Blauelf
@Blauelf
Oct 08 2015 14:37
I cannot get FCC to run on IE11. For security reasons, it won't. I would have to shut that security off, but that's not a nice thought.
Chris
@Shifthawke
Oct 08 2015 14:38
That's weird...
Blauelf
@Blauelf
Oct 08 2015 14:38
FCC is not showing any checks under the "Run" button.
Brian Herron
@bherron87
Oct 08 2015 14:39
@Shifthawke Yea I'll just have to wait until I get home so I can use Chrome to pass the lesson. Thanks for your help though :)
CamperBot
@camperbot
Oct 08 2015 14:39
bherron87 sends brownie points to @shifthawke :sparkles: :thumbsup: :sparkles:
:star: 397 | @shifthawke | http://www.freecodecamp.com/shifthawke
Chris
@Shifthawke
Oct 08 2015 14:39
Np. There were actually some waypoints yesterday that wouldn't run on anything but edge.
Brian Herron
@bherron87
Oct 08 2015 14:39
@Blauelf you too!
Fanyusong
@Fanyusong
Oct 08 2015 14:39
Help me !! Plzz
CamperBot
@camperbot
Oct 08 2015 14:39
no wiki entry for: me plzz
:pencil: click here to create one now!after creating your page type update to reload it here
Fanyusong
@Fanyusong
Oct 08 2015 14:39
http://freecodecamp.com/challenges/waypoint-target-the-same-element-with-multiple-jquery-selectors#?solution=fccss%0A%20%20%24(document).ready(function()%20%7B%0A%20%20%20%20%24(%22.btn%22).addClass()%3B%0A%20%20%20%20%24(%22button%22).addClass()%3B%0A%20%20%20%20%24(%22%23target1%22).addClass(animated)%3B%0A%20%20%7D)%3B%0Afcces%0A%0A%3C!--%20You%20shouldn't%20need%20to%20modify%20code%20below%20this%20line%20--%3E%0A%0A%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%3Ch3%20class%3D%22text-primary%20text-center%22%3EjQuery%20Playground%3C%2Fh3%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23left-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22left-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target1%22%3E%23target1%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target2%22%3E%23target2%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target3%22%3E%23target3%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23right-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22right-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target4%22%3E%23target4%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target5%22%3E%23target5%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target6%22%3E%23target6%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A
Chris
@Shifthawke
Oct 08 2015 14:39
What's up doll? @Fanyusong
whoa
Blauelf
@Blauelf
Oct 08 2015 14:40
@bherron87 Haven't used IE for maybe 10 years, maybe I am doing it wrong.
Chris
@Shifthawke
Oct 08 2015 14:41
LOL I avoid it like the plague.
The bubonic plague.
James Smith
@matthew02
Oct 08 2015 14:41
Crazy Linux user here. :stuck_out_tongue: :neckbeard: Haven't used IE in years (fortunately). Can't help much with it (unfortunately).
Chris
@Shifthawke
Oct 08 2015 14:42
I want to make the jump to linux, but I'm at a loss on how to really do it.
Blauelf
@Blauelf
Oct 08 2015 14:42
@Fanyusong Try to understand addClass, it wants a string literal, containing classes separated by space. You could also give each of your addClass() one class, as the target element is selected by all those identifiers.
Ben Carson
@ben-carson
Oct 08 2015 14:43
@Fanyusong You have the right idea, just use quotation marks around the class name in your .addClass method.
Blauelf
@Blauelf
Oct 08 2015 14:43
@Shifthawke I have too much legacy software depending on windows (mainly games :P)
Ben Carson
@ben-carson
Oct 08 2015 14:44
@Fanyusong otherwise jQuery thinks you are referencing a variable name.
Chris
@Shifthawke
Oct 08 2015 14:44
@Blauelf I put in the correct code but it's giving me an error. I tried it on edge but apparent edge hates me today.
James Smith
@matthew02
Oct 08 2015 14:45
@Shifthawke I just jumped in with both feet into Ubuntu about 8 years ago. I switched to Arch about a month in and I have never looked back. I still have to use some Windows software every day, but I just run it in VMware.
Chris
@Shifthawke
Oct 08 2015 14:45
@Blauelf I have too many games and random scheiße
Well it's really making the switch over that has me lost. @matthew02
Blauelf
@Blauelf
Oct 08 2015 14:45
"random scheiße". Interesting wording.
Chris
@Shifthawke
Oct 08 2015 14:46
Lol. -nods- I can't share it here lol
James Smith
@matthew02
Oct 08 2015 14:46
I'm a console gamer, so the games aren't as big of a deal to me. The only games I want to play on PC are available on Linux through Steam.
Chris
@Shifthawke
Oct 08 2015 14:47
I'm more of a console player. But games I want to mod are on PC. Like skyrim.
Arkham knight.
Blauelf
@Blauelf
Oct 08 2015 14:48
Consoles were never my way, such unitaskers. My favourite games were MS-DOS6.22's QBASIC and Borland Turbo Pascal 6.5 :D
Chris
@Shifthawke
Oct 08 2015 14:48
Mine have to be batmany, dragony, and adverturey
James Smith
@matthew02
Oct 08 2015 14:48
@Blauelf Yep. Those were the days.
Chris
@Shifthawke
Oct 08 2015 14:49
I thought you were gamer when I seen you weeks ago. @Blauelf
James Smith
@matthew02
Oct 08 2015 14:49
I've never been much of a modder.
Fanyusong
@Fanyusong
Oct 08 2015 14:49
@Blauelf Thanks !!!!
CamperBot
@camperbot
Oct 08 2015 14:49
fanyusong sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 353 | @blauelf | http://www.freecodecamp.com/blauelf
Chris
@Shifthawke
Oct 08 2015 14:50
I dwindled my mods for skyrim down to fifty. Took me some three months.
five months to get everything to agree.
James Smith
@matthew02
Oct 08 2015 14:51
@Shifthawke If you really want to try Linux, you can make a bootable USB and give it a shot without installing it. Ubuntu Bootable USB
@Shifthawke If you end up liking it, you can install it from that medium.
Chris
@Shifthawke
Oct 08 2015 14:54
Thank you. I have a 1tb external I was going to clone my drive with, but I might just do this instead. Thank you for the link. <3
CamperBot
@camperbot
Oct 08 2015 14:54
if you want to thank someone, put an @ before their name!
James Smith
@matthew02
Oct 08 2015 14:56
@Shifthawke Sure thing! Hope you like it!
Peter Deal
@DealPete
Oct 08 2015 14:57
@Shifthawke another way to try linux is through a program called WUBI. It installs Linux inside windows, allowing you to dual boot into either one. No need for HD partitioning. If you don't like it, you can just delete it from within Windows
Chris
@Shifthawke
Oct 08 2015 14:58
How does that work? @DealPete
Blauelf
@Blauelf
Oct 08 2015 14:59
Maybe it uses a file that contains a file system? Or some layer that emulates the linux file-system's special abilities?
D3v1n
@D3v1n
Oct 08 2015 15:01
thanks @ltegman I'll give it a shot
CamperBot
@camperbot
Oct 08 2015 15:01
d3v1n sends brownie points to @ltegman :sparkles: :thumbsup: :sparkles:
:star: 236 | @ltegman | http://www.freecodecamp.com/ltegman
Blauelf
@Blauelf
Oct 08 2015 15:01
Even in the 90s I could install S.u.S.E. Linux in a file, though that could only be 2GB of size (not that my hard drive would be that big at the time)
Peter Deal
@DealPete
Oct 08 2015 15:01
@Blauelf the former, it creates a file in windows containing the Ubuntu file system. then adds an option to the windows boot menu to boot this file
Pratik Ratnaparkhi
@pratikr1593
Oct 08 2015 15:07
Bonfire: Factorialize a Number, can anyone help mw with this one? I would want to see the solution cause I have messed up my code
CamperBot
@camperbot
Oct 08 2015 15:07
Sorry, can't find a bonfire called factorialize a number can anyone help mw with this one i would want to see the solution cause i have messed up my code. [ Check the map? ]
Chris
@Shifthawke
Oct 08 2015 15:07
Where would I find this? Will all my files be there already? @DealPete
@pratikr1593 How long have you worked on it?
Jonathan
@jonjitsu
Oct 08 2015 15:07
I find the best way of trying out other OSes is through a vm like https://www.virtualbox.org/
Pratik Ratnaparkhi
@pratikr1593
Oct 08 2015 15:08
@Shifthawke past one and half hour.
Chris
@Shifthawke
Oct 08 2015 15:08
Where have you looked for resources?
Pratik Ratnaparkhi
@pratikr1593
Oct 08 2015 15:08
and i am stuck with finding the right if statement
Chris
@Shifthawke
Oct 08 2015 15:09
It is a very, very simple if statement.
simple as in small
I am loathe to give you the answer. What do you have so far?
Pratik Ratnaparkhi
@pratikr1593
Oct 08 2015 15:10
function factorialize(num) {

  int n;

  if (n<n!)
{



      }  



  return num;
}

factorialize(5, '');
@Shifthawke dont give me the answer
but guide me instead.
Tom Lorimer
@Ellf
Oct 08 2015 15:11
wiki Bonfire: Falsy
CamperBot
@camperbot
Oct 08 2015 15:11

:point_right: bonfire falsy bouncer [wiki]

Problem Explanation:

Remove all falsy values from an array.

:pencil: read more about bonfire falsy bouncer on the FCC Wiki

Chris
@Shifthawke
Oct 08 2015 15:12
The answer is no cbot
That is not the correct if statement.
Your return needs to contain factoralize though.
Pratik Ratnaparkhi
@pratikr1593
Oct 08 2015 15:14
@Shifthawke I am having a hard time here. can you explain me?
Chris
@Shifthawke
Oct 08 2015 15:15
Well you need to factoralize the number right? That needs to be in your return statement.
Look up how to factoralize a number instead. You might have more success. Check MDN
Rex Schrader
@SaintPeter
Oct 08 2015 15:16
@pratikr1593 There is no ! operator in Javascript. That's sort of the point of this exercise.
Chris
@Shifthawke
Oct 08 2015 15:17
Peter <3
Moisés Man
@moigithub
Oct 08 2015 15:18
! means NOT operator :p
Chris
@Shifthawke
Oct 08 2015 15:18
Peter explains things much better than me.
Moisés Man
@moigithub
Oct 08 2015 15:18
!true ---> not true
Pratik Ratnaparkhi
@pratikr1593
Oct 08 2015 15:19
@Shifthawke @SaintPeter Thanks, will look into MDN.
CamperBot
@camperbot
Oct 08 2015 15:19
pratikr1593 sends brownie points to @shifthawke and @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 398 | @shifthawke | http://www.freecodecamp.com/shifthawke
:star: 911 | @saintpeter | http://www.freecodecamp.com/saintpeter
Chris
@Shifthawke
Oct 08 2015 15:20
@moigithub FTW
Rex Schrader
@SaintPeter
Oct 08 2015 15:20
@pratikr1593 For slightly less confusion: I meant to say that there is no ! operator which means "Find the Factorial of" - @moigithub is absolutely right that ! as a prefix means "not".
Thanks @moigithub
CamperBot
@camperbot
Oct 08 2015 15:20
saintpeter sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 365 | @moigithub | http://www.freecodecamp.com/moigithub
Chris
@Shifthawke
Oct 08 2015 15:20
Saint Peter has too many brownies
Shifthawke @Shifthawke has not enough brownies
Rex Schrader
@SaintPeter
Oct 08 2015 15:21
@Shifthawke Right now I have 911, which means it must be an emergency.
Chris
@Shifthawke
Oct 08 2015 15:21
LOL
supasheva
@supasheva
Oct 08 2015 15:21
hello guys
Rex Schrader
@SaintPeter
Oct 08 2015 15:21
Hey hey
Chris
@Shifthawke
Oct 08 2015 15:21
Emergency Peter. I will now call you for 911 emergencies
supasheva
@supasheva
Oct 08 2015 15:21
so I am doing the waypoint Waypoint: Manage Packages with NPM
And i have an issue
Chris
@Shifthawke
Oct 08 2015 15:21
Hey Supa
supasheva
@supasheva
Oct 08 2015 15:21
i am getting an error when doing npm-publish again
    throw err;
Error: Cannot find module '/home/ubuntu/.config/how-to-npm/registry/new_dir/body.json'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.exports.verify (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/problems/10-publish-again.js:33:14)
    at Shop.verify (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/node_modules/adventure/index.js:157:15)
    at Shop.execute (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/node_modules/adventure/index.js:76:14)
    at Shop.shop.execute (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/index.js:37:45)
    at Object.<anonymous> (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/index.js:86:8)
    at Module._compile (module.js:456:26)
Rex Schrader
@SaintPeter
Oct 08 2015 15:22
I think everyone is. You can skip that step. I think there is a "skip" command for "learnyounpm".
supasheva
@supasheva
Oct 08 2015 15:23
module.js:340
    throw err;
Error: Cannot find module '/home/ubuntu/.config/how-to-npm/registry/new_dir/body.json'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.exports.verify (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/problems/10-publish-again.js:33:14)
    at Shop.verify (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/node_modules/adventure/index.js:157:15)
    at Shop.execute (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/node_modules/adventure/index.js:76:14)
    at Shop.shop.execute (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/index.js:37:45)
    at Object.<anonymous> (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/index.js:86:8)
    at Module._compile (module.js:456:26)
```
really?
huh
Rex Schrader
@SaintPeter
Oct 08 2015 15:25
@supasheva Yeah - I think there is either a problem with the c9 environment or with the how-to-npm project. I spent some time looking at a long history of issues and saw lots of confusion and no answers.
supasheva
@supasheva
Oct 08 2015 15:26
Thanks @SaintPeter
CamperBot
@camperbot
Oct 08 2015 15:26
supasheva sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 912 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 08 2015 15:26
@supasheva how-to-npm verify skip
supasheva
@supasheva
Oct 08 2015 15:26
lol that also doesn't work for me
Rex Schrader
@SaintPeter
Oct 08 2015 15:26
D'oh
supasheva
@supasheva
Oct 08 2015 15:27
i saw that someone else tried that
and also had the same issue
haah
Rex Schrader
@SaintPeter
Oct 08 2015 15:27
I took it from their source code!
Oh, looks like it only works for the first problem
Chris
@Shifthawke
Oct 08 2015 15:28
Peter. I have a q. I'm on this bf. http://freecodecamp.com/challenges/bonfire-title-case-a-sentence In this case we need to remove all capital letters and set it to capitalize just the first letters right? There are two separate codes for that right?
Pekmen
@Pekmen
Oct 08 2015 15:28
ok I have a problem, how to make regex out of string that is not known yet. I want to make re = /somevariable/gi without regex searching for string "somevariable" but actual variable somevariable.
Rex Schrader
@SaintPeter
Oct 08 2015 15:29
@Shifthawke Yeah, you can lowercase the entire sentence before you start, then uppercase the first letter of each. NOTE: Because they are strings, you're going to have to build up your word - the first letter and then the rest of the word. Also: You don't have to use .charAt() for strings - you can just use str[x]
@Pekmen Use var re = new RegExp(yourVarHere, "gi")
Chris
@Shifthawke
Oct 08 2015 15:30
Okies, thank you ^_^
CamperBot
@camperbot
Oct 08 2015 15:30
if you want to thank someone, put an @ before their name!
Pekmen
@Pekmen
Oct 08 2015 15:30
nvm I found a way
Rex Schrader
@SaintPeter
Oct 08 2015 15:31
@Pekmen Using the RegExp object?
@Pekmen We're always glad to be your Rubber Duck
Pekmen
@Pekmen
Oct 08 2015 15:32
yup, I used the RegExp
Chris
@Shifthawke
Oct 08 2015 15:33
mmmm rubber duck.
SaintPeter @SaintPeter sings 'Rubber ducky, you're the one . . . you make my debugging so much fun. . .'
supasheva
@supasheva
Oct 08 2015 15:35
this is horrible
i can't even finish the challenges
hm
Rex Schrader
@SaintPeter
Oct 08 2015 15:36
@supasheva Share your c9 with me
supasheva
@supasheva
Oct 08 2015 15:36
how do i do that?
ok
what are your details
Rex Schrader
@SaintPeter
Oct 08 2015 15:36
@supasheva I think there is a share button under collaboration - I just PMed you my e-mail
Joseph Gilgen
@jb-1980
Oct 08 2015 15:36
Hello all, I am having an issue with the Where art thou bonfire. It passes all the tests, except the first of requiring it to return an array of objects. When I look at the return variable in the console log, it seems to be an array of objects, so I don't know. I am new to the chat, so I can send a screen shot or something if necessary.
supasheva
@supasheva
Oct 08 2015 15:36
alrighty
Chris
@Shifthawke
Oct 08 2015 15:39
@jb-1980 Use copy and just copy your code and paste it here with format
wiki format
CamperBot
@camperbot
Oct 08 2015 15:39

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Muhammed Gamal
@JimyAllam
Oct 08 2015 15:41

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

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

<img src="https://bit.ly/fcc-relaxing-cat">

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

what i should da
Chris
@Shifthawke
Oct 08 2015 15:41
I got this one yo
Muhammed Gamal
@JimyAllam
Oct 08 2015 15:42
help
CamperBot
@camperbot
Oct 08 2015 15:42

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

Basic Commands:

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

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

Chris
@Shifthawke
Oct 08 2015 15:42
Why do you have two styles? @JimyAllam
@JimyAllam Can you format your code.
Use the same copy
wiki format
CamperBot
@camperbot
Oct 08 2015 15:42

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Muhammed Gamal
@JimyAllam
Oct 08 2015 15:42
i must have one style??
Chris
@Shifthawke
Oct 08 2015 15:43
yes...
everything goes into one style
Mohith Kalyan
@thisismohith
Oct 08 2015 15:44
hey
Rohitnwn
@Rohitnwn
Oct 08 2015 15:44
find smallest common multiple
CamperBot
@camperbot
Oct 08 2015 15:44

find smallest common multiple

:zero: bonfire smallest common multiple

Mohith Kalyan
@thisismohith
Oct 08 2015 15:44
What is 100 hour non-profit Project ?
rickgordon86
@rickgordon86
Oct 08 2015 15:44
Hi guys can I get a little help with this one please Bonfire: Check for Palindromes

function palindrome(str) {

  str = str.replace(" ", "").toLowerCase();
  var reversed = str.split().reverse().join();
  if (str === reversed){
    return true;
  }else{
    return false;
  }

}



palindrome("eye");
its not returning false for the wrong ones
Coira Ellison
@Coira
Oct 08 2015 15:48
@rickgordon86 needs to be split("") and join("")
Rex Schrader
@SaintPeter
Oct 08 2015 15:49
@rickgordon86 You need to also remove punctuation. Also, if you call .join() with no params, it automatically uses , as a separator. I encourage you to go to http://repl.it and test your code there. You can put in alternate values and you can add console.log commands to see the values of your variables.
supasheva
@supasheva
Oct 08 2015 15:50
oh yeah thanks @SaintPeter again
CamperBot
@camperbot
Oct 08 2015 15:50
supasheva sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: supasheva already gave saintpeter points
Chris
@Shifthawke
Oct 08 2015 15:50
Palindrome is evil. Just saying
supasheva
@supasheva
Oct 08 2015 15:50
i dunno what brownie points are but yea
Chris
@Shifthawke
Oct 08 2015 15:50
wiki brownie
Rex Schrader
@SaintPeter
Oct 08 2015 15:50
@supasheva Glad to help :D
CamperBot
@camperbot
Oct 08 2015 15:50

:point_right: brownie points [wiki]

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

A user profile picture next to a with Brownie Points score

There are three ways you can get Brownie Points:

  1. Complete challenges - you get one point per challenge you complete
  2. Post relevant links on Camper News - you get 1 point for posting a link, and another point for each upvote your link gets
  3. Help other campers in chat - each time you help another camper and they thank you (by typing "thanks @yourname"), you will get a point

Brownie Points help you look like the kind of person who codes a lot, shares relevant links, and helps people.

They also add to your Streak.
:pencil: read more about brownie points on the FCC Wiki

Rex Schrader
@SaintPeter
Oct 08 2015 15:50
@Shifthawke You beat me to it. You have a macro or something?
Rohitnwn
@Rohitnwn
Oct 08 2015 15:50
Hi all :smile: can any one explain me how to solve smallest common multiple?
Rex Schrader
@SaintPeter
Oct 08 2015 15:51
@Rohitnwn Sure
Chris
@Shifthawke
Oct 08 2015 15:51
Lol. no. Just quick fingers
rickgordon86
@rickgordon86
Oct 08 2015 15:51
@Coira @SaintPeter Thanks
CamperBot
@camperbot
Oct 08 2015 15:52
rickgordon86 sends brownie points to @coira and @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 265 | @coira | http://www.freecodecamp.com/coira
:star: 913 | @saintpeter | http://www.freecodecamp.com/saintpeter
Peter Daily
@thepeted
Oct 08 2015 15:52
@pmohithkalyan if you complete all the bonfires / ziplines and basejumps then you can be invited to complete a project for a non-profit organisation
Rex Schrader
@SaintPeter
Oct 08 2015 15:54
@Rohitnwn The main thing you need to understand is Math. ;) Here are a couple of facts for you:
1) The smallest that the target could possibly be is the lowest number times the highest number in the range.
2) You're going to need to test a bunch of different numbers. A while loop might work.
3) You can use % (modulus) operator to see if something is evenly divisible.
4) You have to test every number in the range against your "target" number.
5) The potential target number you're testing can be incremented by at least the largest number in the range, because you know that it must be evenly divisible by that number.
Karolis
@Luomint
Oct 08 2015 15:56
bf pig latin
CamperBot
@camperbot
Oct 08 2015 15:56

:fire:Bonfire: Pig Latin :link:

function translate(str) {
 return str;
}

translate("consonant");

Translate the provided string to pig latin.

more info:  bf details | bf links | hint

Karolis
@Luomint
Oct 08 2015 15:56
hint
CamperBot
@camperbot
Oct 08 2015 15:56
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Rohitnwn
@Rohitnwn
Oct 08 2015 15:57
Thanks @SaintPeter so i will start from smallest multipeof largest number in range
CamperBot
@camperbot
Oct 08 2015 15:57
rohitnwn sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 914 | @saintpeter | http://www.freecodecamp.com/saintpeter
Joseph Gilgen
@jb-1980
Oct 08 2015 15:57
OK, so here is my code for Where art thou. I can not get it to pass the first test, where() returns an array of objects. But my console log shows it is an array of objects, so I am confused.
function where(collection, source) {
  var arr = [];
  var keys = Object.keys(source);
  for(var i in collection){
    var missing = false;
    for(var j in keys){
      if(!collection[i].hasOwnProperty(keys[j])){
        missing=true;
        break;
      }   
    }
    if(missing){
      continue;
    }
    arr.push(collection[i]);
  }
  // What's in a name?
  console.log(Array.isArray(arr));
  console.log(arr);
  return arr;
}

where([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
pappilino
@pappilino
Oct 08 2015 15:58
function sumAll(arr) {
  var min = Math.min(...arr);
  var max = Math.max(...arr);
  return min;

}

sumAll([1, 4]);
hi all. sorry to bother... but why does this return unexpected token? according to mdn, i can use ...arr as the spread operator? in fcc console and repl.it, it doesn't work.... compatibility issue?
rickgordon86
@rickgordon86
Oct 08 2015 15:58
@SaintPeter My code is working in repl but not passing in fcc

function palindrome(str) {

  str = str.replace(" ", "").toLowerCase();
  var reversed = str.split("").reverse().join("");
  if (str === reversed){
    return true;
  }else{
    return false;
  }

}



palindrome("eye");
pappilino
@pappilino
Oct 08 2015 15:59
@rickgordon86 because in fcc, the last test case involves special characters like 0_0
Rex Schrader
@SaintPeter
Oct 08 2015 15:59
@rickgordon86 You need to test alternate test cases. As I said before, you need to remove things other than spaces - you need to remove punctuation. If you need help building a regular expression, try http://regex101.com
pappilino
@pappilino
Oct 08 2015 15:59
try changing palindrome("with the test case")
kyleswardell
@kyleswardell
Oct 08 2015 15:59
What's more commonly done or preferred -- nesting an <input> inside of a <label>, or using a label's for attribute?
whathejoe
@whathejoe
Oct 08 2015 16:00
what is the assert() for?
Stefano
@Stedelie
Oct 08 2015 16:00
Hello Everyone, can someone help me with the second basic front-end project? I have a problem calling the api in order to get a quote...
Rex Schrader
@SaintPeter
Oct 08 2015 16:00
@kyleswardell Not exactly sure what you mean by labels for attribute, but I've seen both nesting and using the "for" attribute - it just depends on your use case. There is no "right" answer.
wiki help rooms
CamperBot
@camperbot
Oct 08 2015 16:01

:point_right: help rooms [wiki]

There are official help rooms for each major section of FCC content:

Chat Room Description
Help get help with our Waypoint challenges from your fellow campers
HelpBonfires get help with our Bonfire challenges from your fellow campers
HelpZiplines get help with our Zipline challenges from your fellow campers
HelpBasejumps get help with our Basejump challenges from your fellow campers
NonprofitProjects get help with your Nonprofit Projects from your fellow campers
CodeReview get constructive criticism and advice on finished code from your fellow campers
YouCanDoThis learning to code is hard - share your feelings and get moral support here

Choose the right room for your question!
:pencil: read more about help rooms on the FCC Wiki

Rex Schrader
@SaintPeter
Oct 08 2015 16:02
@NoodleSte You may want to ask in /HelpZiplines (see above)
rickgordon86
@rickgordon86
Oct 08 2015 16:03
@SaintPeter Thanks
CamperBot
@camperbot
Oct 08 2015 16:03
rickgordon86 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: rickgordon86 already gave saintpeter points
Rex Schrader
@SaintPeter
Oct 08 2015 16:03
@whathejoe assert is for testing your results. It says something like "I expect (or assert) that this statement should be true" and the statement might be like "If I run the function under test with a certain input, I'll get this certain output". Think of it as the "answer key" to the bonfires.
whathejoe
@whathejoe
Oct 08 2015 16:05
@SaintPeter Thanks
CamperBot
@camperbot
Oct 08 2015 16:05
whathejoe sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 915 | @saintpeter | http://www.freecodecamp.com/saintpeter
pappilino
@pappilino