These are chat archives for FreeCodeCamp/Help

5th
Sep 2015
Legendzs
@Legendzs
Sep 05 2015 00:02
function largestOfFour(arr) {
  // You can do this!
  var largest = 0;
  for(var i=0; i<4;i++){
    for(var y=0;y<4;y++){
      if (largest <= arr[i][y]) {
        var largest = arr[i][y];
      }
    }
  }
  return largest;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
I'm not sure why it's not passing me the Bonfire: Return Largest Numbers in Arrays. Is it asking for the entire set of array that holds the biggest number?
a1rr0wh3ad
@a1rr0wh3ad
Sep 05 2015 00:05
@Legendzs you are declaring a new variable called largest inside the if statement. try removing the var keyword.
anknits
@anknits
Sep 05 2015 00:07
Bonfire: No repeats please
CamperBot
@camperbot
Sep 05 2015 00:07

:fire:Bonfire: No repeats please :link:

function permAlone(str) {
  return str;
}

permAlone('aab');

Return the number of total permutations of the provided string that don't have repeated consecutive letters.

more info:  bf details | bf links | hint

anknits
@anknits
Sep 05 2015 00:07
hint
CamperBot
@camperbot
Sep 05 2015 00:07
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Jake Bryant
@jbryant8706
Sep 05 2015 00:08
Curiosuly, can we check out wiki for bonfires solve?
Legendzs
@Legendzs
Sep 05 2015 00:09
Removing the var doesn't pass it either =/ Anything else do you see wrong with it?
a1rr0wh3ad
@a1rr0wh3ad
Sep 05 2015 00:11
@Legendzs oh. you are only returning the largest of number among all arrays. the problem asks for largest on each array.
@Legendzs so you should be returning an array.
Legendzs
@Legendzs
Sep 05 2015 00:11
Oooooh. Alright. An array of the largest number in each array?
a1rr0wh3ad
@a1rr0wh3ad
Sep 05 2015 00:12
@Legendzs yep
Legendzs
@Legendzs
Sep 05 2015 00:12
hmmm ok thanks! I'll give it a go solving it with that then
CamperBot
@camperbot
Sep 05 2015 00:12
if you want to thank someone, put an @ before their name!
a1rr0wh3ad
@a1rr0wh3ad
Sep 05 2015 00:13
np
Briana Swift
@brianamarie
Sep 05 2015 00:17
Ok - I need help still with setTimeout. This codepen has a lot wrong with it still, but the main focus of my question is about line 31. Why can't I get this setTimeout to work? What's the problem? I've reached the point of 3 hours of frustration :fearful:
Line 31 of the javascript for clarification
Legendzs
@Legendzs
Sep 05 2015 00:24
@a1rr0wh3ad so I don't really know what I need to do. I feel like my currently path won't accomplish it and I would need to start over. Any advice?
Moisés Man
@moigithub
Sep 05 2015 00:27

@brianamarie setTimeout set an async timer call... so if u set 5 setTimeout in row with 1000 miliseconds...

setTimeout( fn, 1000)
setTimeout( fn, 1000)
setTimeout( fn, 1000)
setTimeout( fn, 1000)
setTimeout( fn, 1000)

so lets say if u set all those 5 at 7.26pm
at 7.27pm all those will ends

if u wanna run each with 1 second difference.. u need to increase/add up the interval
setTimeout( fn, 1000)
setTimeout( fn, 2000)
setTimeout( fn, 3000)
for (var n=0;n< arr.length; n++) {
   setTimeout( fn, (1000*n)+1000 );
}
Briana Swift
@brianamarie
Sep 05 2015 00:32
Ohhh.. That makes sense. However, I've changed my loop to this and it still isn't quite working. :(
  for (var i = 0; i < computerPattern.length; i++){
    setTimeout($(computerPattern[i]).addClass("active"),(1000*i)+1000);
    computerAudio[i].play();
    setTimeout(stateChange(computerPattern[i]),(1000*i)+1000);
  }
I really appreciate your time to look at this @moigithub
MrDrBird
@MrDrBird
Sep 05 2015 00:36
anyone have a tip to come up with a array of prime numbers for bonfire Sum All Primes ?
bonfire: Sum All Primes
CamperBot
@camperbot
Sep 05 2015 00:37

: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

Moisés Man
@moigithub
Sep 05 2015 00:45
@brianamarie u playing music synchronous... should be delayed too
a1rr0wh3ad
@a1rr0wh3ad
Sep 05 2015 00:50
@Legendzs what is your code so far?
palakjain855
@palakjain855
Sep 05 2015 00:51
bonfire where art thou
CamperBot
@camperbot
Sep 05 2015 00:51

:fire:Bonfire: Where art thou :link:

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

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

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

more info:  bf details | bf links | hint

palakjain855
@palakjain855
Sep 05 2015 00:52
hint
CamperBot
@camperbot
Sep 05 2015 00:52
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
chicachicamji
@chicachicamji
Sep 05 2015 00:52
anybody here proficient in java?
pedro Mendoza Garcia
@impaler1
Sep 05 2015 00:52
@impaler1
so im a little stuck and cant seem to find the problem. i am being asked to target a spesific element using .addClass
it says Use the addClass() jQuery function to give the element one new class for each selector: animated, shake, and btn-primary. and hear is my code. hear is the line of code were the problem is
$("#target1").addClass("animated shake btn-primary")
Briana Swift
@brianamarie
Sep 05 2015 00:54
As long as you're trying to target an element with the ID of target1, you're doing the right thing. I remember that being tricky and a touch buggy; I'd just move on. :) Looks right to me
pedro Mendoza Garcia
@impaler1
Sep 05 2015 00:58
@brianamarie awesome thank you
CamperBot
@camperbot
Sep 05 2015 00:58
impaler1 sends brownie points to @brianamarie :sparkles: :thumbsup: :sparkles:
:star: 345 | @brianamarie | http://www.freecodecamp.com/brianamarie
Samuel Chun
@Ephapox
Sep 05 2015 01:00
Does anyone here have a good grasp of the yeoman fullstack generator?
Samuel Chun
@Ephapox
Sep 05 2015 01:05
oh, thank you @moigithub I didn't see that
CamperBot
@camperbot
Sep 05 2015 01:05
ephapox sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 301 | @moigithub | http://www.freecodecamp.com/moigithub
Nazgul13
@Nazgul13
Sep 05 2015 01:08
i dont have enough information to know what this means "Give each of your button elements the class target."
x34passenger
@x34passenger
Sep 05 2015 01:08
bonfire: where art thou - not sure what is wrong:
function where(collection, source) {
  var arr = [];
  // What's in a name?
  var sourceKey = source.keys();
  var result = null;
  for(var i = 0; i < collection.length; i++)
  {
    if( sourceKey == collection[i])
    {
      result = collection[i];
    }
  }
  return result;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });
CamperBot
@camperbot
Sep 05 2015 01:08
Sorry, can't find a bonfire called where art thou - not sure what is wrongfunction wherecollection source var arr whats in a name var sourcekey sourcekeys var result null forvar i 0 i collectionlength i if sourcekey collectioni result collectioni return resultwhere first romeo last montague first mercutio last null first tybalt last capulet last capulet . [ Check the map? ]
Aniruddh Agarwal
@anrddh
Sep 05 2015 01:09
@Nazgul13 You have to add the 'target' class to each of your button elements
Like this:
<button class="target" ...>...</button>
the ... stand for the other code
SM
@nogo10
Sep 05 2015 01:27
Hi all! Ive started #zipline#2 really the api isn't responding (edit: in xml, json and Ive tried $.get, getJSON etc..: Is it some syntax ?
$(document).ready(function(){
    $("button").click(function(){
    $.getJSON("http://api.forismatic.com/api/1.0/","method=getQuote&format=json&lang=en", function(data){
            $("#result" ).text( data );
        }); 

    });
});
Samuel Chun
@Ephapox
Sep 05 2015 01:28
@nogo10 is it just not rendering data never returning any data? Have you tried logging data?
SM
@nogo10
Sep 05 2015 01:30
@Ephapox with codepen.io ? Ill have bring it to cloud9 which has better tools
Nazgul13
@Nazgul13
Sep 05 2015 01:31
is it supposed to skip around to different sections when doing training, from HTML to like JQuery ? I assumed it would go in order when just hitting next
Samuel Chun
@Ephapox
Sep 05 2015 01:32
@nogo10 if you replace $("#result" ).text( data ); with console.log(data) what do you get in your console?
SM
@nogo10
Sep 05 2015 01:35
@Ephapox no console on codepen.io at least none that I find *though I have not dug around to too much
palakjain855
@palakjain855
Sep 05 2015 01:36
my last test case of bonfire: where do i belong is failing! can anyone please help me
function where(arr, num) {
  var newArr = [];
  arr = arr.sort();
  for (var i = 0; i < arr.length; i++) {
    if (num <= arr[i]) {
      newArr.push(num);
      return i;
    } else {
      newArr.push(arr[i]);
    }
  }
}


where([40, 60], 50);
function where(arr, num) {
  var newArr = [];
  arr = arr.sort();
  for (var i = 0; i < arr.length; i++) {
    if (num <= arr[i]) {
      newArr.push(num);
      return i;
    } else {
      newArr.push(arr[i]);
    }
  }
}


where([40, 60], 50);
SM
@nogo10
Sep 05 2015 01:44
@palakjain855 why is part of your code ghosted like comments
a1rr0wh3ad
@a1rr0wh3ad
Sep 05 2015 01:44
@palakjain855 from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort it says "The default sort order is according to string Unicode code points." so arr is probably sorted as [10,2,5]
palakjain855
@palakjain855
Sep 05 2015 01:44
i really don't know
SM
@nogo10
Sep 05 2015 01:46
@palakjain855 look on line: return i
palakjain855
@palakjain855
Sep 05 2015 01:47
i got the soln. to this thanks
CamperBot
@camperbot
Sep 05 2015 01:47
if you want to thank someone, put an @ before their name!
Jake Bryant
@jbryant8706
Sep 05 2015 01:47
How to download screen hero?
x34passenger
@x34passenger
Sep 05 2015 01:48
can anyone help me with bonfire: where art thou?
CamperBot
@camperbot
Sep 05 2015 01:48
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Moisés Man
@moigithub
Sep 05 2015 01:56
@brianamarie this works.. dont know why should put inside an IIFE, else it dont work
  //computer playing functions
  var PLAY_INTERVAL=1000;
  for (var i = 0; i < computerPattern.length; i++){
    (function(i){
      setTimeout(function(){
        console.log("playing",i, computerPattern[i]);
        $(computerPattern[i]).addClass("active");
        //computerAudio[i].currentTime=0;
        computerAudio[i].play();
        stateChange(computerPattern[i]);
      },(PLAY_INTERVAL*i)+PLAY_INTERVAL);
    })(i);
  }
Briana Swift
@brianamarie
Sep 05 2015 01:57
@moigithub awesome!! Thank you! I will take a look at this. I've made some progress on my own, and I will compare it to this. :D
CamperBot
@camperbot
Sep 05 2015 01:57
brianamarie sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 302 | @moigithub | http://www.freecodecamp.com/moigithub
TeeReggz
@TeeReggz
Sep 05 2015 02:00

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

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

h2 {
font-family: Lobster, Monospace;
}

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

.smaller-image {
width: 100px;
}

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

</style>

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

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

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

<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
I get the error "Your img element should have the class smaller-image." Please help!!!

DJ
@qualitymanifest
Sep 05 2015 02:05
it's already got the class thick-green-border
Samuel Chun
@Ephapox
Sep 05 2015 02:05
has anyone successfully used the forismatic api? my ajax call doesn't even recognize the url
DJ
@qualitymanifest
Sep 05 2015 02:05
if you need to add another class, just hit space after the one thats in there and put it in, it wil recognize them as two different classes
TeeReggz
@TeeReggz
Sep 05 2015 02:08
@qualitymanifest Thank you!!!
CamperBot
@camperbot
Sep 05 2015 02:08
teereggz sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 176 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Samuel Chun
@Ephapox
Sep 05 2015 02:11
@nogo10 try this
$.ajax({
  method: "post",
  url: "http://api.forismatic.com/api/1.0/",
  dataType:"jsonp",
  data: {
    "method":"getQuote",
    "lang": "en",
    "format": "jsonp",
    "jsonp":"callback"
  },
  jsonpCallback: "callback",
  success: function(data) {
    $("#result" ).text( data );
  }
})
onedracoding
@onedracoding
Sep 05 2015 02:39
div element.jpg
Can anyone tell me why I'm getting the error message that my div won't turn gray?
Justin Crawford
@JCrawford1122
Sep 05 2015 02:42
@onedracoding one of your curly brackets needs to close .smaller-image first
you have two } under .gray-background one of them needs to move above .gray-background
onedracoding
@onedracoding
Sep 05 2015 02:43
Dude, thanks! I didn't even see that!
CamperBot
@camperbot
Sep 05 2015 02:43
if you want to thank someone, put an @ before their name!
onedracoding
@onedracoding
Sep 05 2015 02:44
@JCrawford1122 Thanks, man!
CamperBot
@camperbot
Sep 05 2015 02:44
onedracoding sends brownie points to @jcrawford1122 :sparkles: :thumbsup: :sparkles:
:star: 175 | @jcrawford1122 | http://www.freecodecamp.com/jcrawford1122
Justin Crawford
@JCrawford1122
Sep 05 2015 02:44
@onedracoding Np. Glad there are some things I can actually help with once and while!
rsmat
@rsmat
Sep 05 2015 02:58
blob
Hey I am stuck very early on and was hoping someone could explain what I am doing wrong.
why cant I get the css class "red-text" applied to h2
Jose M Viloria
@josevill
Sep 05 2015 02:59
@rsmat You have to add the red-text style class to your H2 element
rsmat
@rsmat
Sep 05 2015 03:00
I will try that again but when I do the last checkpoint gets the x mark
Jose M Viloria
@josevill
Sep 05 2015 03:00
Instead of just <h2>CatPhotoApp</h2>, you need to add the class using <h2 class='red-text'>CatPhotoApp</h2>
rsmat
@rsmat
Sep 05 2015 03:01
ok...so I feel dumb
thanks @josevill
CamperBot
@camperbot
Sep 05 2015 03:01
rsmat sends brownie points to @josevill :sparkles: :thumbsup: :sparkles:
:star: 259 | @josevill | http://www.freecodecamp.com/josevill
Justin Crawford
@JCrawford1122
Sep 05 2015 03:01
@rsmat Don't feel dumb
rsmat
@rsmat
Sep 05 2015 03:01
I was using "" instead of ' '
Jose M Viloria
@josevill
Sep 05 2015 03:01
You did well making the .red-text class. You only needed to know how to use it :)
Justin Crawford
@JCrawford1122
Sep 05 2015 03:02
you can use double quotes
rsmat
@rsmat
Sep 05 2015 03:02
then have no clue what I kept doing
thanks
CamperBot
@camperbot
Sep 05 2015 03:02
if you want to thank someone, put an @ before their name!
Jose M Viloria
@josevill
Sep 05 2015 03:02
Oh well, that doesn't really matter. It's a thing of habit
You must've been doing something else in the wrong way. Keep up the good mood, try to read every challenge's description carefully
Justin Crawford
@JCrawford1122
Sep 05 2015 03:03
a lot of people like the singles because its a little faster to type. But that's really the only difference I think
Jose M Viloria
@josevill
Sep 05 2015 03:03
Most of the time, the answer lies within it
rsmat
@rsmat
Sep 05 2015 03:04
thanks @josevill @JCrawford1122. Will keep a closer eye on the descriptions
CamperBot
@camperbot
Sep 05 2015 03:04
rsmat sends brownie points to @josevill and @jcrawford1122 :sparkles: :thumbsup: :sparkles:
:warning: rsmat already gave josevill points
:star: 176 | @jcrawford1122 | http://www.freecodecamp.com/jcrawford1122
Absalon Castañon Avila
@absalnC
Sep 05 2015 03:06
I just finished zipline: build a personal portfolio webpage on my computer, but when I copy the code to codepen I can't get my own css to work. Can sombody help me?
rsmat
@rsmat
Sep 05 2015 03:06
Im very early on so I could use some advice on how best to learn the material. Should I be taking notes the entire time or will the challenges reinforce what I learned often?
Zinga
@zingahart
Sep 05 2015 03:08
@rsmat Test your learning style! I like the VARK quiz online
I've done Waypoint10: Ditch Custom CSS for Bootstrap a couple of times but it doesn't seem to log as complete. Is there a way to log this?
Jesse
@jctm30
Sep 05 2015 03:12

hey guys

function end(str, target) {
  var stringEnd = str.substr(str.length-1, 1);
  var targetEnd = str.substr(target.length-1, 1);
  if (stringEnd === targetEnd) {
    return true;
  }
  else {
    return false;
  }
  return str;
}

end('Bastian', 'n');

what am i missing with this code?

this is for confirming the ending
DJ
@qualitymanifest
Sep 05 2015 03:14
which waypoint is that? @jctm30
Jesse
@jctm30
Sep 05 2015 03:15
this is forBonfire: Confirm the Ending
Check if a string (first argument) ends with the given target string (second argument).
Absalon Castañon Avila
@absalnC
Sep 05 2015 03:15
@jctm30 you could use charAt() instead of substr()
Austin Lin
@austinylin
Sep 05 2015 03:16
@jctm30 If I remeber correctly it wants you to compare the entire target string with the end of str
a1rr0wh3ad
@a1rr0wh3ad
Sep 05 2015 03:16
@jctm30 check ur declaration of targetEnd. You're applying substr to str.
Jesse
@jctm30
Sep 05 2015 03:16
@absalnC hey true! but the exercise has the substr link as a help link
@absalnC was trying to use that...
Austin Lin
@austinylin
Sep 05 2015 03:16
@jctm30 look at the last two test cases
Jesse
@jctm30
Sep 05 2015 03:17
@a1rr0wh3ad THANKS!! got it haha
CamperBot
@camperbot
Sep 05 2015 03:17
jctm30 sends brownie points to @a1rr0wh3ad :sparkles: :thumbsup: :sparkles:
:star: 296 | @a1rr0wh3ad | http://www.freecodecamp.com/a1rr0wh3ad
Jesse
@jctm30
Sep 05 2015 03:21
hey guys just a quick questio about my code:
function end(str, target) {
  var stringEnd = str.substr(str.length-1, 1);
  var targetEnd = target.substr(target.length-1, 1);
  if (stringEnd === targetEnd) {
    return true;
  }
  else {
    return false;
  }
  return str;
}

end('Bastian', 'n');

is the last line

return str;

necessary? what does it do?

i tried the code with and without it and it works
a1rr0wh3ad
@a1rr0wh3ad
Sep 05 2015 03:22
@jctm30 no. it will never be reached.
Jose M Viloria
@josevill
Sep 05 2015 03:22
No, it's not necessary
Also, it wont run, because once you return a value, your code will stop running
Jesse
@jctm30
Sep 05 2015 03:23
@josevill meaning my first return value of either true or false, right?
Jose M Viloria
@josevill
Sep 05 2015 03:23
Yes sir
Jesse
@jctm30
Sep 05 2015 03:23
@josevill got cha. thanks!
CamperBot
@camperbot
Sep 05 2015 03:23
jctm30 sends brownie points to @josevill :sparkles: :thumbsup: :sparkles:
:star: 260 | @josevill | http://www.freecodecamp.com/josevill
Jesse
@jctm30
Sep 05 2015 03:23
@a1rr0wh3ad thank you sir as well :)
CamperBot
@camperbot
Sep 05 2015 03:23
jctm30 sends brownie points to @a1rr0wh3ad :sparkles: :thumbsup: :sparkles:
:warning: jctm30 already gave a1rr0wh3ad points
Thomas Vaeth
@thomasvaeth
Sep 05 2015 03:24
switch (backgroundPic) {
        case 'clouds':
          $('body').css('background-image', 'url("../images/clear.jpg")');
        case 'drizzle':
          $('body').css('background-image', 'url("../images/clear.jpg")');
        case 'rain':
          $('body').css('background-image', 'url("../images/clear.jpg")');
        case 'thunderstorm':
          $('body').css('background-image', 'url("../images/clear.jpg")');
        case 'snow':
          $('body').css('background-image', 'url("../images/clear.jpg")');
        case 'atmosphere':
          $('body').css('background-image', 'url("../images/clear.jpg")');
        default:
          $('body').css('background-image', 'url("../images/clear.jpg")');
      }
Am I doing this switch / case wrong?
It works as an if/else, but when I try switch/case it doesn't.
Bill
@kirah1314
Sep 05 2015 03:25
@thomasvaeth you need to add breaks
a1rr0wh3ad
@a1rr0wh3ad
Sep 05 2015 03:25
@jctm30 you're very welcome, sir! :smile:
Thomas Vaeth
@thomasvaeth
Sep 05 2015 03:26
@kirah1314 That doesn't work unfortunately. Maybe I'm stuck using an if else for now.
DJ
@qualitymanifest
Sep 05 2015 03:28
@thomasvaeth are you sure you're doing it right? under each case code block you need break;
Austin Lin
@austinylin
Sep 05 2015 03:28
@thomasvaeth are the background image urls supposed to be different for each case? Looks like they are all using the same url
Thomas Vaeth
@thomasvaeth
Sep 05 2015 03:28
@austinylin I was just testing it.
@kirah1314 I've been reading that and the one on W3. @qualitymanifest I tried adding a break. It might be because I'm using JSON and jQuery. I'm going to post on Stack Overflow.
George
@sushiyea
Sep 05 2015 03:36
i need help on Responsive Design with Bootstrap #22
Justin Crawford
@JCrawford1122
Sep 05 2015 03:40
@sushiyea can you post what you have?
George
@sushiyea
Sep 05 2015 03:41
```<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<div class="col-xs-6">
</div>
</div>
</div>
</div>
This message was deleted
Justin Crawford
@JCrawford1122
Sep 05 2015 03:41
``` on the line before and after your code. they need to be on their own lines also
George
@sushiyea
Sep 05 2015 03:42
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <div class="col-xs-6">
    </div>
    </div>
  </div>
</div>
@JCrawford1122 Thanks
CamperBot
@camperbot
Sep 05 2015 03:42
sushiyea sends brownie points to @jcrawford1122 :sparkles: :thumbsup: :sparkles:
:star: 179 | @jcrawford1122 | http://www.freecodecamp.com/jcrawford1122
Justin Crawford
@JCrawford1122
Sep 05 2015 03:43
you need one of those </div> after the first <div class="col-xs-6">
George
@sushiyea
Sep 05 2015 03:43
I closed all my div classes ....
but let me try
Justin Crawford
@JCrawford1122
Sep 05 2015 03:44
yes but you need to move one up above the second column
I mean close the first column before you start the second one
George
@sushiyea
Sep 05 2015 03:44
oh ok
@JCrawford1122 Thanks for your help
CamperBot
@camperbot
Sep 05 2015 03:45
sushiyea sends brownie points to @jcrawford1122 :sparkles: :thumbsup: :sparkles:
:warning: sushiyea already gave jcrawford1122 points
Josh
@obscureether
Sep 05 2015 03:48
hey all....new to all of this and what I do know is self taught...

so trying to figure out what is wrong with this .......<style> .blue-text { color: blue;  } </style>

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

DJ
@qualitymanifest
Sep 05 2015 03:51
you don't have a red-text class defined. you have a blue-text class defined
Josh
@obscureether
Sep 05 2015 03:52
lol... missed that... trying but yea
Jose M Viloria
@josevill
Sep 05 2015 03:52
@obscureether If you're adding the red-text class to your h2 element, and you created a blue-text
Josh
@obscureether
Sep 05 2015 03:52
still will not take
Jose M Viloria
@josevill
Sep 05 2015 03:52
Change blue-text to red-text and the value of "color" change it to red
It should be something like <style> .red-text { color: red; }</style>
Austin Lin
@austinylin
Sep 05 2015 03:53
@obscureether what is the error you are getting?
Jose M Viloria
@josevill
Sep 05 2015 03:53
And <h2 class="red-text">CatPhotoApp</h2>
Thomas Vaeth
@thomasvaeth
Sep 05 2015 03:54
I need help checking something. Is it raining at anyone's house?
Josh
@obscureether
Sep 05 2015 03:55
trying to make ""CatPhotoApp'' red but will not change to red
not raining here
Austin Lin
@austinylin
Sep 05 2015 03:55
@obscureether see the code that @josevill put above.
Jose M Viloria
@josevill
Sep 05 2015 03:57
@thomasvaeth I tried finding some place that's is raining, i failed hard.
Sorry, lol
Josh
@obscureether
Sep 05 2015 04:00
thanks for all the help... dont know if i'm getting a glitch or what but keeps stating that ''Your h2 element should be red''.....and it is but will not except it ...
CamperBot
@camperbot
Sep 05 2015 04:00
if you want to thank someone, put an @ before their name!
Josh
@obscureether
Sep 05 2015 04:00
thanks @josevill @austinylin
CamperBot
@camperbot
Sep 05 2015 04:00
:star: 44 | @austinylin | http://www.freecodecamp.com/austinylin
obscureether sends brownie points to @josevill and @austinylin :sparkles: :thumbsup: :sparkles:
:star: 262 | @josevill | http://www.freecodecamp.com/josevill
Austin Lin
@austinylin
Sep 05 2015 04:01
@obscureether can you paste in all of your code. To make it format nicely put ``` on their own line before and after your code
Thomas Vaeth
@thomasvaeth
Sep 05 2015 04:01
@josevill Thanks for trying! I want to test my code, but I think I'll just code in a random location.
Jose M Viloria
@josevill
Sep 05 2015 04:01
help formatting
CamperBot
@camperbot
Sep 05 2015 04:01

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks, then type js or html 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

Austin Lin
@austinylin
Sep 05 2015 04:01
nice @josevill
a1rr0wh3ad
@a1rr0wh3ad
Sep 05 2015 04:03
@thomasvaeth according to twitter, it's raining in seoul.
Josh
@obscureether
Sep 05 2015 04:04

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

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

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

trying to learn... I know way behind you all but once it all clicks I'll be set and off running
Jose M Viloria
@josevill
Sep 05 2015 04:05
<style> .red-text { color: red; }</style>
<h2 class="red-text">CatPhotoApp</h2>
<p>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>
Austin Lin
@austinylin
Sep 05 2015 04:05
@obscureether that looks right to me. I would try copying all of the code, reloading the page, pasting it back in, and seeing if it will take it then
Jose M Viloria
@josevill
Sep 05 2015 04:05
@obscureether Weird thing. It should work.
@obscureether Do something.. Backup your code and refresh the site
@austinylin You type like.. Daaang, super fast!
deaninous
@deaninous
Sep 05 2015 04:06
function sumPrimes(num) {
  var temp = [];
  var Primes =[];
  var standa = 1;
  //getting all integers in between and pushing to temp
  for(var i = 0; i <= num; i++){
    temp.push(i); //logs [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

  }
  //console.log(temp);

  //checking for priminess; juct found out conventional word 
  //is "primality"
  //if primes, they are pushed to Primes

  for( i = 2; i < temp.length; i++){
    if(temp[i]  % i !== 0){

        Primes.push(temp[i]);
      console.log(Primes); //current problem is that this 
      //nothing


    }


  }

  console.log(Primes);
  //now we add eveything in beween;

  for( i = Math.min.apply(null, Primes); i < Math.max.apply(null, Primes); i++){
    result += i;
  }



}


sumPrimes(10);
anyone could help with my code?
Josh
@obscureether
Sep 05 2015 04:06
okay.. so think I need to go to sleep... had it right from the get go just did not hit "re-test"...lol
Austin Lin
@austinylin
Sep 05 2015 04:07
happens to the best of us :)
deaninous
@deaninous
Sep 05 2015 04:07
the midle section is not pushing anything
Josh
@obscureether
Sep 05 2015 04:07
thanks for hearing me out and allowing me to look stupid nd figure out where I messed up
CamperBot
@camperbot
Sep 05 2015 04:07
if you want to thank someone, put an @ before their name!
George
@sushiyea
Sep 05 2015 04:08
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">

    <div class="col-xs-6 well">
    </div>

    <div class="col-xs-6 well">
    </div>

  </div>
</div>
what is wrong with this ?
Jose M Viloria
@josevill
Sep 05 2015 04:08
@obscureether We all started at the same point.. Don't feel "dumb" or anything like that :)
Austin Lin
@austinylin
Sep 05 2015 04:09
@deaninous looking at it now, standby….
Jose M Viloria
@josevill
Sep 05 2015 04:09
@sushiyea
Josh
@obscureether
Sep 05 2015 04:09
all good... just needed someone else to make me look at what I did not do...
Jose M Viloria
@josevill
Sep 05 2015 04:09
You should create a div with the class well within those col-xs-6 divs
Instead of adding the well class to them, get it?
Josh
@obscureether
Sep 05 2015 04:09
thanks @josevill
CamperBot
@camperbot
Sep 05 2015 04:09
obscureether sends brownie points to @josevill :sparkles: :thumbsup: :sparkles:
:warning: obscureether already gave josevill points
Josh
@obscureether
Sep 05 2015 04:09
thanks @austinylin
CamperBot
@camperbot
Sep 05 2015 04:09
obscureether sends brownie points to @austinylin :sparkles: :thumbsup: :sparkles:
:warning: obscureether already gave austinylin points
deaninous
@deaninous
Sep 05 2015 04:11
thank you @austinylin
CamperBot
@camperbot
Sep 05 2015 04:11
deaninous sends brownie points to @austinylin :sparkles: :thumbsup: :sparkles:
:star: 45 | @austinylin | http://www.freecodecamp.com/austinylin
George
@sushiyea
Sep 05 2015 04:12
@josevill yea that was my second option but in the instructions it said "...inside each of the col-xs-6
Jose M Viloria
@josevill
Sep 05 2015 04:12
wp wells
waypoint wells
Nest one div element with the class well within each of your col-xs-6 div elements.
Austin Lin
@austinylin
Sep 05 2015 04:16
@deaninous I think your second loop is what is causing you trouble. It looks like you need to loop over all the possible values, your temp array, and then loop again to test if they are primes (https://blog.nraboy.com/2015/04/determine-if-a-number-is-prime-using-javascript)
deaninous
@deaninous
Sep 05 2015 04:18
thank you @austinylin I was trying this but I might need to go a different way
CamperBot
@camperbot
Sep 05 2015 04:18
deaninous sends brownie points to @austinylin :sparkles: :thumbsup: :sparkles:
:warning: deaninous already gave austinylin points
Austin Lin
@austinylin
Sep 05 2015 04:19
@deaninous whichever route you got to test for primes I would recommend making a second function that does that test. i.e.
deaninous
@deaninous
Sep 05 2015 04:21
will do more reading and get more familiar with it
Austin Lin
@austinylin
Sep 05 2015 04:22
That will let you test the prime function on its own w/o the other code. You can do that in the FCC editor like this:
function isPrime(num) {
// code
}

// other code

var expect = chai.expect;

expect(isPrime(2)).to.equal(true);
expect(isPrime(4)).to.equal(false);
deaninous
@deaninous
Sep 05 2015 04:27
thank you and took a sneak peak at your profile
CamperBot
@camperbot
Sep 05 2015 04:27
if you want to thank someone, put an @ before their name!
deaninous
@deaninous
Sep 05 2015 04:27
impressive @austinylin
Austin Lin
@austinylin
Sep 05 2015 04:28
thanks @deaninous. I still have a lot to learn :)
CamperBot
@camperbot
Sep 05 2015 04:28
austinylin sends brownie points to @deaninous :sparkles: :thumbsup: :sparkles:
:star: 218 | @deaninous | http://www.freecodecamp.com/deaninous
Josh
@obscureether
Sep 05 2015 04:34
question..... are you able to add ppl as "friends" on here...?
Jose M Viloria
@josevill
Sep 05 2015 04:37
@obscureether In Gitter? No
Neither in the Site
You'll have to put your short-term memory to test and memorize those names haha
Josh
@obscureether
Sep 05 2015 04:38
okay... thanks @josevill
CamperBot
@camperbot
Sep 05 2015 04:38
obscureether sends brownie points to @josevill :sparkles: :thumbsup: :sparkles:
:warning: obscureether already gave josevill points
Josh
@obscureether
Sep 05 2015 04:39
and yea can I use your memory...lol
deaninous
@deaninous
Sep 05 2015 04:39
@obscureether you can go to their gitter page and follow them
Josh
@obscureether
Sep 05 2015 04:41
so is this gitter kinda like "twitter"
never used this just signed up tonight with it
deaninous
@deaninous
Sep 05 2015 04:42
meant github
chicachicamji
@chicachicamji
Sep 05 2015 04:43
hey guys is anyone here proficient in java and would like to help me with something?
Josh
@obscureether
Sep 05 2015 04:43
yea saw that....
Bill
@kirah1314
Sep 05 2015 04:44
@obscureether you can private msg them then they'll be saved on your left column
Josh
@obscureether
Sep 05 2015 04:45
@kirah1314 thanks that's nice to know
CamperBot
@camperbot
Sep 05 2015 04:45
obscureether sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 185 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Sep 05 2015 04:45
that's probably as close to adding people as "friends" here
Josh
@obscureether
Sep 05 2015 04:46
how long till the brownie points stop showing up when I do the ...@
Bill
@kirah1314
Sep 05 2015 04:46
you can only give each person 1 point now haha
Josh
@obscureether
Sep 05 2015 04:46
lol...k
deaninous
@deaninous
Sep 05 2015 04:46
all day
Bill
@kirah1314
Sep 05 2015 04:47
as long as you put someone's name with a word that sounds like thanks then it'll show up
CamperBot
@camperbot
Sep 05 2015 04:47
if you want to thank someone, put an @ before their name!
Bill
@kirah1314
Sep 05 2015 04:47
thx
Roel Verbunt
@roelver
Sep 05 2015 04:47
@chicachicamji I know Java. What's your question?
justindobbs
@justindobbs
Sep 05 2015 04:57
what's a good resource for learning express?
Ammar Ali Shah
@AmmarAliShah
Sep 05 2015 05:02
@justindobbs Read the documentation Luke!
justindobbs
@justindobbs
Sep 05 2015 05:07
the documentation is okay, it's not ideal for me though just getting started
Aniruddh Agarwal
@anrddh
Sep 05 2015 05:14
scotch.io
Ammar Ali Shah
@AmmarAliShah
Sep 05 2015 05:15
@justindobbs Getting Started? Yeah then you need a tutorial
@justindobbs that should get you started
justindobbs
@justindobbs
Sep 05 2015 05:19
the tutorial guy's name is ben klinkenbeard. just for that reason i'll give it a try
oh it's clinkenbeard, sorry
Ammar Ali Shah
@AmmarAliShah
Sep 05 2015 05:21
@justindobbs Best of luck!
kangyao
@kay78
Sep 05 2015 05:22

can someone help me with my palindromes code:
function palindrome(str) {
str.toLowerCase();
var re = /\W/gi;
str.replace(re,"");
var len=str.length;

for(i=0, i<len; i++){
if(str[i] !== str[len-i-1]){
return false;
}
}
return true;
}

Austin Lin
@austinylin
Sep 05 2015 05:23
@kay78 help formatting
help formatting
CamperBot
@camperbot
Sep 05 2015 05:23

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks, then type js or html 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

justindobbs
@justindobbs
Sep 05 2015 05:23
no thomastvaeth
kangyao
@kay78
Sep 05 2015 05:24
@austinylin what is help formating?
Austin Lin
@austinylin
Sep 05 2015 05:24
@kay78 if you follow the instructions camperbot put in chat your code will look like this:
function palindrome(str) {
str.toLowerCase();
var re = /\W/gi;
str.replace(re,"");
var len=str.length;
for(i=0, i<len; i++){
if(str[i] !== str[len-i-1]){
return false;
}
}
return true;
}
just helps us read it
Josh
@obscureether
Sep 05 2015 05:26
what is it that you use to comment out something?
kangyao
@kay78
Sep 05 2015 05:26
function palindrome(str) {
str.toLowerCase();
var re = /\W/gi;
str.replace(re,"");
var len=str.length;
for(i=0, i<len; i++){
if(str[i] !== str[len-i-1]){
return false;
}
}
return true;
ops, sorry
Austin Lin
@austinylin
Sep 05 2015 05:28

A few quick observations, you need to check the formatting of your for loop there is a small typo there. In terms of the code itself, I think the main issue is that you are calling functions on the str object, but you aren’t storing the results anywhere.

For example in the first line of the function since you want to overwrite the original value of str with the lower cased version what you want is:

str = str.toLowerCase();
kangyao
@kay78
Sep 05 2015 05:30
@austinylin thanks, i relook into it.
CamperBot
@camperbot
Sep 05 2015 05:30
kay78 sends brownie points to @austinylin :sparkles: :thumbsup: :sparkles:
:star: 47 | @austinylin | http://www.freecodecamp.com/austinylin
Austin Lin
@austinylin
Sep 05 2015 05:31
@kay78 I would also look at the “helpful links” in the sidebar under the instructions. In particular the Array.reverse().
kangyao
@kay78
Sep 05 2015 05:32
@austinylin if i just use str.toLowerCase, the value of str is not converted and stored to lowercase??
Austin Lin
@austinylin
Sep 05 2015 05:33
@kay78 Ya. What is happening is that the lowercased value is returned from the function but because you aren’t capturing the output it’s getting discarded.
Ian Wang
@ianw3214
Sep 05 2015 05:40
bonfire no repeats please
CamperBot
@camperbot
Sep 05 2015 05:40

:fire:Bonfire: No repeats please :link:

function permAlone(str) {
  return str;
}

permAlone('aab');

Return the number of total permutations of the provided string that don't have repeated consecutive letters.

more info:  bf details | bf links | hint

Ian Wang
@ianw3214
Sep 05 2015 05:40
hint
CamperBot
@camperbot
Sep 05 2015 05:40
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Leonardo Prates
@odran037
Sep 05 2015 05:44
Hi everyone, could someone help me wrap my head around User Stories? The ziplines link to the wikipedia article about user stories but I’m not understanding how to apply that to the zipline.
I’m on the Show The Local Weather zipline*
Hans van Riet
@hansinla
Sep 05 2015 05:47
@odran037 User stories are requirements for your application. If a user wants to do this and expects this, you have to implement the algorithms/functions to make that happen.
Leonardo Prates
@odran037
Sep 05 2015 05:48
Ok, I think I understand that but still not sure how it realates/applies to the zipline.
Jose M Viloria
@josevill
Sep 05 2015 05:50
For example.
Hans van Riet
@hansinla
Sep 05 2015 05:50
@odran037 Well, when it says:
User Story: As a user, I can see the weather in my current location.
You’ll have to make that happen.
Jose M Viloria
@josevill
Sep 05 2015 05:51
In that Zipline you're asked to allow the user to see the weather in his/her current location
You'll have users from different places around the globe. So you'll have to implement something that gets the user current location, looks through some weather api its locations' weather and show it
Get it? @odran037
North American users use Fahrenheit as their temperature measure. In my case, we use Celsius. So it'd be cool if i could see the current temperature in Celsius or Fahrenheit
Steve Tang
@Thescuba
Sep 05 2015 05:55
bf Seek and Destroy
CamperBot
@camperbot
Sep 05 2015 05:55

:fire:Bonfire: Seek and Destroy :link:

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

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

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

more info:  bf details | bf links | hint

nihaleg
@nihaleg
Sep 05 2015 05:55
guys for the javascript slot machine waypoint how do you display the slot numbers in the correct positions
Bill
@kirah1314
Sep 05 2015 05:56
@nihaleg can you paste a link to the waypoint?
or copy/paste your codes?
what are the 3 lines of code that you need to write
Steve Tang
@Thescuba
Sep 05 2015 06:02
bf details
CamperBot
@camperbot
Sep 05 2015 06:02

:fire:Bonfire: Seek and Destroy :link:

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

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Steve Tang
@Thescuba
Sep 05 2015 06:03
bf link
CamperBot
@camperbot
Sep 05 2015 06:03
Sorry, can't find a bonfire called link. [ Check the map? ]
Steve Tang
@Thescuba
Sep 05 2015 06:03
bf links
CamperBot
@camperbot
Sep 05 2015 06:03
Austin Lin
@austinylin
Sep 05 2015 06:03
@Thescuba I did that one recently, let me know if you want to compare answers/chat through it.
Bill
@kirah1314
Sep 05 2015 06:04
@nihaleg
   slotOne = $($(".slot")[0]).html(slotOne);
    slotTwo= $($(".slot")[1]).html(slotTwo);
    slotThree= $($(".slot")[2]).html(slotThree);
Steve Tang
@Thescuba
Sep 05 2015 06:04
@austinylin Hi Austiny, Im just trying to get an understanding of it i just started
Leonardo Prates
@odran037
Sep 05 2015 06:04
@hansinla @josevill thank you! Makes perfect sense. I was way over complicating this in my head.
CamperBot
@camperbot
Sep 05 2015 06:04
odran037 sends brownie points to @hansinla and @josevill :sparkles: :thumbsup: :sparkles:
:star: 338 | @hansinla | http://www.freecodecamp.com/hansinla
:star: 263 | @josevill | http://www.freecodecamp.com/josevill
nihaleg
@nihaleg
Sep 05 2015 06:06
@kirah1314 this doesn't work
Bill
@kirah1314
Sep 05 2015 06:07
@nihaleg it does, I just completed it
@nihaleg
   // Only change code below this line.
   slotOne = $($(".slot")[0]).html(slotOne);
    slotTwo= $($(".slot")[1]).html(slotTwo);
    slotThree= $($(".slot")[2]).html(slotThree);
    // Only change code above this line.
make sure it's inside those 2 comments
click run tests again if it didn't go through, I had to click twice
nihaleg
@nihaleg
Sep 05 2015 06:08
@kirah1314 nvm i was putting it in the wrong place Thanks!!!
CamperBot
@camperbot
Sep 05 2015 06:08
nihaleg sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 186 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Sep 05 2015 06:09
yeah those gray comments don't stand out very well
glad I can help!
newskill
@newskill
Sep 05 2015 06:14
Seems like this should be pretty simple, but I can't seem to get it. On wp12, change font size, I added .font-16 { font-size: 16px; } to the style element and added "font-16" to the class of each of the <p> elements. I get green check marks on all the steps except the last one which says, "Give your p elements the font-size of 16px." I don't see what I am doing wrong.
Austin Lin
@austinylin
Sep 05 2015 06:15
quick q, do you need to pay for codepen for the ziplines?
nvm, figured it out.
Josh
@obscureether
Sep 05 2015 06:18
@newskill hit test
it resets it
Hans van Riet
@hansinla
Sep 05 2015 06:18
@newskill can you paste your code here?
newskill
@newskill
Sep 05 2015 06:19
@obscureether I still get a red X in the last step. @hansinla here it is:

<style>
.red-text {
color: red;
}
.font-16 {
font-size: 16px;
}
</style>

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

<p class="red-text" "font-16">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" "font-16"> kitty ipsum 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>

Hans van Riet
@hansinla
Sep 05 2015 06:20
@newskill "red-text" "font-16” lose the middle “ “. it should be class="red-text font-16"
a1rr0wh3ad
@a1rr0wh3ad
Sep 05 2015 06:21
@newskill the goal of the waypoint is to add styles to elements, not classes. so you should style p directly and not create a class.
newskill
@newskill
Sep 05 2015 06:24
@hansinla Thank you, that worked. I thought I needed separate quotes for each.
CamperBot
@camperbot
Sep 05 2015 06:24
newskill sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 339 | @hansinla | http://www.freecodecamp.com/hansinla
newskill
@newskill
Sep 05 2015 06:24
@a1rr0wh3ad I don't understand what you mean. Can you explain?
Hans van Riet
@hansinla
Sep 05 2015 06:25
@newskill You could have done (and this is what the WP12 asks for):
p{
    font-size: 12px;
}
a1rr0wh3ad
@a1rr0wh3ad
Sep 05 2015 06:26
@newskill oh sorry, i think i misunderstood the problem. i was assuming that you should use
what @hansinla said directly above this comment.
Bill
@kirah1314
Sep 05 2015 06:28
@newskill
<style>
  .red-text {
    color: red;
  }

  p {
    font-size: 16px;
  }

</style>

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

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

<p class="red-text">kitty ipsum 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>
just need to add a new <p> and what @hansinla posted above
John Irle
@JohnIrle
Sep 05 2015 06:30
I'm trying to swap the case of a string. for example CodEwArs --> cODeWaRS. I'm getting an object has no method "toUppercase"
Bill
@kirah1314
Sep 05 2015 06:30
I had to refresh the page though for all the green checks, it wasn't functioning correctly
John Irle
@JohnIrle
Sep 05 2015 06:30
function swap(str) {
  var string = str;
  for (var i = 0; i < str.length; i++) {
    if (string.charAt(i) == string.charAt(i).toUppercase()) {
      string.charAt(i).toLowercase();
    } else if (string.charAt(i) == string.charAt(i).toLowercase()) {
      string.charAt(i).toUppercase();
    }
  }
  return string;
}
Bill
@kirah1314
Sep 05 2015 06:30
@doudeman toUpperCase
John Irle
@JohnIrle
Sep 05 2015 06:31
Oh dang
Bill
@kirah1314
Sep 05 2015 06:31
toLowerCase also
John Irle
@JohnIrle
Sep 05 2015 06:31
@kirah1314 Thank you
CamperBot
@camperbot
Sep 05 2015 06:31
doudeman sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 187 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Sep 05 2015 06:31
welcome, glad to help :thumbsup:
Ngaosathe
@ThekhoN
Sep 05 2015 06:31
Guys I'm working on the Factorialize funct in bonfire...Please help
I can get it working with a while loop but trying with a for loop + reduce fails
John Irle
@JohnIrle
Sep 05 2015 06:32
hmm now it's spitting out HelloWorld instead of hELLOwORLD
Ngaosathe
@ThekhoN
Sep 05 2015 06:33
function factorialize(num){

  if(num < 0){
    return false;
  }
  else if (num == 1){
    return 1;
  }

  var anArr = [], answer;
  for (var i = num; i>1; i--) {
   anArr.push(i)
   }

  anArr.reduce(function(a,b) {
    answer =  a * b; 
  })
  return answer;
}
newskill
@newskill
Sep 05 2015 06:33
@hansinla , @a1rr0wh3ad , @kirah1314 I changed it as you have shown and passed the WP. Thank you all for your help. What is the difference between what I did and what you all showed me, or will I learn that later as I go on?
CamperBot
@camperbot
Sep 05 2015 06:33
newskill sends brownie points to @hansinla and @a1rr0wh3ad and @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: newskill already gave hansinla points
:star: 188 | @kirah1314 | http://www.freecodecamp.com/kirah1314
:star: 300 | @a1rr0wh3ad | http://www.freecodecamp.com/a1rr0wh3ad
angie2424
@angie2424
Sep 05 2015 06:33
what are some tips on how to think through bonfire questions? I am on mutations and I don't know how to approach it.
Bill
@kirah1314
Sep 05 2015 06:35
@newskill only create what the waypoint asks, it highlights the clues and in this case p
a1rr0wh3ad
@a1rr0wh3ad
Sep 05 2015 06:36
@newskill the first one will only style elements with the class you used (font-16.) The latter will apply the style to all p elements. In this waypoint, there was no difference, but if there were other p elements, that would have mattered.
connersmartin
@connersmartin
Sep 05 2015 06:36
I'm super confused why this isn't working on Return Largest number:
function largestOfFour(arr) {
  // You can do this!
  var res = [];
var comp = 0;
  for (var i = 0; i < arr.length; i++){
    for (var j = 0; j < arr[i].length; j++){
    if (comp <= arr[i][j]){
      comp = arr[i][j];
    }
    }
    res.push(comp);
  }
  return res;
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Bill
@kirah1314
Sep 05 2015 06:37
and if you were thinking to use the class, then you could had just used red-text which was created already
but the code checks will check to see if you added p
@newskill ^
Josh
@obscureether
Sep 05 2015 06:38
@hansinla you helped me by answering newskill
newskill
@newskill
Sep 05 2015 06:39
@kirah1314 and @a1rr0wh3ad Okay, now I get it. Thank you!
CamperBot
@camperbot
Sep 05 2015 06:39
newskill sends brownie points to @kirah1314 and @a1rr0wh3ad :sparkles: :thumbsup: :sparkles:
:warning: newskill already gave kirah1314 points
:warning: newskill already gave a1rr0wh3ad points
Bill
@kirah1314
Sep 05 2015 06:40
@connersmartin add this
   res.push(comp);
    comp=0;
John Irle
@JohnIrle
Sep 05 2015 06:40
I don't seem to be affecting any of the characters
function swap(str) {
  var string = str.split('');
  for (var i = 0; i < str.length; i++) {
    if (string[i] == string[i].toUpperCase()) {
      string[i].toLowerCase();
    } else if (string[i] == string[i].toLowerCase()) {
      string[i].toUpperCase();
    }
  }
  var join = string.join('');
  return join;
}
Bill
@kirah1314
Sep 05 2015 06:40
the comp=0;
angie2424
@angie2424
Sep 05 2015 06:40
@connersmartin after pushing the number into res you have reset comp to 0
connersmartin
@connersmartin
Sep 05 2015 06:40
@kirah1314 and @angieyeh , thanks!
CamperBot
@camperbot
Sep 05 2015 06:40
connersmartin sends brownie points to @kirah1314 and @angieyeh :sparkles: :thumbsup: :sparkles:
:star: 189 | @kirah1314 | http://www.freecodecamp.com/kirah1314
:star: 189 | @angieyeh | http://www.freecodecamp.com/angieyeh
John Irle
@JohnIrle
Sep 05 2015 06:41
Any ideas?
Hans van Riet
@hansinla
Sep 05 2015 06:43
@connersmartin Instead setting var comp = 0;, I suggest setting var comp = arr[i][0]; That way your function works for negative values as well.
Bill
@kirah1314
Sep 05 2015 06:43
@doudeman which bonfire is this?
reverse a string?
John Irle
@JohnIrle
Sep 05 2015 06:43
No I'm doing a challenge on codewars and I was just hoping for help
Bill
@kirah1314
Sep 05 2015 06:45
ahh ok
Robert Richey
@0x0936
Sep 05 2015 06:45
@doudeman strings are immutable - they cannot be mutated in place.
Bill
@kirah1314
Sep 05 2015 06:45
if (string[i] == string[i].toUpperCase()) {
John Irle
@JohnIrle
Sep 05 2015 06:46
@0x0936 Ahh thank you
CamperBot
@camperbot
Sep 05 2015 06:46
doudeman sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 106 | @0x0936 | http://www.freecodecamp.com/0x0936
Bill
@kirah1314
Sep 05 2015 06:47
looks like you're trying to reverse the cases, upper to lower and vice versa?
John Irle
@JohnIrle
Sep 05 2015 06:48
Yes
Woolwit
@Woolwit
Sep 05 2015 06:48
This message was deleted
Hans van Riet
@hansinla
Sep 05 2015 06:48
@doudeman you have to assign the string conversion like this:
string[i] = string[i].toUpperCase();
John Irle
@JohnIrle
Sep 05 2015 06:50
@hansinla wow that seems very obvious now. Thanks
CamperBot
@camperbot
Sep 05 2015 06:50
doudeman sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 340 | @hansinla | http://www.freecodecamp.com/hansinla
Robert Richey
@0x0936
Sep 05 2015 06:50
var str = "CaSe";
var arr = str.split('');
var result = arr.map(function(el) { return el === el.toUpperCase() ? el.toLowerCase() : el.toUpperCase(); }).join(''); // output: "cAsE"
John Irle
@JohnIrle
Sep 05 2015 06:52
I got it to work.
Robert Richey
@0x0936
Sep 05 2015 06:52
:)
Hans van Riet
@hansinla
Sep 05 2015 06:53
@0x0936 or:
var result = "CaSe".split('').map(function(el) { return el === el.toUpperCase() ? el.toLowerCase() : el.toUpperCase(); }).join('');
Robert Richey
@0x0936
Sep 05 2015 06:53
yep
Hans van Riet
@hansinla
Sep 05 2015 06:53
@0x0936 LOL
Robert Richey
@0x0936
Sep 05 2015 06:54
don't even need result. just return it
Hans van Riet
@hansinla
Sep 05 2015 06:56
@0x0936 touché
Woolwit
@Woolwit
Sep 05 2015 06:56
bonfire Arguments Optional
CamperBot
@camperbot
Sep 05 2015 06:56

:fire:Bonfire: Arguments Optional :link:

function add() {
  return false;
}

add(2,3);

Create a function that sums two arguments together. If only one argument is provided, return a function that expects one additional argument and will return the sum.

more info:  bf details | bf links | hint

Woolwit
@Woolwit
Sep 05 2015 06:57
bf details
CamperBot
@camperbot
Sep 05 2015 06:57

:fire:Bonfire: Arguments Optional :link:

function add() {
  return false;
}

add(2,3);
Create a function that sums two arguments together. If only one argument is provided, return a function that expects one additional argument and will return the sum.
For example, add(2, 3) should return 5, and add(2) should return a function that is waiting for an argument so that <code>var sum2And = add(2); return sum2And(3); // 5</code>
If either argument isn't a valid number, return undefined.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Woolwit
@Woolwit
Sep 05 2015 06:59
I'm having a hard time understanding these instructions. Specifically the "...should return a function that is waiting for an argument". Where will this returned function take its argument? Anyone? Thanks!
CamperBot
@camperbot
Sep 05 2015 06:59
if you want to thank someone, put an @ before their name!
Robert Richey
@0x0936
Sep 05 2015 07:07
@Woolwit there's a lot going on here, so the first thing I would do is validate the arguments. This should help you get started.
function add() {
  for (var i = 0; i < arguments.length; ++i) {
    if (isNaN(arguments[i])) { return undefined; }
  }
  // if code reaches here, arguments are numbers

  // if two arguments were passed in, return their sum

  // if one argument was passed in, return a function that takes one argument and returns the sum of that argument + arguments[0]
}
Steve Tang
@Thescuba
Sep 05 2015 07:08
hint
CamperBot
@camperbot
Sep 05 2015 07:08
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Raji Reddy
@RajiReddy-A
Sep 05 2015 07:09
Bonfire No repeats please: I didn't understand the question, can someone explain it to me?
CamperBot
@camperbot
Sep 05 2015 07:09
Sorry, can't find a bonfire called no repeats please i didnt understand the question can someone explain it to me. [ Check the map? ]
Robert Richey
@0x0936
Sep 05 2015 07:10
bf no repeats
CamperBot
@camperbot
Sep 05 2015 07:10

:fire:Bonfire: No repeats please :link:

function permAlone(str) {
  return str;
}

permAlone('aab');

Return the number of total permutations of the provided string that don't have repeated consecutive letters.

more info:  bf details | bf links | hint

Roy
@CruelCoin
Sep 05 2015 07:13
@RajiReddy-A Create an algorithm that can tell how many times you can arrange the letter without two of the same letters being beside each other.
Robert Richey
@0x0936
Sep 05 2015 07:13
@CruelCoin thanks, was having trouble wording that
CamperBot
@camperbot
Sep 05 2015 07:13
0x0936 sends brownie points to @cruelcoin :sparkles: :thumbsup: :sparkles:
:star: 173 | @cruelcoin | http://www.freecodecamp.com/cruelcoin
Rashid Thompson
@RashidT
Sep 05 2015 07:14

Hello all. I'm having a tough time trying to figure what is wrong with this code. The Bonfire: Find the Longest Word in a String. I think am I missing something from the split function making it output 10 instead of 6.

var code = " function findLongestWord(str) {

return str.split(/\w+/g).length;
}

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

I was trying to figure out what was missing from the code. Any help would be appreciated thanks.

Raji Reddy
@RajiReddy-A
Sep 05 2015 07:14
@CruelCoin 'aab' has 3 combinations 'aab' ,'aba','baa' out of 3 only 'aba' meets the requirements,then the answer should be 1, isn't it?
Woolwit
@Woolwit
Sep 05 2015 07:14
Thanks @0x0936 that will definitely get me started. But I'm baffled about where the other number will come from. Where will the 3 come from if there's only a single argument add(2). Do I just code 3 as the argument in the function to return?
CamperBot
@camperbot
Sep 05 2015 07:14
woolwit sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 107 | @0x0936 | http://www.freecodecamp.com/0x0936
Roy
@CruelCoin
Sep 05 2015 07:16
@RajiReddy-A You are correct. Not sure what is happening. Maybe you need to read the permutation documentation
Indranil Maji
@indranilphp
Sep 05 2015 07:16
bonfire check for palindromes
CamperBot
@camperbot
Sep 05 2015 07:16

:fire:Bonfire: Check for Palindromes :link:

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



palindrome("eye");

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

more info:  bf details | bf links | hint

Indranil Maji
@indranilphp
Sep 05 2015 07:16
hint
CamperBot
@camperbot
Sep 05 2015 07:16
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Roy
@CruelCoin
Sep 05 2015 07:17
@RashidT You need to split the string into an array. After that, loop through the array, using a counter to store what the length of the longest word was. Then return the size of the counter
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:17
Bonfire: Factorialize a Number .... the page keeps crashing when I submit my own code for the solution
CamperBot
@camperbot
Sep 05 2015 07:17
Sorry, can't find a bonfire called factorialize a number the page keeps crashing when i submit my own code for the solution. [ Check the map? ]
Steve Tang
@Thescuba
Sep 05 2015 07:17
hint
CamperBot
@camperbot
Sep 05 2015 07:17
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Steve Tang
@Thescuba
Sep 05 2015 07:17
bf seek and destoy
CamperBot
@camperbot
Sep 05 2015 07:17
Sorry, can't find a bonfire called seek and destoy. [ Check the map? ]
Steve Tang
@Thescuba
Sep 05 2015 07:17
bf Seek and Destroy
CamperBot
@camperbot
Sep 05 2015 07:17

:fire:Bonfire: Seek and Destroy :link:

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

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

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

more info:  bf details | bf links | hint

Steve Tang
@Thescuba
Sep 05 2015 07:17
hint
CamperBot
@camperbot
Sep 05 2015 07:17
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Roy
@CruelCoin
Sep 05 2015 07:17
@kwesifokuo Post your code?
Josh
@obscureether
Sep 05 2015 07:18
okay question...... I am getting ...Your a element should be nested within your new p element.
I put ... <p> click here for<a href="http://freecodecamp.com" > cat photos</a> to see.</p>
whtat am i missing
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:19

@CruelCoin function factorialize(num) {
var nf = [];
var i=1;
while(i <= num){
nf.push(i);
}
var aIn;
var aMu;
for(var ia=0; ia <= nf.length-1;ia++){
aIn = nf[ia];
aMu = aIn * nf[ia];
}
return aMu;
}

factorialize(5);

Rashid Thompson
@RashidT
Sep 05 2015 07:20
@CruelCoin The loop that you are refering to, I would have to use a for loop correct?
DTing
@dting
Sep 05 2015 07:20
@kwesifokuo you never increment i
you will enter an infinite loop in the first while loop
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:21
oopsss.... my bad
@dting I have incremented i and it works now... but still not getting the correct solution
any advice?
DTing
@dting
Sep 05 2015 07:25
what did you change it to?
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:26
var i=1;
while(i <= num){
nf.push(i);
i++;
}
DTing
@dting
Sep 05 2015 07:26
you can post your code like this for future referenece
help formatting
CamperBot
@camperbot
Sep 05 2015 07:26

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks, then type js or html 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

Robert Richey
@0x0936
Sep 05 2015 07:27
@Woolwit nope, it's whatever you name the parameter for the returned function - and won't necessarily be 3. This challenge is about closures. When the add function returns another function, that returned function can remember the value of the arguments first passed in - if they are saved as local variables.
var subtract = function() {
  // store the value of arguments[0] into a local variable
  var arg = arguments[0];
  return function(n) {
    return arg - n;
  }
}
var tenMinus = subtract(10);
tenMinus(7) === 3;
tenMinus(2) === 8;
DTing
@dting
Sep 05 2015 07:27
var aIn;
var aMu;
for(var ia=0; ia <= nf.length-1;ia++){
aIn = nf[ia];
aMu = aIn * nf[ia];
}
this part isnt correct
jparrish62
@jparrish62
Sep 05 2015 07:28
Hello all I have a question Im new to FreeCodeCamp and I would like to get paired on a nonprofit project can somebody point me in the right direction?
DTing
@dting
Sep 05 2015 07:29
you are trying to multiple all the numbers in the array. you can think of it like this.
DECLARE a variable to hold the RESULT
ASSIGN RESULT to the first value
FOR VALUE starting from the second to the end
   RESULT *= VALUE 
RETURN RESULT
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:31
ok
@dting I will try that
DTing
@dting
Sep 05 2015 07:31
@kwesifokuo the other thing is creating the array isnt necessary
you can combine those 2 steps into one
but you should get it working and figure out how to combine the 2 loops (the while and the for loop)
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:32
@dting got it work!

`function factorialize(num) {
var nf = [];
var i=1;
while(i <= num){
nf.push(i);
i++;
}

var prod = nf[0];
for(var e=1; e<= nf.length-1;e++){
prod *= nf[e];
}
return prod;
}

factorialize(5);
`

Robert Richey
@0x0936
Sep 05 2015 07:32
@jparrish62 before you can work on a non-profit project, you'll need to complete the bonfires, ziplines and basejumps and have your code reviewed
Woolwit
@Woolwit
Sep 05 2015 07:32
Thanks @0x0936 I'm beginning to see the light. Glad I stopped by! (P.S. FCC, wish there were a related video with each BF to go over the problem ala KhanAcademy)
CamperBot
@camperbot
Sep 05 2015 07:32
woolwit sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:warning: woolwit already gave 0x0936 points
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:33

```function factorialize(num) {
var nf = [];
var i=1;
while(i <= num){
nf.push(i);
i++;
}

var prod = nf[0];
for(var e=1; e<= nf.length-1;e++){
prod *= nf[e];
}
return prod;
}

factorialize(5);
```

```function factorialize(num) {
var nf = [];
var i=1;
while(i <= num){
nf.push(i);
i++;
}

var prod = nf[0];
for(var e=1; e<= nf.length-1;e++){
prod *= nf[e];
}
return prod;
}

factorialize(5);

DTing
@dting
Sep 05 2015 07:34
the "```" need to be on their own lines
bf factor
CamperBot
@camperbot
Sep 05 2015 07:35

:fire:Bonfire: Factorialize a Number :link:

function factorialize(num) {
  return num;
}

factorialize(5);

Return the factorial of the provided integer.

more info:  bf details | bf links | hint

DTing
@dting
Sep 05 2015 07:36
@kwesifokuo is it working for you?
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:36
@dting not allowing me to send after the backticks..
Woolwit
@Woolwit
Sep 05 2015 07:36
@0x0936 It sounds like you would know... The MAP has been updated since I started the Bonfires. Would you recommend I go back and fill in the blanks before moving on? Including the Basic Javascript?
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:37
function factorialize(num) {
  var nf = [];
  var i=1;
  while(i <= num){
    nf.push(i);
    i++;
  }

  var prod = nf[0];
  for(var e=1; e<= nf.length-1;e++){
    prod *= nf[e];
  }
  return prod;
}

factorialize(5);
DTing
@dting
Sep 05 2015 07:37
is that working for you?
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:37
finally got the code showing properly...
@dting it's working correctly for me. the solution worked
@dting thank you
CamperBot
@camperbot
Sep 05 2015 07:37
kwesifokuo sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1025 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Sep 05 2015 07:38
nps. I would try to solve it with out making the intermediate array
  var prod = nf[0];
  for(var e=1; e<= nf.length-1;e++){
    prod *= nf[e];
  }
  return prod;
this part of your code should look very similar to the solution
x34passenger
@x34passenger
Sep 05 2015 07:39
Zipline: Build a Personal Portfolio Webpage - how do you get the background images?
Robert Richey
@0x0936
Sep 05 2015 07:39
@Woolwit if you want to eventually work on a non-profit project, the bonfires will need to be completed, in addition to the ziplines and basejumps. The waypoints, on the other hand, are optional. Do them if you feel they will help accelerate your understanding. Also checkout 25 Free Resources for New JavaScript Developers.
A resource not listed, that I recommend, is Harvard's CS50 which you can take for free through edX. It's not JavaScript, but the CS education is solid and it gets into some Web development in the latter half of the course.
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:42

@dting
```
function factorialize(num) {

var prod = 1;
for(var e=num; e>= 1;e--){
prod *= e;
}
return prod;
}

factorialize(5);

@dting
function factorialize(num) {

  var prod = 1;
  for(var e=num; e>= 1;e--){
    prod *= e;
  }
  return prod;
}

factorialize(5);
@dting I got this one working too
DTing
@dting
Sep 05 2015 07:43
@kwesifokuo nice work
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:43
shorter but working
Robert Richey
@0x0936
Sep 05 2015 07:43
@x34passenger Google images, then upload to imgur.com
x34passenger
@x34passenger
Sep 05 2015 07:43
@0x0936 what is the url for the Google images?
DTing
@dting
Sep 05 2015 07:43
bunch of ways to solve this one. you can also use a while loop or recursion
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:44
@dting it's always good getting fewer lines of code executing solutions
x34passenger
@x34passenger
Sep 05 2015 07:44
@0x0936 the specific urls for the same images
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:44
@dting can you show me a recursion example?
DTing
@dting
Sep 05 2015 07:44
@kwesifokuo the main benefit of your for loop vs your array solution is that it doesnt create an array object and use extra memory
@kwesifokuo sure
function factorialize(num) {
  if (num < 0) return undefined;
  if (num === 0) return 1;
  return num < 3 ? num : num * factorialize(num-1);
}
factorialize(5);
Robert Richey
@0x0936
Sep 05 2015 07:45
@x34passenger when you do a search on Google, you'll see links near the top for "Images", "Video", "News", "Shopping", etc
I don't understand your last question
x34passenger
@x34passenger
Sep 05 2015 07:46
@0x0936 yes I know that, but how do I get the same images that is on codepen?
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:46
@dting wow! I didn't see the ternary operator solving this one... I love using the ternary operator
DTing
@dting
Sep 05 2015 07:47
@kwesifokuo you array version would need to keep in memory every value between 1 and num
your for loop solution would use much less memory, only having to use 2 variables. the looping variable e and the prod
Robert Richey
@0x0936
Sep 05 2015 07:47
@x34passenger sorry bud, I still don't understand what you're asking
Woolwit
@Woolwit
Sep 05 2015 07:47
Thanks @0x0936 ! If a code review of the Bonfires is involved... oi. But they passed! I loved, and recommend, Dr. Chuck's 'Programming for Everybody (Python)' https://www.coursera.org/course/pythonlearn Will check out CS50.
CamperBot
@camperbot
Sep 05 2015 07:47
:warning: woolwit already gave 0x0936 points
woolwit sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
x34passenger
@x34passenger
Sep 05 2015 07:47
@0x0936 if you go look at this url -> http://codepen.io/ThiagoFerreir4/full/eNMxEp
@0x0936 I want the same images
@0x0936 the same background images
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:48
@dting I am now learning more about recursion... I haven't used recursion before in my programs
I have seen it a couple of times in JS tutorials though
DTing
@dting
Sep 05 2015 07:49
@kwesifokuo heres my for loop version it looks very similiar to yours
function factorializeFor(num) {
  if (num < 0) return undefined;
  var result = 1;
  for (var i = 2; i <= num; i++) {
      result *= i;
  }
  return result
}
factorializeFor(5);
Robert Richey
@0x0936
Sep 05 2015 07:49
@x34passenger you can find the urls in the code. click 'Edit this Pen' in the bottom left corner and scroll through the code to find the urls
DTing
@dting
Sep 05 2015 07:49
@kwesifokuo nice. its good to figure out different ways to solve the problems.
x34passenger
@x34passenger
Sep 05 2015 07:51
@0x0936 okay got that one, my next question is how do I make all the content available to the user by scrolling?
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:51
@dting yes. I am still trying to wrap my head around recursion. I think I have to search for something that will let me understand recursion once and for all
@dting your for loop is the incremental one of mine
Robert Richey
@0x0936
Sep 05 2015 07:52
@x34passenger you'll need background-attachment
Steve Tang
@Thescuba
Sep 05 2015 07:55
working on my first zip line wondering if anyone else is just starting out also
Robert Richey
@0x0936
Sep 05 2015 07:56
@kwesifokuo another bonfire that's good for recursion is Repeat a string repeat a string
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 07:57
@0x0936 ok sure. that's the 9th one... I will definitely try to understand it best when I get to it
@0x0936 thanks
angie2424
@angie2424
Sep 05 2015 08:05
my code wont save in the text editor for the bonfires. Does anyone know why? even after submitting, when I go back to the same exercise, all the code i wrote is gone.
aslamweb
@aslamweb
Sep 05 2015 08:05
What's wrong in this code

16
.smaller-image {
17
width: 100px;
18
}
19

20
.thick-green-border
21

22
{
23
border-width: 10px;
24
border-color: green;
25
border-style: solid;
26

27
}
28

29
</style>
30

31

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

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

<code>16
.smaller-image {
17
width: 100px;
18
}
19

20
.thick-green-border
21

22
{
23
border-width: 10px;
24
border-color: green;
25
border-style: solid;
26

27
}
28

29
</style>
30

31

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

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

Help me

16
.smaller-image {
17
width: 100px;
18
}
19

20
.thick-green-border
21

22
{
23
border-width: 10px;
24
border-color: green;
25
border-style: solid;
26

27
}
28

29
</style>
30

31

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

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

Whats wrong in code
DTing
@dting
Sep 05 2015 08:11
help formatting
CamperBot
@camperbot
Sep 05 2015 08:11

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks, then type js or html 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

DTing
@dting
Sep 05 2015 08:11
@aslamweb
<img src="https://bit.ly/fcc-relaxing-cat" class="smaller-image" 34 class="thick-green-border">
you dont want to declare 2 class attributes
you want 1 class attribute with both classes in it seperated by a space
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 08:41
any help with Bonfire: Check for Palindromes?
CamperBot
@camperbot
Sep 05 2015 08:41
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 08:42
here's my code:
function palindrome(str) {
  // Good luck!
  nstr = str.toLowerCase();
  var spa = /\s+/g;
  nstr = nstr.replace(/[^\w\s]/gi, "");
  //nstr = nstr.replace(/\s/gi, "");
  nstr = nstr.split(",");
  nstr = nstr.reverse();
  nstr = nstr.join("");
  //nstr = nstr.replace(/\s+/g, "");


  if(nstr === str){
    return true
  } else {
    return false;
  }

}



palindrome("eye");
asdi
@asdal
Sep 05 2015 08:56
This message was deleted
can any one explain what this test#5 requires ? http://www.freecodecamp.com/challenges/bonfire-make-a-person expect(bob.getFirstName()).to.eql('Bob');
expected undefined to deeply equal 'Bob'
Aleksandar B.
@aleksandar-b
Sep 05 2015 08:58
@kwesifokuo the line nstr = nstr.split(","); should be without ,.
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 08:59
@samosale ok. I'll try that
Aleksandar B.
@aleksandar-b
Sep 05 2015 09:02
@kwesifokuo o, i see that you have a hole sentences in that bonfire. This will not work.
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 09:03
@samosale it worked! here is the code that worked
function palindrome(str) {
  // Good luck!
  nstr = str.toLowerCase();
  var spa = /\s+/g;
  mstr = nstr.replace(/[^\w]/g, "");
  //nstr = nstr.replace(/\s/gi, "");
  nstr = mstr.split("");
  nstr = nstr.reverse();
  nstr = nstr.join("");
  //nstr = nstr.replace(/\s+/g, "");


  if(nstr === mstr){
    return true
  } else {
    return false;
  }

}
Aleksandar B.
@aleksandar-b
Sep 05 2015 09:07
@kwesifokuo cool
Hans van Riet
@hansinla
Sep 05 2015 09:09
@asdal it means your function bob.getFirstName() didn’t return Bob, but undefined.
$($(".slot")[0]).html(slotOne);
$($(".slot")[0]).html(slotTwo);
$($(".slot")[0]).html(slotThree);
Can anybody explain me what to write in addition to this code?
Oleg-docent
@Oleg-docent
Sep 05 2015 10:17
I have done this challenge)
Joe Toh Djojo
@joseph-tohdjojo
Sep 05 2015 11:07
does anyone know a zipcode api that gives latitude and longitude coordinates and that also allows at least 500 calls per day?
Aniruddh Agarwal
@anrddh
Sep 05 2015 11:11
navigator.geolocation?
Doug Riblet
@DougRiblet
Sep 05 2015 11:20
Can someone help with a canvas drawing beginner question?
Specifically why this code does not draw a green arc? I followed the code in Eloquent JavaScript.
http://codepen.io/smashzen/pen/XmJyRy?editors=101
x34passenger
@x34passenger
Sep 05 2015 11:46
I am working on Zipline: Build a Personal Portfolio Webpage - is each of the 4 links on the right 4 separate html pages?
Briana Swift
@brianamarie
Sep 05 2015 11:51
@x34passenger are you talking about on the navbar?
those aren't separate html pages, they're different parts of the page. This link may be helpful, it helped me when I was working on the navbar for the portfolio zipline: http://www.thesitewizard.com/html-tutorial/link-to-specific-line-or-paragraph.shtml
x34passenger
@x34passenger
Sep 05 2015 12:06
@brianamarie I don't quite understand, so each section of the main page or single page is composed of sections which make up other pages, but if the other pages are not separate html pages, then are they divs?
Briana Swift
@brianamarie
Sep 05 2015 12:10
They're not separate sections - you can create internal links so that the browser can reference them. They're links, yes, but they look like <a name = info> </a> and when you link to info like <a href = #info> Click here to go to the info section </a> it will automatically scroll the page to wherever that line falls in the HTML code
x34passenger
@x34passenger
Sep 05 2015 12:17
@brianamarie in <a href = #info>, is info an id?
@brianamarie I don't know what each page should be, are they <p> or <div> or something else?
Briana Swift
@brianamarie
Sep 05 2015 12:18
no, info is a name. If you have an info section on your page and you literally put <a name = info></a> inside of that row, when you link to #info it will find it. It doesn't have to be in a div or in a p, just physically on a line that is at the top of the section. Have you tried it out? Once you see it in action it may make more sense.
x34passenger
@x34passenger
Sep 05 2015 12:22
@brianamarie will try it out
Rory Smith
@alanbuchanan
Sep 05 2015 12:27
for Bonfire: Diff Two Arrays, i would like to know if i can make my filter solution more efficient:
function diff(arr1, arr2) {

    function check2(value, index, array){
        return arr2.indexOf(value) === -1;
    }

    function check1(value, index, array){
        return arr1.indexOf(value) === -1;
    }

    var result2 = arr2.filter(check1);
    var result1 = arr1.filter(check2)

    return result1.concat(result2);
}
Serse
@Sersee
Sep 05 2015 12:46
hello!
Is there any way to do the clock zipline without angularjs?
Aniruddh Agarwal
@anrddh
Sep 05 2015 12:57
you mean the pomodoro one?
Serse
@Sersee
Sep 05 2015 12:58
yes
Rory Smith
@alanbuchanan
Sep 05 2015 13:05
@awesomeaniruddh do you have any tips for my above code :point_up: September 5, 2015 1:27 PM
Aniruddh Agarwal
@anrddh
Sep 05 2015 13:06
@Sersee All of my ziplines are in jQuery
@alanbuchanan let me take a peek
Rory Smith
@alanbuchanan
Sep 05 2015 13:06
@Sersee i also did the clock with jquery, you certainly don't need angular
Aniruddh Agarwal
@anrddh
Sep 05 2015 13:08
They only moved the angular course between the ziplines in the recent update
Previously, you learned angular after completing all the ziplines
bonfire diff two arrays
CamperBot
@camperbot
Sep 05 2015 13:09

: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

Aleksandar B.
@aleksandar-b
Sep 05 2015 13:09

In this picture bellow, what does prototype represent, and what does proto represent. Also where is the method that delegetes to another prototype up in chain. And how it is called?

alt

Oleg-docent
@Oleg-docent
Sep 05 2015 13:11
function palindrome(str) {
  // Good luck!
  return true;
}



palindrome("eye");
Rory Smith
@alanbuchanan
Sep 05 2015 13:11
@samosale at 5:46 in case it doesn't go there itself
Any idea?
Aleksandar B.
@aleksandar-b
Sep 05 2015 13:12
@alanbuchanan tnx
CamperBot
@camperbot
Sep 05 2015 13:12
samosale sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 242 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Rory Smith
@alanbuchanan
Sep 05 2015 13:12
@samosale (not that i fully understand it myself :) )
@Oleg-docent what have you tried so far?
Aniruddh Agarwal
@anrddh
Sep 05 2015 13:14
I learned about it in the Udacity course we had to do for OOJavascript
But then I forgot :P
Rory Smith
@alanbuchanan
Sep 05 2015 13:15
@awesomeaniruddh did you get a chance to look at my code?
Aniruddh Agarwal
@anrddh
Sep 05 2015 13:15
@alanbuchanan I don't really know
Not that good at optimising speed
I usually focus on readability
Rory Smith
@alanbuchanan
Sep 05 2015 13:15
@awesomeaniruddh do you see my problem though? it's using two separate functions to do the same thing, just on different targets :worried:
Aniruddh Agarwal
@anrddh
Sep 05 2015 13:16
But it definitely looks more succinct than my code
I had no idea filter existed when I did mine
Rory Smith
@alanbuchanan
Sep 05 2015 13:16
haha
Aniruddh Agarwal
@anrddh
Sep 05 2015 13:16
Using multiple functions should be fine though
I remember reading somewhere that in functional programming, a single function must contain as little code as possible
And must only perform a specific action
Rory Smith
@alanbuchanan
Sep 05 2015 13:17
that's interesting
but my code is verging on repeating itself
which is surely worse than a long function
Aniruddh Agarwal
@anrddh
Sep 05 2015 13:18
why not make a function that takes an array as a parameter
and use filter inside it
with an anon callback
Serse
@Sersee
Sep 05 2015 13:19
thanks
@awesomeaniruddh @alanbuchanan
CamperBot
@camperbot
Sep 05 2015 13:19
sersee sends brownie points to @awesomeaniruddh and @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 361 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
:star: 243 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Ngaosathe
@ThekhoN
Sep 05 2015 13:20
guys..why is my palindrome function not being accepted..
function palindrome(str) {
  var str = str.toLowerCase(), confirm;
  str = str.split('');
  var revStr = str.concat([]).reverse();

  confirm =str.every(function(currV, index){
     return currV == revStr[index];
  })
 return confirm;

 if(!confirm){
  return false;
 }
}
Aniruddh Agarwal
@anrddh
Sep 05 2015 13:20
uhm, what is confirm supposed to be doing?
in the first line of the function
oh, nvm
Soumya Rauth
@soumyaRauth
Sep 05 2015 13:22
Help needed.... Pomodoro clock... Anyone there to help?
CamperBot
@camperbot
Sep 05 2015 13:22
no wiki entry for: needed pomodoro clock anyone there to help
:pencil: click here to create one now!after creating your page type update to reload it here
Soumya Rauth
@soumyaRauth
Sep 05 2015 13:24
hello there.... :)
co0lguy42
@co0lguy42
Sep 05 2015 13:25
how do you resize an image
Rory Smith
@alanbuchanan
Sep 05 2015 13:26
@soumyaRauth what problems are you having?
Ngaosathe
@ThekhoN
Sep 05 2015 13:27
hmm..so it's the white spaces and punctuations i think..
Soumya Rauth
@soumyaRauth
Sep 05 2015 13:28
@alanbuchanan I used setInterval. But, i am so confused about the function inside setInterval.
Rory Smith
@alanbuchanan
Sep 05 2015 13:28
do you have code so far?
Soumya Rauth
@soumyaRauth
Sep 05 2015 13:29
I tried many things within the timer function in my code. Finally i erased it. Can't help. Here's my codepen > http://codepen.io/soumya_rauth/pen/PPoZMM
Rory Smith
@alanbuchanan
Sep 05 2015 13:33
@soumyaRauth in your timer() function, you want to be changing the values of 0:0
@soumyaRauth i found it easier to figure out the time in seconds, and then convert that to mins and seconds, and then display it, rather than treating mins and secs separately
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 13:35
I need the proper syntax for this:
```
Soumya Rauth
@soumyaRauth
Sep 05 2015 13:35
@alanbuchanan Could you please write the brief of the code sequence. I know that it is not what I supposed to ask for. But, can't help...
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 13:35
return (value != 4 || value != 9);
That doesn't work...and it's because of the or
How should I write that?
Soumya Rauth
@soumyaRauth
Sep 05 2015 13:37
@TheHighPriestess should have worked.....!!!
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 13:37
it doesn't
it works only when I do this: value != 4;
only for one number
if i put two numbers there the filter doesn't work

function numsnotneeded(value) {

    return (value != 4 || value != 9);
}

var filtered = [9,9,111,2,3,4,4,5,7].filter(numsnotneeded);

console.log(filtered);
Rory Smith
@alanbuchanan
Sep 05 2015 13:40
@soumyaRauth here is a clue. try this in place of your current function:
$("#start").click(function(){

  var inter = setInterval(function(){

    $('#clock').html( parseInt($('#clock').html()) - 1 );
  }, 1000);

});
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 13:41
maybe it's not possible to do this wth a return statement
oh wait...should be &&
haha
raykoff
@raykoff
Sep 05 2015 13:47
i am stuck on bonfire Where art thou anyone willing to help?
Rory Smith
@alanbuchanan
Sep 05 2015 13:47
@raykoff what have you got so far?
raykoff
@raykoff
Sep 05 2015 13:48
@alanbuchanan
function where(collection, source) {

 var arr = [];

 for(var i = 0; i < collection.length; i++){

     if(collection[i].hasOwnProperty(Object.keys(source) )){
        var thisObject = collection[i];
        for (var key in thisObject) {
          if (thisObject[key] == source[key]){
              arr.push(thisObject);
          }
      }
     }
 }
 return arr;
}
where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });
Rory Smith
@alanbuchanan
Sep 05 2015 13:49
@raykoff i'll have a look
raykoff
@raykoff
Sep 05 2015 13:51
@alanbuchanan it fails at the last 2 tests i don't know why
Rabin Shrestha
@jyapujuju
Sep 05 2015 13:55
This message was deleted
can' t find ; missing
kaushalmathpal
@kaushalmathpal
Sep 05 2015 14:02
hello..new to free code camp ...just took off with the 800 hours course
need help

<style>
.red-text {
color: red;
}
.font-size {
size: 16px;
}
</style>

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

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

in this m not able to turn the font size of p element 16 px
Rory Smith
@alanbuchanan
Sep 05 2015 14:04
@raykoff no idea i'm afraid. that one is exceptionally tricky. i looked at it in dev tools and it's simple skipping over the objects it shouldn't but it's hard to figure out why. i worked it out in a slightly different way using Object.keys(source).every()
and a lot of googling
Moisés Man
@moigithub
Sep 05 2015 14:04
@raykoff Object.keys(source) return an array
.hasOwnProperty( <-- requires only 1 string
raykoff
@raykoff
Sep 05 2015 14:05
@moigithub but it works
@alanbuchanan ok thanks ill se what i can improve
CamperBot
@camperbot
Sep 05 2015 14:06
raykoff sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 244 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Rory Smith
@alanbuchanan
Sep 05 2015 14:07
@raykoff it's passing the ones that only require one property i think
Moisés Man
@moigithub
Sep 05 2015 14:08
@raykoff
o={a:1,b:2,c:3}
Object {a: 1, b: 2, c: 3}
o.hasOwnProperty(['a'])
true
o.hasOwnProperty(['a','b'])
false
Yazed Jamal
@muyaszed
Sep 05 2015 14:09
hi, anyone can help me on the random quote app? Is this a backend thing? I really dunnow how to start.
anknits
@anknits
Sep 05 2015 14:14
@muyaszed gather a few quotes, put them in an array or something. generate a random number in the range of the number of quotes and output corresponding quote.
Yazed Jamal
@muyaszed
Sep 05 2015 14:15
@anknits ok that i understand, but how to use the api , i'm lost
Emanuele Antonelli
@Em-Ant
Sep 05 2015 14:17
@muyaszed with forismatic ?
Yazed Jamal
@muyaszed
Sep 05 2015 14:17
@Em-Ant yup
Moisés Man
@moigithub
Sep 05 2015 14:17
Yazed Jamal
@muyaszed
Sep 05 2015 14:18
@moigithub Thanks, I will give a read.
CamperBot
@camperbot
Sep 05 2015 14:18
muyaszed sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 303 | @moigithub | http://www.freecodecamp.com/moigithub
Emanuele Antonelli
@Em-Ant
Sep 05 2015 14:18
@muyaszed you have to use JSONP and the query callback parameter mut be named jsonp instead of the default callback
Yazed Jamal
@muyaszed
Sep 05 2015 14:19
@Em-Ant thanks, I will check on JASONP to.
CamperBot
@camperbot
Sep 05 2015 14:19
muyaszed sends brownie points to @em-ant :sparkles: :thumbsup: :sparkles:
:star: 307 | @em-ant | http://www.freecodecamp.com/em-ant
Emanuele Antonelli
@Em-Ant
Sep 05 2015 14:20
@muyaszed http://codepen.io/dting/pen/PqrZgb here is a very good example from another camper ( thanks @dting )
CamperBot
@camperbot
Sep 05 2015 14:20
em-ant sends brownie points to @muyaszed and @dting :sparkles: :thumbsup: :sparkles:
:star: 179 | @muyaszed | http://www.freecodecamp.com/muyaszed
:star: 1027 | @dting | http://www.freecodecamp.com/dting
Valon Haliti
@valonhaliti
Sep 05 2015 14:24
function destroyer(arr) {
  function isEqual (value, index, array) {
    if (value != arguments[1] && value != arguments[2]) {
      return true;
    }
    else {
      return false;
    }
  }
  var result = arr.filter(isEqual);
  return result;
}
at Bonfire: Seek and Destroy
what am I doing wrong, or am I completely wrong?
Moisés Man
@moigithub
Sep 05 2015 14:28
bf destroy
CamperBot
@camperbot
Sep 05 2015 14:28
Sorry, can't find a bonfire called destroyer. [ Check the map? ]
Moisés Man
@moigithub
Sep 05 2015 14:28
bf destroy
CamperBot
@camperbot
Sep 05 2015 14:28

:fire:Bonfire: Seek and Destroy :link:

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

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

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

more info:  bf details | bf links | hint

Moisés Man
@moigithub
Sep 05 2015 14:29
This message was deleted
Yazed Jamal
@muyaszed
Sep 05 2015 14:29
@valonfhaliti , I think u are not filtering the right array
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 14:38
I need to filter out whatever is in the resulting array. How can I do that? The resulting array could have one or more elements:
This is where I'm a bit stuck.
Yazed Jamal
@muyaszed
Sep 05 2015 14:39
you need to iterate
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 14:40
just go through the array and if it's those numbers remove them?
there isn't an easier way?
Yazed Jamal
@muyaszed
Sep 05 2015 14:45
the filter method could do it for you
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 14:45
well...that's what I'm trying to use...
but I'm not sure how to filter out the elements of an array
I get an array of the elements that I want to filter out of the other array
but....how to use filter to do that.
I can't see how
Emanuele Antonelli
@Em-Ant
Sep 05 2015 14:46
@valonfhaliti @TheHighPriestess the number of optional arguments is not fixed
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 14:47
I just don't seem to be finding any good examples
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 14:49
Yeah...I saw that. However, I'm still confused.
It's what needs to go inside the function that's stumping me
Emanuele Antonelli
@Em-Ant
Sep 05 2015 14:50
you have to pass to filter a function that takes an itemargument, and return true for the items you want to keep, or false if you want to remove them ...
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 14:51
yes...but what if the items are in an array?
Emanuele Antonelli
@Em-Ant
Sep 05 2015 14:52
var a = [1,2,3];
var b = a.filter(function(elem){
  if(elem === 2) return true;
  return false;
}

console.log(b);

// b =[ 2];
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 14:53
what about remove all elements of one array...from another?
that's what I'm trying to do.
..and you don't know how many elements will be in the array...
Emanuele Antonelli
@Em-Ant
Sep 05 2015 14:54
filter one array forEach element of the other
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 14:55
ok...let's say that this is one array: [9,9,111,2,3,4,4,5,7]
Moisés Man
@moigithub
Sep 05 2015 14:55
@valonfhaliti ok i think.. ur problem is u using arguments object inside ur filter function...
each function have its own copy of arguments object
and that points to whatever values it passed
Emanuele Antonelli
@Em-Ant
Sep 05 2015 14:55
the example would work for an array of unknown length, it would return an array of [2]
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 14:55
and I have this array: [9.4];
how to remove all 9s and 4s from the first array?
but you can't use "9" and "4" because each array will be different
Emanuele Antonelli
@Em-Ant
Sep 05 2015 14:56
forEach element of one array filter the other one
Moisés Man
@moigithub
Sep 05 2015 14:56

@valonfhaliti
so if u have somethink like this

function fun1 (a,b){
    console.log(arguments);
   //
   function fun2(x,y){
          console.log(arguments);
   }
}

it will log differents values
a solution is store arguments data in an array outside, then use that new array variable on ur filter callback
var arrcheck = [arguments[1] , arguments[2]];
or
var arrcheck = [].slice.call(arguments,1);
and use arrcheck variable inside ur filter callback function

Abhisek Pattnaik
@abhisekp
Sep 05 2015 14:58
Weird binding behaviour. Need explanation. http://repl.it/BFoH/3 L42
Help.
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 14:58
I think I must be doing it wrong....it's a Bonfire and it doesn't offer forEach as a hint
"Compare two arrays and return a new array with any items not found in both of the original arrays."
Emanuele Antonelli
@Em-Ant
Sep 05 2015 14:59
@TheHighPriestess you can loop over the second array inside the filter function ...
i've solved it and it works.
Elizabeth Hatleli
@TheHighPriestess
Sep 05 2015 15:00
you're a genius
loop over the second array and do what?
David
@dancingludicolo
Sep 05 2015 15:19
This message was deleted
Abhisek Pattnaik
@abhisekp
Sep 05 2015 15:22
someone pls help me !! :point_up: September 5, 2015 8:28 PM
Rory Smith
@alanbuchanan
Sep 05 2015 15:24
@abhisekp are you familiar with this video http://www.youtube.com/watch?v=PMfcsYzj-9M
there may be parts that help
Abhisek Pattnaik
@abhisekp
Sep 05 2015 15:25
@alanbuchanan ok. I'll watch it. But can't rt. now. But i need the answer rt. nw. Could you explain it in text and imgs?
Rory Smith
@alanbuchanan
Sep 05 2015 15:26
@abhisekp sorry, i can't, you probably know more about it than me
Abhisek Pattnaik
@abhisekp
Sep 05 2015 15:27
:(
nihara-thomas
@nihara-thomas
Sep 05 2015 15:48
Newbie question - I'm on the jQuery Waypoints and added $("button").addClass("animated bounce"); as the tutorial suggested
I'm curious as to where the animated and bounce classes are defined
is there a style sheet somewhere? or are these jQuery classes?
Alex
@wishe
Sep 05 2015 15:55
Is the map in the recommended order for the exercises?
Aniruddh Agarwal
@anrddh
Sep 05 2015 15:56
@wishe Yep
Alex
@wishe
Sep 05 2015 15:57
So after ive done the Basic Algorithm bonfires i should be able to complete the ziplines below?
Abhisek Pattnaik
@abhisekp
Sep 05 2015 16:00
@awesomeaniruddh benmcmohan100 was proposing to move the OOP & FP challenges before basic bfs.
Aniruddh Agarwal
@anrddh
Sep 05 2015 16:01
nah nah nah
OOP is too mind-bending
Abhisek Pattnaik
@abhisekp
Sep 05 2015 16:01
@awesomeaniruddh but I think he will move FP before basics
Alex
@wishe
Sep 05 2015 16:01
So much to go through before i can get to the fun stuff with frameworks hehe
Abhisek Pattnaik
@abhisekp
Sep 05 2015 16:01
@wishe bonfires are fun too. :)
Alex
@wishe
Sep 05 2015 16:04
Im trying to learn js so i can start using node and some frontend frameworks, i have mostly only worked with php before but non real time apps is kind of getting old
Terry
@tmosoff
Sep 05 2015 16:06
anyone know how to link to a codepen project in chat? id like some feedback on my portfolio
Aniruddh Agarwal
@anrddh
Sep 05 2015 16:10
just pop the link right in @tmosoff
Gitter will take care of everything else
Indranil Maji
@indranilphp
Sep 05 2015 16:12
bonfire Return Largest Numbers in Arrays
Abhisek Pattnaik
@abhisekp
Sep 05 2015 16:12
@wishe you can make real-time apps using PHP too, I guess. But it's not scalable to a large number of clients due to the very architecture of PHP.
CamperBot
@camperbot
Sep 05 2015 16:12

:fire:Bonfire: Return Largest Numbers in Arrays :link:

function largestOfFour(arr) {
  // You can do this!
  return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays.

more info:  bf details | bf links | hint

Indranil Maji
@indranilphp
Sep 05 2015 16:12
hint
CamperBot
@camperbot
Sep 05 2015 16:12
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Indranil Maji
@indranilphp
Sep 05 2015 16:12
bf links
CamperBot
@camperbot
Sep 05 2015 16:12
Alex
@wishe
Sep 05 2015 16:14
@abhisekp You can use websockets and stuff sure, but its not the same
Terry
@tmosoff
Sep 05 2015 16:17
what do you guys think http://codepen.io/tmosoff/pen/gaORdX/
thanks @awesomeaniruddh
CamperBot
@camperbot
Sep 05 2015 16:18
tmosoff sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 363 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Aniruddh Agarwal
@anrddh
Sep 05 2015 16:19
Looks pretty good!
Terry
@tmosoff
Sep 05 2015 16:21
thanks @awesomeaniruddh. 95% of it is bootstrap. the freecodecamp portfolio button i created myself. the link doesnt work though :-/
CamperBot
@camperbot
Sep 05 2015 16:21
tmosoff sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:warning: tmosoff already gave awesomeaniruddh points
Oleg-docent
@Oleg-docent
Sep 05 2015 16:22
@alanbuchanan sorry, i I missed your message about Check for palindromes (
Craig Morrison
@frogmorton
Sep 05 2015 16:49
@tmosoff so far so good, how about mine? http://codepen.io/frogmorton/pen/PPoGeL
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 16:49
can anyone help me with Bonfire: Chunky Monkey?
CamperBot
@camperbot
Sep 05 2015 16:49
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Justin Crawford
@JCrawford1122
Sep 05 2015 16:50
@tmosoff @frogmorton Both are looking good
Heres what I got so far. I'm going to take a break on it until I complete a few projects to add to it. http://codepen.io/JCrawford1122/full/QjWbOv
Craig Morrison
@frogmorton
Sep 05 2015 16:51
@JCrawford1122 Thanks man...but I have a question. My internal anchor tags don't all go all the way to the top when the navbar is clicked...
CamperBot
@camperbot
Sep 05 2015 16:51
frogmorton sends brownie points to @jcrawford1122 :sparkles: :thumbsup: :sparkles:
:star: 180 | @jcrawford1122 | http://www.freecodecamp.com/jcrawford1122
Justin Crawford
@JCrawford1122
Sep 05 2015 16:52
@frog I put my anchors right above the div for the section I was linking to
Craig Morrison
@frogmorton
Sep 05 2015 16:52
@JCrawford1122 yours work perfectly
oh, I see.... I'll take a look
Justin Crawford
@JCrawford1122
Sep 05 2015 16:53
<a name="home-anchor"></a>
        <div class="container-fluid" id="home-section">
Craig Morrison
@frogmorton
Sep 05 2015 16:54
gotcha
i've been killing myself trying to figure that simple thing out... when I previously had been focused on nothing but js bonfires
i didn't anticipate html / bootstrap issues to be so maddening...LOL
Justin Crawford
@JCrawford1122
Sep 05 2015 16:57
I hear ya. I still have a few issues to work out, like some positioning on smaller screens. But I think its good enough for now. I'm not going to submit it until I get those first for ziplines done and can add them to the portfolio.
Yours looks really clean though. I like that.
Craig Morrison
@frogmorton
Sep 05 2015 16:59
I like many aspects of yours as well. I did find a typo or 2.... need a fresh pair of eyes?
Thanks again, @JCrawford1122
CamperBot
@camperbot
Sep 05 2015 16:59
frogmorton sends brownie points to @jcrawford1122 :sparkles: :thumbsup: :sparkles:
:warning: frogmorton already gave jcrawford1122 points
Justin Crawford
@JCrawford1122
Sep 05 2015 16:59
Sure. I'm always open for feedback
Craig Morrison
@frogmorton
Sep 05 2015 17:00
curriculum rather than carriculum in the About section
how'd you manage the little FCC flame graphic in the in-line text?
LKian
@LKian
Sep 05 2015 17:01
bonfire
CamperBot
@camperbot
Sep 05 2015 17:01
we're talking about bonfire :fire: Bonfire: Return Largest Numbers in Arrays
Justin Crawford
@JCrawford1122
Sep 05 2015 17:01
@frogmorton Thanks. I'll show you about the flame graphic. 1 sec
CamperBot
@camperbot
Sep 05 2015 17:01
jcrawford1122 sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:star: 273 | @frogmorton | http://www.freecodecamp.com/frogmorton
Justin Crawford
@JCrawford1122
Sep 05 2015 17:02
you know how to use font awesome?
Craig Morrison
@frogmorton
Sep 05 2015 17:02
yes, I used it for my navbar icons
and for the social media ones at the bottom of the page
Justin Crawford
@JCrawford1122
Sep 05 2015 17:03
the flame is this <i class="fa fa-fire"></i>
Craig Morrison
@frogmorton
Sep 05 2015 17:03
but i didn't notice any free code camp one... oh, i didn't think to look up fire or flame
Justin Crawford
@JCrawford1122
Sep 05 2015 17:03
Its not really the codecamp logo
I just thought it was close enough
Craig Morrison
@frogmorton
Sep 05 2015 17:04
great little hack there
ha ha
you fooled me
Justin Crawford
@JCrawford1122
Sep 05 2015 17:05
Have you done any of the other ziplines yet?
Craig Morrison
@frogmorton
Sep 05 2015 17:06
not yet, I guess I've let this get in my way...
they look to be more involved in the backend of things, via apis, js, etc.
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 17:09
Bonfire: Chunky Monkey --- anyone can help me out? my code is not working
CamperBot
@camperbot
Sep 05 2015 17:09
Sorry, can't find a bonfire called chunky monkey --- anyone can help me out my code is not working. [ Check the map? ]
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 17:09
function chunk(arr, size) {
  // Break it up.
  var fArr = [];
  var fm = [];
  var divArr = arr.length/size;
  var diA = 0;
  var counter = 1;
  var nm = [];

  for(var i=diA;i<=divArr-1;i++){

    if(counter === divArr){
      diA += divArr;
      counter = 1;
      nm.push(arr[i]);
      fArr.push(nm);

    }  else {
      nm.push(arr[i]);
      fArr.push(nm);
    }
      counter++;
    // 
  }

  return fArr;
}

chunk(['a', 'b', 'c', 'd'], 2);
Craig Morrison
@frogmorton
Sep 05 2015 17:09
@JCrawford1122 how about you?
@kwesifokuo There's a very easy way to get "chunks" to be returned as new arrays
Justin Crawford
@JCrawford1122
Sep 05 2015 17:12
@frogmorton No I haven't. I guess they leave it up to us to figure out api's and that stuff
@frogmorton I don't remember any challenges that covered that
Craig Morrison
@frogmorton
Sep 05 2015 17:12
yes, it's part of that whole Research part
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 17:12
@frogmorton I'm kinda stuck
any hint
?
Justin Crawford
@JCrawford1122
Sep 05 2015 17:13
That's cool. I guess that is a good way to learn. By figuring it out yourself.
Craig Morrison
@frogmorton
Sep 05 2015 17:13
@kwesifokuo let me let you explore a particular method
array.slice()
do you know what it returns?
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 17:14
@frogmorton that returns a part of the array
Craig Morrison
@frogmorton
Sep 05 2015 17:14
@JCrawford1122 yes, I generally agree.
@kwesifokuo yes, and isn't that what you want?
LKian
@LKian
Sep 05 2015 17:15
bonfire question. anyone looking for a partner? and did anyone else feel like the level of difficulty was steep when starting the bonfire?
CamperBot
@camperbot
Sep 05 2015 17:15
Sorry, can't find a bonfire called question anyone looking for a partner and did anyone else feel like the level of difficulty was steep when starting the bonfire. [ Check the map? ]
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 17:16
@frogmorton I will test that
Craig Morrison
@frogmorton
Sep 05 2015 17:17
i highly recommend doing that
Justin Crawford
@JCrawford1122
Sep 05 2015 17:17
@kahwasaurus They were really hard for me
Craig Morrison
@frogmorton
Sep 05 2015 17:17
but I must go to bed now, let me know if you figure it out.
Ernest O. Fokuo
@kwesifokuo
Sep 05 2015 17:17
@frogmorton sure. thank you
CamperBot
@camperbot
Sep 05 2015 17:17
kwesifokuo sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:star: 274 | @frogmorton | http://www.freecodecamp.com/frogmorton
LKian
@LKian
Sep 05 2015 17:17
@JCrawford1122 thanks. was wondering if it was just me..
Justin Crawford
@JCrawford1122
Sep 05 2015 17:18
@frogmorton Later man, Thanks for reviewing my portfolio
CamperBot
@camperbot
Sep 05 2015 17:18
jcrawford1122 sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:warning: jcrawford1122 already gave frogmorton points
Craig Morrison
@frogmorton
Sep 05 2015 17:18
@kahwasaurus At first, i felt that, but as I did more bonfires, I felt that I could start to "think" in Javascript and actually start to come up with solutions on my own
LKian
@LKian
Sep 05 2015 17:19
so you didn't use a partner?
Craig Morrison
@frogmorton
Sep 05 2015 17:19
@JCrawford1122 no problem... likewise
@kahwasaurus that's not what I meant.
LKian
@LKian
Sep 05 2015 17:19
just curious
Justin Crawford
@JCrawford1122
Sep 05 2015 17:19
@kahwasaurus One thing I can recommend that helped me was to break the task down into small steps. And make use of console.log() to see what your code is doing
Craig Morrison
@frogmorton
Sep 05 2015 17:20
I have pair programmed with various people, some good at it, some not so good, but i mean, at first I didn't know the toolbox well enough to start using the tools of the language very well
console.log is your friend... indeed.
also, I NEVER code the bonfires directly into the FCC site. I always use https://repl.it/
and paste the solution into FCC after it's working the way I want it to
the exception to that rule is if I want to see what some of the tests that are failing are..
Arnav Kumar
@Arnavk05
Sep 05 2015 17:24
Need help with bonfire: where art thou
CamperBot
@camperbot
Sep 05 2015 17:24
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Arnav Kumar
@Arnavk05
Sep 05 2015 17:24
Need help with bonfire: where art thou
CamperBot
@camperbot
Sep 05 2015 17:24
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Craig Morrison
@frogmorton
Sep 05 2015 17:25
At any rate... catch you all later @kahwasaurus @JCrawford1122 @kwesifokuo sleep calls..
Terry
@tmosoff
Sep 05 2015 17:27
@frogmorton @JCrawford1122 very cool stuff guys, not bad at all
Craig Morrison
@frogmorton
Sep 05 2015 17:28
@tmosoff Thanks. Much appreciated.
CamperBot
@camperbot
Sep 05 2015 17:28
frogmorton sends brownie points to @tmosoff :sparkles: :thumbsup: :sparkles:
:star: 229 | @tmosoff | http://www.freecodecamp.com/tmosoff
anknits
@anknits
Sep 05 2015 17:42
Bonfire: Friendly Date Ranges
CamperBot
@camperbot
Sep 05 2015 17:42

:fire:Bonfire: Friendly Date Ranges :link:

function friendly(str) {
  return str;
}

friendly(['2015-07-01', '2015-07-04']);

Implement a way of converting two dates into a more friendly date range that could be presented to a user.

more info:  bf details | bf links | hint

anknits
@anknits
Sep 05 2015 17:42
hint
CamperBot
@camperbot
Sep 05 2015 17:42
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
bimbo1991
@bimbo1991
Sep 05 2015 17:59
Bonfire: Seek and Destroy
CamperBot
@camperbot
Sep 05 2015 17:59

:fire:Bonfire: Seek and Destroy :link:

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

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

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

more info:  bf details | bf links | hint

bimbo1991
@bimbo1991
Sep 05 2015 18:00
hint
CamperBot
@camperbot
Sep 05 2015 18:00
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Macrosight
@macrosight
Sep 05 2015 18:00
Bonfire:Factorialize a Number
Bonfire: Factorialize a Number
CamperBot
@camperbot
Sep 05 2015 18:00

:fire:Bonfire: Factorialize a Number :link:

function factorialize(num) {
  return num;
}

factorialize(5);

Return the factorial of the provided integer.

more info:  bf details | bf links | hint

meaning42
@meening42
Sep 05 2015 18:23
function isBigEnough(value) {
  return value >= 10;
}
var filtered = [12, 5, 8, 130, 44].filter(isBigEnough);
// filtered is [12, 130, 44]
I would like to use function for filter but with difrent treshold. For example number 10 could be changed with something else. How is this posible?
Austin Lin
@austinylin
Sep 05 2015 18:27
@meening42 here is another way to write that expression that I think will solve your problem:
var checkNum = 10;
var filtered = [12, 5, 8, 130, 44].filter(function (v) { return v >= checkNum; })
Or if you want to use the fancier arrow function syntax (no supported everywhere):
var checkNum = 10;
var filtered = [12, 5, 8, 130, 44].filter(v =>  v >= checkNum; )
meaning42
@meening42
Sep 05 2015 18:29
@austinylin thanks
CamperBot
@camperbot
Sep 05 2015 18:29
meening42 sends brownie points to @austinylin :sparkles: :thumbsup: :sparkles:
:star: 51 | @austinylin | http://www.freecodecamp.com/austinylin
Austin Lin
@austinylin
Sep 05 2015 18:31
@meening42 if you want to preserve the isBigEnough function on its own you could also do this:
function isBigEnough(value, checkNum) {
  return value >= checkNum;
}
var checkNum  = 10;
var filtered = [12, 5, 8, 130, 44].filter(v => isBigEnough(v, checkNum));
//or without the arrow function syntax:
var filtered = [12, 5, 8, 130, 44].filter(function(v) { return isBigEnough(v, checkNum);});
meaning42
@meening42
Sep 05 2015 18:34
Yes, this one i like more :+1: @austinylin
meaning42
@meening42
Sep 05 2015 18:52
@austinylin What does function(v) mean?
Austin Lin
@austinylin
Sep 05 2015 18:53
@meening42 its an anonymous function: https://en.wikibooks.org/wiki/JavaScript/Anonymous_Functions
Basically Array.filter() expects to receive a callback function as its only paramater. You can either pass a function name which it will call for each element of the array, or pass an anonymous function directly inline. This pattern is super common for event callbacks on websites.
meaning42
@meening42
Sep 05 2015 18:55
tnx @austinylin
CamperBot
@camperbot
Sep 05 2015 18:55
meening42 sends brownie points to @austinylin :sparkles: :thumbsup: :sparkles:
:warning: meening42 already gave austinylin points
meaning42
@meening42
Sep 05 2015 19:03
I am working on Bonfire: Diff Two Arrays
Do I have to use all these sugested functions? Is the code bad if i use two for loops and check for every number if it is in another arrray and than use .concat() to make new array?
Array.slice()
Array.filter()
Array.indexOf()
Array.concat()
Absalon Castañon Avila
@absalnC
Sep 05 2015 19:03
any one else had troubles with how-to-npm? I can't make it work
bf Diff Two Arrays
CamperBot
@camperbot
Sep 05 2015 19:04

: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

Absalon Castañon Avila
@absalnC
Sep 05 2015 19:05
@meening42 I think the purpose of the exercise is for you to learn how to use those functions
@meening42 But can solve it as you want
please! help with how-to-npm
Jake Bryant
@jbryant8706
Sep 05 2015 19:12
function palindrome(str){
  return str.repleace("Jake")/([a-z0-9])+w/g;

}
How do I define it?
Ian Wang
@ianw3214
Sep 05 2015 19:13
bonfire no repeats please
CamperBot
@camperbot
Sep 05 2015 19:13

:fire:Bonfire: No repeats please :link:

function permAlone(str) {
  return str;
}

permAlone('aab');

Return the number of total permutations of the provided string that don't have repeated consecutive letters.

more info:  bf details | bf links | hint

Ian Wang
@ianw3214
Sep 05 2015 19:13
hint
CamperBot
@camperbot
Sep 05 2015 19:13
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Aleksandar B.
@aleksandar-b
Sep 05 2015 19:21
wiki js resource
Brian
@bwobst
Sep 05 2015 19:22
Working on the Twitch.tv API zipline - does anyone know how to do multiple $.ajax calls in a for loop?
Aleksandar B.
@aleksandar-b
Sep 05 2015 19:26
@bwobst just put another ajax call within your ajax callback function
Brian
@bwobst
Sep 05 2015 19:27
@samosale that's an option, but I was hoping to do something more scalable than that
Aleksandar B.
@aleksandar-b
Sep 05 2015 19:30
@bwobst what do you mean by that? You could call two Ajax in parallel, but that way they won't have access to another one's data(it depends on which finishes first and that is arbitrary). Just nest them in each one.
see my code:
Hans van Riet
@hansinla
Sep 05 2015 19:31
@bwobst You don’t need multiple calls for this zipline.
@hansinla how is that?
Brandon Long
@BJLong
Sep 05 2015 19:39
Hi guys quick question for bonfire palindrome. I cannot seem to get it right. Is there something I am missing?
function palindrome(str) {
  strLower = str.toLowerCase();
  strLettersOnly = strLower.replace(/[^\w]\s/gi,"");
  str_array = strLettersOnly.split("");
  reversed = str_array.reverse();
  strReverse = str_array.join("");
  if(strReverse === str){
    return true;
  } else {
    return false;
  }
}
CamperBot
@camperbot
Sep 05 2015 19:39
:bulb: to format code use backticks! ``` more info
Hans van Riet
@hansinla
Sep 05 2015 19:39
@samosale One call gives you all the data you need. What would be the second concurrent call be for?
Aleksandar B.
@aleksandar-b
Sep 05 2015 19:40
@hansinla for logo
$.get('https://api.twitch.tv/kraken/streams/'+user +'', function (data) {

    $.get('https://api.twitch.tv/kraken/users/'+user +'', function (da) {

      if(!da.logo ){

  da.logo = 'https://static-cdn.jtvnw.net/jtv_user_pictures/twitch-profile_image-94a42b3a13c31c02-300x300.jpeg'
}


if(data.hasOwnProperty('stream') && data.stream === null){
    stream ='<div class="off">Offline</div>';


  $('.content').append('<div class= "col-xl-12 bck" ><img class="img1 img-circle" src="'+da.logo+'" /><a href="'+url + user +'">'+user + '</a> '+ '<div>' + stream + '</div></div>');

  }


  }, 'JSONP');
}, 'JSONP');
    });

  }
Hans van Riet
@hansinla
Sep 05 2015 19:41
@BJLong You’re comparing the original string str with a reversed string that was converted to lowercase and had characters removed. That will only sometimes be a match (in cases where the original string didn’t ahve spaces or punctuation).
Brian
@bwobst
Sep 05 2015 19:41
@hansinla to pull the stream details for each of the users in the array
Ditri Ahmetaj
@DitriAhmetaj
Sep 05 2015 19:41
guys what's wrong with my code even though it seems more of a bug

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

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

h2 {
font-family: Lobster, Monospace;
}

.smaller-image {
width: 100px;
}

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


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



</style>

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

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

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

the challenge doesnt accept two classes in the img element
Brandon Long
@BJLong
Sep 05 2015 19:41
Oh my, I new it was something dumb haha:) thanks @hansinla !!
CamperBot
@camperbot
Sep 05 2015 19:41
bjlong sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 341 | @hansinla | http://www.freecodecamp.com/hansinla
Terry
@tmosoff
Sep 05 2015 19:42
$('.button').click(function(){
   var y = ["string1", "string 2", "string3", "string4", "string5", "string6", "string7"];  

  var x = Math.floor(Math.random() * 6);
      alert(y[x]);  
});
can you put an array inside a jquery function like this?
Coira Ellison
@Coira
Sep 05 2015 19:42
@DitriAhmetaj put classes in one string, e.g. class="smaller-image thick-green-border"
Ditri Ahmetaj
@DitriAhmetaj
Sep 05 2015 19:42
I did no ?
see img has two classes together
Coira Ellison
@Coira
Sep 05 2015 19:43
i see this img class="smaller-image" class="thick-green-border"
Ditri Ahmetaj
@DitriAhmetaj
Sep 05 2015 19:43
oh like that !
got it !
Hans van Riet
@hansinla
Sep 05 2015 19:43
@samosale You’re absolute right. I just looked at my code and because the endpoint is different for the logo, that needs to be a separate call. Thanks.
CamperBot
@camperbot
Sep 05 2015 19:43
hansinla sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 256 | @samosale | http://www.freecodecamp.com/samosale
Coira Ellison
@Coira
Sep 05 2015 19:43
yep :)
Ditri Ahmetaj
@DitriAhmetaj
Sep 05 2015 19:43
thanks a lot, I even knew it before ! forgot such a detail !!
CamperBot
@camperbot
Sep 05 2015 19:43
if you want to thank someone, put an @ before their name!
Ditri Ahmetaj
@DitriAhmetaj
Sep 05 2015 19:43
@Coira :+1:
AEA2002
@AEA2002
Sep 05 2015 19:44
Hello FreeCodeCampWorld!
CamperBot
@camperbot
Sep 05 2015 19:44

welcome to FreeCodeCamp @AEA2002!

Ditri Ahmetaj
@DitriAhmetaj
Sep 05 2015 19:44
@Coira :sparkles: :+1: :sparkles:
AEA2002
@AEA2002
Sep 05 2015 19:45
been working on the FCC challenges, but new to chat
Sunny095
@Sunny095
Sep 05 2015 19:46
is there anything wrong with this? <script> $(document).ready(funciton() { }); </script>
Hans van Riet
@hansinla
Sep 05 2015 19:47
@Sunny095 function is misspelled.
Sunny095
@Sunny095
Sep 05 2015 19:47
still not working
Terry
@tmosoff
Sep 05 2015 19:48
$('.button').click(function(){
   var y = ["string1", "string 2", "string3", "string4", "string5", "string6", "string7"];  

  var x = Math.floor(Math.random() * 6);
      alert(y[x]);  
});
im trying to access the array when the button is clicked. it is not working. can you put an array inside a jquery function like this?
Aleksandar B.
@aleksandar-b
Sep 05 2015 19:49
@tmosoff wait...
Hans van Riet
@hansinla
Sep 05 2015 19:49
@Sunny095 Did you load jQuery?
AEA2002
@AEA2002
Sep 05 2015 19:50
@camperbot (or anyone) is there a chat room for contributing to github?
Terry
@tmosoff
Sep 05 2015 19:51
i got it @samosale . i forgot to add jquery to my pen lol
Aleksandar B.
@aleksandar-b
Sep 05 2015 19:51
ok
Terry
@tmosoff
Sep 05 2015 19:51
@hansinla your answer for sunny answered my question too lol
Hans van Riet
@hansinla
Sep 05 2015 19:52
@tmosoff great!
Terry
@tmosoff
Sep 05 2015 19:54
@hansinla my code was correct though. which is a plus :-)
thanks @hansinla
CamperBot
@camperbot
Sep 05 2015 19:55
tmosoff sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 342 | @hansinla | http://www.freecodecamp.com/hansinla
Erica
@Buzzlightyear90
Sep 05 2015 20:01
can someone help me solve a nodeschool problem it is the final exercise?
I don't know what it is even asking
AEA2002
@AEA2002
Sep 05 2015 20:03
If I want to update, correct, etc a FCC web page, how do I find where the web page is located in the GitHub repository? Can anyone give me a clue, a hint, or even know what I am chatting about?
angie2424
@angie2424
Sep 05 2015 20:10
does anyone know why the code i write isnt being saved in the in browser editor? even after hitting submit, when i go back to the same bonfire later, all the code i wrote is gone
its been like this for a couple of days and im ready to delete my account
Mateja Trifunovski
@Matko95
Sep 05 2015 20:11
@angiey24 if you go to the topright corner and on your profile, you can see your solutions
angie2424
@angie2424
Sep 05 2015 20:13
thanks @Matko95 i know about that, but for the Object Oriented and Functional Programming section, my code isnt being saved either
CamperBot
@camperbot
Sep 05 2015 20:13
angiey24 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 208 | @matko95 | http://www.freecodecamp.com/matko95
Jake Bryant
@jbryant8706
Sep 05 2015 20:14
function palindrome(str){
  return str.repleace("Jake")/([a-z0-9])+w/g;

}
How can I define it?
Mateja Trifunovski
@Matko95
Sep 05 2015 20:14
@jbryant8706 it should be str.replace
@jbryant8706 and you need to reverse it and check if it's same as str
Osazeme Usen
@osazemeu
Sep 05 2015 20:16
Am currently in Bonfire: Make a Person
I need help with my code. How do I set firstname and lastname?
var Person = function(firstAndLast) {
  this.fullName = firstAndLast
    return firstAndLast;
};

Person.prototype.getFirstName = function () {
  this.firstName = this.fullName.split(' ')[0];
  return this.firstName;
};

Person.prototype.getLastName = function () {
  this.lastName = this.fullName.split(' ')[1];
  return this.lastName;
};

Person.prototype.setFirstName = function (first) {

};

Person.prototype.setLastName = function (last) {

};

Person.prototype.setFullName = function (firstAndLast) {
this.fullName = firstAndLast;
};

Person.prototype.getFullName = function () {
  return this.fullName;
};

var bob = new Person('Bob Ross');
//bob.getFullName();
bob.getFirstName();
Justin Crawford
@JCrawford1122
Sep 05 2015 20:18
is normalize.css included in bootstrap.min.css?
Osazeme Usen
@osazemeu
Sep 05 2015 20:19
@JCrawford1122 a modified version is usually included
Legendzs
@Legendzs
Sep 05 2015 20:19
Bonfire: Where art thou Can anyone explain this bonfire to me?
CamperBot
@camperbot
Sep 05 2015 20:19
Sorry, can't find a bonfire called where art thou can anyone explain this bonfire to me . [ Check the map? ]
Mateja Trifunovski
@Matko95
Sep 05 2015 20:19
@osazemeu you can split the name using the .split function, then access the first element for first name, or second for last name
Justin Crawford
@JCrawford1122
Sep 05 2015 20:20
@osazemeu Thank you!
CamperBot
@camperbot
Sep 05 2015 20:20
jcrawford1122 sends brownie points to @osazemeu :sparkles: :thumbsup: :sparkles:
:star: 291 | @osazemeu | http://www.freecodecamp.com/osazemeu
your welcome
@Legendzs Make a function that looks through an array of objects (first argument) and returns an array of all objects that have matching property and value pairs (second argument).
@Legendzs you need a function which does matching based on arguments passed
Legendzs
@Legendzs
Sep 05 2015 20:22
so for the first example they have. It would return all the First names?
Osazeme Usen
@osazemeu
Sep 05 2015 20:22
This message was deleted
Legendzs
@Legendzs
Sep 05 2015 20:23
hmm ok @osazemeu Thanks. I'll see if I can figure it out.
CamperBot
@camperbot
Sep 05 2015 20:23
legendzs sends brownie points to @osazemeu :sparkles: :thumbsup: :sparkles:
:star: 292 | @osazemeu | http://www.freecodecamp.com/osazemeu
Legendzs
@Legendzs
Sep 05 2015 20:24
what exactly does the expected output look like exactly?
Osazeme Usen
@osazemeu
Sep 05 2015 20:28
@Legendzs check the responses you get at the bottom left. it usually guides your response. If you need more explanation, let me know
Legendzs
@Legendzs
Sep 05 2015 20:30
@osazemeu Unfortunately it doesn't make sense to me.