These are chat archives for FreeCodeCamp/Help

9th
Oct 2015
Nicolas DeMari
@ndemari
Oct 09 2015 00:00
oh ok, i'll try it
That worked
buggy
thank you!
CamperBot
@camperbot
Oct 09 2015 00:01
if you want to thank someone, put an @ before their name!
Rex Schrader
@SaintPeter
Oct 09 2015 00:01
@ndemari Maybe file an issue on the GitHub repo?
@ndemari IT's confusing.
ender410
@ender410
Oct 09 2015 00:02
hey everyone. Sorry to bother but I am super lost on Waypoint: Make Object Properties Private.
Rex Schrader
@SaintPeter
Oct 09 2015 00:03
@ender410 We have answers :D
ender410
@ender410
Oct 09 2015 00:03
I feel like it should be pretty simple, but I cannot even think of wher eto start.
Rex Schrader
@SaintPeter
Oct 09 2015 00:04
@ender410 ok, did you read the explanation? Do you know what makes a propery private vs. public?
ender410
@ender410
Oct 09 2015 00:05
@SaintPeter yes, I read the explanation. If I understood is the difference is the public is using the this.
@SaintPeter I believe.
@SaintPeter While the private is leaving the this. off
Rex Schrader
@SaintPeter
Oct 09 2015 00:07
@ender410 Well, private is using var
@ender410 So, you've got a public value, this.gears, right?
ender410
@ender410
Oct 09 2015 00:09
@SaintPeter I see that yes.
Rex Schrader
@SaintPeter
Oct 09 2015 00:10
@ender410 So you need to turn it into a private. Remove the this where it is given a value and replace that with a var. Then, any references to the variable cna have their this removed.
supasheva
@supasheva
Oct 09 2015 00:11
guys
i've got to be honest
having trouble with the local weather app
I know for starters I can use JSON
and convert that to html
but still
i am really tempted to just copy and paste the source code but i want to understand how to use this thing
and get it working
help?
CamperBot
@camperbot
Oct 09 2015 00:12

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

Basic Commands:

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

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

Bob Moree
@bmoree
Oct 09 2015 00:12
been struggling with bonfire Seek and Destroy all day, now even the solution in the Wiki isn't working..
Rex Schrader
@SaintPeter
Oct 09 2015 00:12
@supasheva okay
@supasheva You've been able to pull the data from the API?
Bob Moree
@bmoree
Oct 09 2015 00:12
function destroyer(arr) {
  var args = Array.prototype.slice.call(arguments);
  args.splice(0, 1);
  return arr.filter(function(element) {
    return args.indexOf(element) === -1;
  });
}
supasheva
@supasheva
Oct 09 2015 00:12
nope
ender410
@ender410
Oct 09 2015 00:13
@SaintPeter Thanks! yes, ok that seemed to work. Once I removed that I saw the last thing was making the getSpeed
CamperBot
@camperbot
Oct 09 2015 00:13
ender410 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 935 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 09 2015 00:13
@ender410 :D
ender410
@ender410
Oct 09 2015 00:13
@SaintPeter So I added the this. and that worked. Ok, I was just so confused on even where to start. Thank you again!
CamperBot
@camperbot
Oct 09 2015 00:13
ender410 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: ender410 already gave saintpeter points
Rex Schrader
@SaintPeter
Oct 09 2015 00:14
@supasheva What method are you using to pull your data? And whos API are you using?
@bmoree Lemme take a look
@bmoree I was able to pass it both with my own code and the "prefered solution"
@bmoree So it's just your system.
Bob Moree
@bmoree
Oct 09 2015 00:15
@SaintPeter hmm I'll try again
any good resources on callback functions? I don't really understand the concept.. :-(
ender410
@ender410
Oct 09 2015 00:45
I am really struggling with the Object Oriented and Functional Programming. On number 4 I cannot seem to figure out the whole "add property 'engines' to myCar
Garrett Schultz
@garettschultz
Oct 09 2015 00:48
@ender410 i was just on that one. Try this: myCar.engines = 1;
put it on line 7
ender410
@ender410
Oct 09 2015 00:49
@gratschultz2013 oh my goodness. Ok, I get it now. I was not calling the myCar. to associate the engines too. That was the whole thing I was completely not getting. That makes sense.
Thanks @gratschultz2013
CamperBot
@camperbot
Oct 09 2015 00:49
ender410 sends brownie points to @gratschultz2013 :sparkles: :thumbsup: :sparkles:
:star: 183 | @gratschultz2013 | http://www.freecodecamp.com/gratschultz2013
Garrett Schultz
@garettschultz
Oct 09 2015 00:50
no problem. I was confused on that one also, I kept thinking all i had to do was something like "engines": 1; or something like that.
ender410
@ender410
Oct 09 2015 00:51
haha. Yea. I was trying all kinds of function calls and variables. Didn't even click to add the myCar first.
Garrett Schultz
@garettschultz
Oct 09 2015 01:08
i find myself ALWAYS forgettting semi colons
Prashanth Chandra
@prashcr
Oct 09 2015 01:14
What's the right way to fix EPEERINVALID in npm 3?
Chris
@Shifthawke
Oct 09 2015 01:32
Alright guys. Time to weigh in. I have to get a new PC next month. Bear in mind, it must be good for gaming, easy for gaming. I don't want to wait four months for a game to be compatible on my system. Give me your first and second picks.
Joshua Gammage
@MrMagma
Oct 09 2015 01:37
Hello, this may be a stupid question, but in the zipline to build a random quote machine I decided I wanted to use the API the supplied to get random quotes (instead of making a list of my own). My problem is that whenever I send a request to the API an error appears in the console "...No 'Access-Control-Allow-Origin' header is present on the requested resource...". I know why this is occurring as I've done a little AJAX in the past, but I need to know how to fix it or some other method that will work. I'm using the jQuery ajax method to send a GET request to "http://api.forismatic.com/api/1.0/?method=getQuote&format=json&key&lang=en"
navicyclical
@navicyclical
Oct 09 2015 01:37
it's been a few days since I touched this -
```
function findLongestWord(str) {
  var stringOfWords = str.split(" ");
  var lengths = [];
  for(var i=0; stringOfWords<stringOfWords[i].length; i++){
    return lengths[i];
  }
}

findLongestWord("The quick brown fox jumped over the lazy dog");
max77p
@max77p
Oct 09 2015 01:38
hye guys what software are you all using to write code?
err..program
Peggy Wiltz
@PeggyWiltz
Oct 09 2015 01:39
Hi all. I've been working on the Show the Local Weather zipline and I keep having problems getting the api call to work. The location one works fine, but the weather one breaks with a 404 error.
function getWeather(location) {
  console.log("inside getWeather: " + location);

  var latLng = location.split(",");
  console.log("latlng: " + latLng);
  var weatherUrl = "api.openweathermap.org/data/2.5/weather?lat=" + latLng[0] + "&lon=" + latLng[1];
  console.log("weather url: " + weatherUrl);   

      $.get(weatherUrl, function(weather) {
        var temperature = weather.main.temp;
        console.log(weather);
    }, "jsonp");
};
Any idea what I'm doing wrong?
(btw, when I put the weatherUrl directly into browser window it works, returning json object.
Bob Moree
@bmoree
Oct 09 2015 01:43
Why doesn't this work
function diff(arr1, arr2) {
  var newArr = [];
  var largest = null;
  var smallest = null;

  if(arr1.length < arr2.length) {
    largest = arr2;
    smallest = arr1;
  } else {
    largest = arr1;
    smallest = arr2;
  }

  for(var i=0; i < largest.length; i++) {
    return largest.filter(function(element) {
      return smallest.indexOf(largest[i]) === -1;
    });
  }
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
max77p
@max77p
Oct 09 2015 01:44
guys could you tell me what program you are using to write adn run code in?
please
Bob Moree
@bmoree
Oct 09 2015 01:44
I keep getting ampty arrays
Peggy Wiltz
@PeggyWiltz
Oct 09 2015 01:44
@bmoree what result are you getting?
Bob Moree
@bmoree
Oct 09 2015 01:44
@max77p I use Brackets.io
@peggy mostly empty arrays
@PeggyWiltz D'oh ;-)
max77p
@max77p
Oct 09 2015 01:46
@bmoree is that the best one?
navicyclical
@navicyclical
Oct 09 2015 01:46
And I'm trying to run it but I'm missing something,
noobstar
@namsir
Oct 09 2015 01:47
@max77p try atom. i think it's lighter :)
Peggy Wiltz
@PeggyWiltz
Oct 09 2015 01:48
@bmoree and you would expect a result of "4"?
Bob Moree
@bmoree
Oct 09 2015 01:49
@max77p It depends on what you like/need, some people prefer full IDE's, to me, most of the time that feels like overkill
@PeggyWiltz yup
@PeggyWiltz I think it has something to do with the return statements, but that's just a hunch
Peggy Wiltz
@PeggyWiltz
Oct 09 2015 01:50
@bmoree yeah, me too. Still looking...
@bmoree because you have the return value in there, it returns and exits the function as soon as it hits that line. In other words, in the first iteration of the loop.
Peggy Wiltz
@PeggyWiltz
Oct 09 2015 01:55
@bmoree instead of returning in the loop, you need to add the filter value to a new array, then return it outside the loop.
@bmoree make sense?
Bob Moree
@bmoree
Oct 09 2015 01:56
@PeggyWiltz sort of, but I have no clue how to do it
Peggy Wiltz
@PeggyWiltz
Oct 09 2015 01:57
@bmoree Sorry it took me so long, the filter confuses me. Okay, hang on...
Edper
@edper
Oct 09 2015 01:57
function destroyer(arr) {
  // Remove all the values
  for(i=1;i<arguments.length;i++)
    {
      for(j=0;j<arr.length;j++)
        {
          if(arguments[i]==arr[j])
             arr.splice(j,j+1)
        }
    }
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3, "");
I was told to use array.filter() on the above problem but I solved it without using filter. Could somebody show me how you did it using filter()?
Peggy Wiltz
@PeggyWiltz
Oct 09 2015 01:59
@bmoree do you have to use filter?
function diff(arr1, arr2) {
  var newArr = [];
  var largest = null;
  var smallest = null;

  if(arr1.length < arr2.length) {
    largest = arr2;
    smallest = arr1;
  } else {
    largest = arr1;
    smallest = arr2;
  }
  console.log(largest);
  console.log(smallest);

  for(var i=0; i < largest.length; i++) {
    //console.log(i);
    if (smallest.indexOf(largest[i]) === -1) {
      newArr.push(largest[i]);
    };
  };
    return newArr;
}
Bob Moree
@bmoree
Oct 09 2015 02:01
@PeggyWiltz this way makes more sense to me too , with filter, would you store it in a variable and then outside the for loop return the var??
@PeggyWiltz your solution has some trouble too... try:
[1, "calf", 3, "piglet"], [1, "calf", 3, 4]
Peggy Wiltz
@PeggyWiltz
Oct 09 2015 02:05
@bmoree no, with filter you don't use the loop at all. The filter function you write will return the entire array, i.e. filter contains its own loop
Bob Moree
@bmoree
Oct 09 2015 02:06
@PeggyWiltz but without the loop I don't know how to check all members of the largest array..
Peggy Wiltz
@PeggyWiltz
Oct 09 2015 02:07
@bmoree true, but that's a different scenario (with two arrays the same size). That would require a different check - from both sides. With the loop we are only checking if one array has an item missing from the other, not the other way around. If you want to check that, you will need two loops I think.
@bmoree Working on the filter answer, not sure if it will work with the second scenario either...
Bob Moree
@bmoree
Oct 09 2015 02:10
@PeggyWiltz just noticed the same thing, fixed the filter solution though:
function diff(arr1, arr2) {
  var newArr = [];
  var largest = null;
  var smallest = null;

  if(arr1.length < arr2.length) {
    largest = arr2;
    smallest = arr1;
  } else {
    largest = arr1;
    smallest = arr2;
  }

  return largest.filter(function(element) {
    return smallest.indexOf(element) === -1;
  });
}
Peggy Wiltz
@PeggyWiltz
Oct 09 2015 02:13
@bmoree Yep, that's what I got too. Still does the same thing as the single loop with the second scenario though.
max77p
@max77p
Oct 09 2015 02:13
@bmoree hey after you got atom, how do you run the programs?
could you direct me to tutorial
i have text editor, but i totally forgot how to actually run the code
Peggy Wiltz
@PeggyWiltz
Oct 09 2015 02:15
@bmoree ```
Bob Moree
@bmoree
Oct 09 2015 02:15
@PeggyWiltz found a way:
function diff(arr1, arr2) {
  var newArr = [];
  var largest = null;
  var smallest = null;

  if(arr1.length < arr2.length) {
    largest = arr2;
    smallest = arr1;
  } else {
    largest = arr1;
    smallest = arr2;
  }
  if(largest.length !== smallest.length){
    return largest.filter(function(element) {
      return smallest.indexOf(element) === -1;
    });
  } else {
    newArr1 = largest.filter(function(element) {
      return smallest.indexOf(element) === -1;});
    newArr2 = smallest.filter(function(element) {
      return largest.indexOf(element) === -1;});
    return newArr1.concat(newArr2);
  }

}

diff([1, "calf", 3, "piglet"], [1, "calf", 3, 4]);
Peggy Wiltz
@PeggyWiltz
Oct 09 2015 02:17
@bmoree Good job, but a bit redundant. Could be refactored a bit.
Bob Moree
@bmoree
Oct 09 2015 02:17
@max77p it depends on what you're trying to do, some files (html for example) can be run in the browser, others in different environments (console eg.)
@PeggyWiltz I know, but I really have to get some sleep, it's 4AM here... ;-)
max77p
@max77p
Oct 09 2015 02:18
@bmoree i want to run java code
how would i do that?
Peggy Wiltz
@PeggyWiltz
Oct 09 2015 02:18
@bmoree lol I hear you. At least it works, that counts for a lot
Herman Fassett
@HermanFassett
Oct 09 2015 02:18
@max77p set environment variable so you can compile from cmd or use netbeans or something
navicyclical
@navicyclical
Oct 09 2015 02:18
I'm in the middle of reworking this
```
function findLongestWord(str) {
  var words = str.split(" ");
  var lengths = [];
  for(var i=0; i<words.length; i++){
    lengths[i] = words[i].length;
      if words[i] > length[i]{
      return maxNumber;
      }
     }
  }
}

findLongestWord("The quick brown fox jumped over the lazy dog");
I looked off a suggestion I got earlier this week, but how do I return the number?
Herman Fassett
@HermanFassett
Oct 09 2015 02:19
@max77p or use an online tool for simple code such as http://www.compilejava.net/ or https://ideone.com/
@navicyclical the maxNumber should be returned outside of the for loop, but set inside that if statement
max77p
@max77p
Oct 09 2015 02:21
@HermanFassett want to learn how to do it on my computer...first writing a code in a text editor(i know that much) and saving....then compiling it(i have no idea where to start in terms of compiling)
Herman Fassett
@HermanFassett
Oct 09 2015 02:21
So you save it with a .java extension yes
max77p
@max77p
Oct 09 2015 02:21
yes
Herman Fassett
@HermanFassett
Oct 09 2015 02:22
Open a command prompt and see if java is recognized as a command
max77p
@max77p
Oct 09 2015 02:23
type cmd right
then what you mean if java is recognized..what would i type?
Herman Fassett
@HermanFassett
Oct 09 2015 02:23
just type java and press enter or type java -version or whatever
Actually, javac would be a better command to test
max77p
@max77p
Oct 09 2015 02:24
yea all this stuff comes up
Herman Fassett
@HermanFassett
Oct 09 2015 02:24
What about for javac?
navicyclical
@navicyclical
Oct 09 2015 02:25
@max77p you can use jsbin or node.js to run JS
Herman Fassett
@HermanFassett
Oct 09 2015 02:25
@max77p it's a bunch easier if you use Netbeans or similar that compiles for you
navicyclical
@navicyclical
Oct 09 2015 02:25
as for Java, you're gonna have to install NetBeans and run your Java file in terminal/cmd
Herman Fassett
@HermanFassett
Oct 09 2015 02:25
You don't have to install netbeans...
max77p
@max77p
Oct 09 2015 02:26
it says download though
navicyclical
@navicyclical
Oct 09 2015 02:26
that's right, you can still get the SDK for Java along
but Oracle would rather you get the IDE as well
max77p
@max77p
Oct 09 2015 02:26
when i start working on projects...what will i be using?
i just want to learn by doing that..if its through netbeans or just web based
Herman Fassett
@HermanFassett
Oct 09 2015 02:27
@max77p if you want to do projects, Netbeans is a good way to go.
Compiling with cmd is annoying
max77p
@max77p
Oct 09 2015 02:27
ahh ok
Herman Fassett
@HermanFassett
Oct 09 2015 02:28
Basically to be able to compile from the cmd you need to add your jdk bin path to your system environment variables
max77p
@max77p
Oct 09 2015 02:28
is there a tutorial you can direct me to?
that can help me get set up
Herman Fassett
@HermanFassett
Oct 09 2015 02:29
Are you not getting netbeans?
max77p
@max77p
Oct 09 2015 02:29
yes downloading it
actually its done..installing now
Herman Fassett
@HermanFassett
Oct 09 2015 02:30
Ok if you're using netbeans you shouldn't really need a tutorial to set up, though maybe to get used to the interface
navicyclical
@navicyclical
Oct 09 2015 02:32
camperbot @HermanFassett
@HermanFassett
err
how do you give kudos
Herman Fassett
@HermanFassett
Oct 09 2015 02:32
thanks
CamperBot
@camperbot
Oct 09 2015 02:32
if you want to thank someone, put an @ before their name!
exergy1
@exergy1
Oct 09 2015 02:32
is there something wrong with my code <style> .smaller-image { width: 100px; }
</style> i been trying cuz its asking to make the image smaller to 100px and i did and to have the class smaller-image.
max77p
@max77p
Oct 09 2015 02:33
@HermanFassett sorry i meant how to actually use cmd to run netbeans and the code
Herman Fassett
@HermanFassett
Oct 09 2015 02:33
How are you applying that class to your image @exergy1 ?
navicyclical
@navicyclical
Oct 09 2015 02:33
@camperbot how do I thank someone?
CamperBot
@camperbot
Oct 09 2015 02:33
navicyclical sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 319 | @camperbot | http://www.freecodecamp.com/camperbot
Herman Fassett
@HermanFassett
Oct 09 2015 02:33
No need for cmd if you have netbeans but if you want a good tutorial on how to use cmd for java maybe check http://www.tech-recipes.com/rx/30018/how-to-compile-java-programs-through-windows-cmd/
Just have thanks and their name in the same sentence
CamperBot
@camperbot
Oct 09 2015 02:33
if you want to thank someone, put an @ before their name!
Herman Fassett
@HermanFassett
Oct 09 2015 02:34
wiki brownie points
CamperBot
@camperbot
Oct 09 2015 02:34

:point_right: brownie points [wiki]

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

A user profile picture next to a with Brownie Points score

There are three ways you can get Brownie Points:

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

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

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

exergy1
@exergy1
Oct 09 2015 02:36
well thats what it told me to use to make the image smaller
or did i do it wrong
Anthony
@advion
Oct 09 2015 02:53
Which waypoint is that @exergy1?
navicyclical
@navicyclical
Oct 09 2015 02:59

Now, I'm working on the Title Case bonfire, I want to use a regular expression to capitialize it.

function titleCase(str) {
  str = str.toLowerCase();
  for(i=0; i<str.length; i++){
    str = str.charAt(0, /\s/).toUpperCase();
  }


  return str;
}

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

Or that won't work?

Anthony
@advion
Oct 09 2015 02:59
@exergy1 you created the class in your style but you didn’t apply the class to your img.
That would be my guess anyway
Travis
@TravisHi
Oct 09 2015 03:26
help seek and destroy
CamperBot
@camperbot
Oct 09 2015 03:26

:point_right: bonfire seek and destroy [wiki]

Explanation:

This problem is a bit tricky because you have to familiarize yourself with Arguments, as you will have to work with two or more but on the script you only see two. Many people hardcode this program for three arguments. You will remove any number from the first argument that is the same as any other other arguments.

:pencil: read more about bonfire seek and destroy on the FCC Wiki

Travis
@TravisHi
Oct 09 2015 03:53
so an arguments object is used when you don't know the amount of arguments that are going to be returned to a function?
kind of like a wildcard?
Reggie
@Reggie01
Oct 09 2015 03:57

@navicyclical You can use

function titleCase(str) {
    function upper(match) {
        return match.toUpperCase(); 
     }

    // regex is not global so it should grab first letter.  \w =  Equivalent to [A-Za-z0-9_] - from docs
    var newStr = str.replace(/\w/, upper);

    // rest of function

You can read more about replace method. Also, .charAt() method only takes one argument index value. The docs for .charAt() method. Lastly, you can test your regex here.

CamperBot
@camperbot
Oct 09 2015 03:57
:bulb: to format code use backticks! ``` more info
Reggie
@Reggie01
Oct 09 2015 04:01
@TravisHi That sounds right.
Don Price
@KingHippo
Oct 09 2015 04:05
I don't think I'm going to do a parallax portfolio site. It's a pain to get it to look the way I want with parallac
parallax^
Reggie
@Reggie01
Oct 09 2015 04:07

Some programs use it when they allow you to pass optional arguments to functions. i.e

jQuery.ajax( url [, settings ] )

The function would read from arguments array to see if you passed in the optional settings.

Travis
@TravisHi
Oct 09 2015 04:07
what about without the jquery?
Reggie
@Reggie01
Oct 09 2015 04:12
Just an example. Just giving an example of code that would use arguments object. You can build a function that uses arguments w/o jquery. Another example
function sayHello() {
    var args = Array.prototype.slice.call(arguments);
    return args[0] + " TravisHi";
}
sayHello("Hey");
Travis
@TravisHi
Oct 09 2015 04:14
so if you had:
sayHello("Hey", "you");
would that work, or it would just ignore "you" because it returns args[0]?
durairajaa
@durairajaa
Oct 09 2015 04:15
Your p element should have the text "View more " (with a space after it).
what does this mean
i cant pass this test case
some one help me
Reggie
@Reggie01
Oct 09 2015 04:16
"you" would be ignored because I only used args[0].
function sayHello() {
    var args = Array.prototype.slice.call(arguments);
    return args[0] + " " + args[1];
}
sayHello("Hey", "you");
durairajaa
@durairajaa
Oct 09 2015 04:16
@Reggie01 could youhelp me
Reggie
@Reggie01
Oct 09 2015 04:17
what is the name of the waypoint your working on?
durairajaa
@durairajaa
Oct 09 2015 04:17
Waypoint: Nest an Anchor Element within a Paragraph
?
any one here?
Reggie
@Reggie01
Oct 09 2015 04:20
one sec making sure i pass the test
durairajaa
@durairajaa
Oct 09 2015 04:21
<p> View more <a href="http://www.freecatphotoapp.com">cat photos </a> </p>
Reggie
@Reggie01
Oct 09 2015 04:23
just add a space after the word more
Jesse
@jctm30
Oct 09 2015 04:23
function sumAll(arr) {
  arr.sort(function(a, b){return a-b});
  for (i=arr[0]+1; i<arr[1]; i ++) {
    arr.push(i)
  };
  arr.sort(function(a, b){return a-b});
  var total = arr.reduce(function(a, b){
    return a + b;
  });
};


sumAll([1, 4]);
hi guys, heres my code for sum all numbers in range. what am i missing here?? please help!
durairajaa
@durairajaa
Oct 09 2015 04:23
no it is not working
<p> View more <a href="http://www.freecatphotoapp.com">cat photos </a> <p>
Travis
@TravisHi
Oct 09 2015 04:24
need </p> at the end
Reggie
@Reggie01
Oct 09 2015 04:24
<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>
Devon Jones
@jones-codes
Oct 09 2015 04:25
Do
durairajaa
@durairajaa
Oct 09 2015 04:26
yea it worked
thank you @Reggie01
CamperBot
@camperbot
Oct 09 2015 04:26
durairajaa sends brownie points to @reggie01 :sparkles: :thumbsup: :sparkles:
:star: 209 | @reggie01 | http://www.freecodecamp.com/reggie01
DJ
@qualitymanifest
Oct 09 2015 04:28
@jctm30 you're not returning anything to sumAll
Jesse
@jctm30
Oct 09 2015 04:29
@qualitymanifest how do i do that ?
DJ
@qualitymanifest
Oct 09 2015 04:29
var total is correct. you just need to return it at the end.
Jesse
@jctm30
Oct 09 2015 04:30
ah
return total!
thank you sir!!!
CamperBot
@camperbot
Oct 09 2015 04:30
if you want to thank someone, put an @ before their name!
DJ
@qualitymanifest
Oct 09 2015 04:30
exactly
Jesse
@jctm30
Oct 09 2015 04:30
thank you @qualitymanifest
CamperBot
@camperbot
Oct 09 2015 04:30
jctm30 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 260 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Jennifer Currie
@Renestl
Oct 09 2015 04:33
I was just coming to ask about the same bonfire! Was stuck in the same place. Thank you @jctm30 for asking and @qualitymanifest for answering :smile:
CamperBot
@camperbot
Oct 09 2015 04:33
renestl sends brownie points to @jctm30 and @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 248 | @jctm30 | http://www.freecodecamp.com/jctm30
:star: 261 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Jesse
@jctm30
Oct 09 2015 04:33
@Renestl you got it!
DJ
@qualitymanifest
Oct 09 2015 04:35
funny. i actually just re-did that one earlier today (i solved it a couple weeks ago but didn't use .reduce and wanted to do it again with .reduce this time) so it was pretty fresh in my memory
Edper
@edper
Oct 09 2015 04:54
@navicyclical
function titleCase(str) {
    return str.toLowerCase().split(' ').map(function(myStr){
        return myStr.charAt(0).toUpperCase()+myStr.substr(1,myStr.length-1);  
    }).join(" ");

}
I did not use replace in my case by split it with map().
Jordan Robertson
@Jordanson
Oct 09 2015 05:28
Has anybody started over to refresh and improve retention after getting far along? I'm halfway through javascript. Understanding everything so far has not been an issue but I'm feeling like I should go back to waypoint 1 after completing OOP/FP. Or should I continue my trek to bonfires? Thoughts? Experiences?
Nick
@njvaldes
Oct 09 2015 05:29
@Jordanson I found some of the challenges on codeacademy helpful for jQuery and CSS
Reggie
@Reggie01
Oct 09 2015 05:34
@Jordanson Just keep going to Bonfires. If you get stuck just ask questions and post your code in chat. Somebody will eventually answer you. Waypoints just get you familiar with the vocabulary and small examples. Bonfires will make you apply what you read in Waypoints.
Nick
@njvaldes
Oct 09 2015 05:35
stupid question but how do you post code into chat for help?
Reggie
@Reggie01
Oct 09 2015 05:36
three backticks your code
Jordan Robertson
@Jordanson
Oct 09 2015 05:37
This message was deleted
(```) @njvaldes start with whats in parentheses
Reggie
@Reggie01
Oct 09 2015 05:38
there is an M with a downward arrow (markdown help) in your chatbox. Just click that and it will show you an example
Jordan Robertson
@Jordanson
Oct 09 2015 05:40
after pressing those three (```) follow with enter
thanks @njvaldes and @Reggie01
CamperBot
@camperbot
Oct 09 2015 05:40
jordanson sends brownie points to @njvaldes and @reggie01 :sparkles: :thumbsup: :sparkles:
:star: 202 | @njvaldes | http://www.freecodecamp.com/njvaldes
:star: 210 | @reggie01 | http://www.freecodecamp.com/reggie01
Nick
@njvaldes
Oct 09 2015 05:42
thanks @Jordanson @Reggie01
CamperBot
@camperbot
Oct 09 2015 05:42
njvaldes sends brownie points to @jordanson and @reggie01 :sparkles: :thumbsup: :sparkles:
:star: 211 | @reggie01 | http://www.freecodecamp.com/reggie01
:star: 145 | @jordanson | http://www.freecodecamp.com/jordanson
Nick
@njvaldes
Oct 09 2015 05:45
<script>
  function runSlots(){
    var slotOne;
    var slotTwo;
    var slotThree;

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

    // Only change code below this line.
slotOne = Math.floor(Math.random() * (3 - 1 + 1) + 1);  
slotTwo = Math.floor(Math.random() * (3 - 1 + 1) + 1);
slotThree = Math.floor(Math.random() * (3 - 1 + 1) +1);

    // Only change code above this line.
I've generated the formula three times and not sure why this isn't satisfying the requirements
Reggie
@Reggie01
Oct 09 2015 05:46
What's the name of the waypoint?
Rex Schrader
@SaintPeter
Oct 09 2015 05:48
@Jordanson I "restarted" the Bonfires once I got to Functional Programming. I kinda amazed myself with how much more cleanly and effeciently I could do them. It also helped to cement my functional programming knowledge. I would suggest that you complete the Bonfires first, though.
CamperBot
@camperbot
Oct 09 2015 05:48
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Nick
@njvaldes
Oct 09 2015 05:48
'create a javascript slot machine'
my code creates three random numbers and uses the required formula yet the latter isn't satisfied
Reggie
@Reggie01
Oct 09 2015 05:53

yeah, I just tried the waypoint. I assigned the functions to where the variable is declared and passed

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

And I get an error if I try to insert the code the way you did.

But the way you tried is what they say to do in the comments
// Only change code below this line.
@njvaldes did that answer your question?
Nick
@njvaldes
Oct 09 2015 05:59
@Reggie01 thanks...I'm still trying to figure out the difference...trying to absorb the material on these waypoints and this one isn't clicking
CamperBot
@camperbot
Oct 09 2015 05:59
njvaldes sends brownie points to @reggie01 :sparkles: :thumbsup: :sparkles:
:warning: njvaldes already gave reggie01 points
Reggie
@Reggie01
Oct 09 2015 05:59
This message was deleted
Nick
@njvaldes
Oct 09 2015 06:02
This message was deleted

nope... @Reggie01 I forgot to close the parent ()

 // Only change code below this line.
var slotOne = Math.floor(Math.random() * (3 - 1 + 1) + 1);  
var slotTwo = Math.floor(Math.random() * (3 - 1 + 1) + 1);
var slotThree = Math.floor(Math.random() * (3 - 1 + 1) +1); 

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

mine former, yours latter

thanks!
CamperBot
@camperbot
Oct 09 2015 06:04
if you want to thank someone, put an @ before their name!
Reggie
@Reggie01
Oct 09 2015 06:05
Lol, I need to pay more attention to syntax.
DL2014
@DL2014
Oct 09 2015 06:07
404 missing : -/package/@dl%2fdsb/dist-tags
why ?
hello everybody
who know this?
DJ
@qualitymanifest
Oct 09 2015 06:09
@DL2014 where are you experiencing this?
DL2014
@DL2014
Oct 09 2015 06:10
oh, how-to-npm
@qualitymanifest thanks
CamperBot
@camperbot
Oct 09 2015 06:10
dl2014 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 262 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
DL2014
@DL2014
Oct 09 2015 06:11
i don't know why ?
DJ
@qualitymanifest
Oct 09 2015 06:11
i'm sorry but i'm really not familiar with that. are you getting that when just trying to view the github page?
DL2014
@DL2014
Oct 09 2015 06:13
when i type that : dl2014@npm:~/workspace $ npm dist-tag add @dl/dsb@1.0.1 what
npm ERR! 404 missing : -/package/@dl%2fdsb/dist-tags
Reggie
@Reggie01
Oct 09 2015 06:14
wiki channel
CamperBot
@camperbot
Oct 09 2015 06:14
no wiki entry for: channel
:pencil: click here to create one now!after creating your page type update to reload it here
Reggie
@Reggie01
Oct 09 2015 06:14
wiki room
CamperBot
@camperbot
Oct 09 2015 06:14

:point_right: casual chat rooms [wiki]

The following are our casual chat rooms.

Please note that all chat rooms listed here are publicly accessible and indexed by search engines, so only share email addresses or other sensitive information in private messages.

Chat Room Description
Casual chat about anything, but keep it clean.
Hardware chat about computer hardware and Internet of Things
GameDev chat about designing and developing video games
Gaming chat about gaming of all kinds, such as video games and table top games
TVandMovies chat about TV shows and movies
Music chat about music
Business chat about business and entrepreneurship
Saving chat about saving, investing, and home economics
SelfImprovement chat about productivity, self improvement and quantified self

Additional Chat Room Lists

  • [[Official Free Code Camp Chat Rooms|Official-Free-Code-Camp-Chat-Rooms]]
  • [[World Language Chat Rooms|World-Language-Chat-Rooms]]
  • [[Campsite Chat Rooms|List-of-Free-Code-Camp-city-based-Campsites]]
    :pencil: read more about casual chat rooms on the FCC Wiki
DJ
@qualitymanifest
Oct 09 2015 06:14
@DL2014 okay yeah that's way above my level currently, but maybe this could help nodeschool/discussions#995
DL2014
@DL2014
Oct 09 2015 06:16
@qualitymanifest thanks
CamperBot
@camperbot
Oct 09 2015 06:16
dl2014 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: dl2014 already gave qualitymanifest points
DJ
@qualitymanifest
Oct 09 2015 06:16
@SaintPeter can you shed some light here?
SaintPeter @SaintPeter appears ins a puff of smoke
Reggie
@Reggie01
Oct 09 2015 06:16
@DL2014 you can trying posting your question in the /HelpBasejumps chat.
DJ
@qualitymanifest
Oct 09 2015 06:16
@SaintPeter hahahaha
Rex Schrader
@SaintPeter
Oct 09 2015 06:17
@DL2014 Let me take a look - I know a lot of people have had a lot of trouble with this specific task
@Reggie01 use wiki help rooms for the help room list
DL2014
@DL2014
Oct 09 2015 06:21
@SaintPeter I've tried a lot of it.
but it is not work
Rex Schrader
@SaintPeter
Oct 09 2015 06:21
@DL2014 Yeah - I have personally never gotten it to work
Reggie
@Reggie01
Oct 09 2015 06:21
thanks @SaintPeter could'nt remember the command.
CamperBot
@camperbot
Oct 09 2015 06:21
reggie01 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 940 | @saintpeter | http://www.freecodecamp.com/saintpeter
DL2014
@DL2014
Oct 09 2015 06:24
@SaintPeter Do you have the same problem?
Rex Schrader
@SaintPeter
Oct 09 2015 06:24
@DL2014 Yes.
@DL2014 The help is not helpful, is it?
DL2014
@DL2014
Oct 09 2015 06:27

@SaintPeter yes,it is,

The method has no effect

DL2014
@DL2014
Oct 09 2015 06:33
I think it's a bug on how-to-npm.
Rex Schrader
@SaintPeter
Oct 09 2015 06:34
npm/how-to-npm#21
nodeschool/discussions#995
Jason
@Jauble
Oct 09 2015 06:43
Anyone know why the animated bounce won't work on my quote button? http://codepen.io/auble220/pen/GpmjGx
Rex Schrader
@SaintPeter
Oct 09 2015 06:45
@Jauble @import url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css);
Is that a css command? You might want to link it in in the settings
@Jauble I've seen lots of weird errros when you don't use the Settings to pull linked styles in
blob
Jason
@Jauble
Oct 09 2015 06:51
@SaintPeter I should've done that in the first place. Thanks. Does my code look right? $(this).addClass("animated bounce");
CamperBot
@camperbot
Oct 09 2015 06:51
jauble sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 941 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 09 2015 06:51
@Jauble I think so
Jason
@Jauble
Oct 09 2015 06:52
@SaintPeter Ok thanks
CamperBot
@camperbot
Oct 09 2015 06:52
jauble sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: jauble already gave saintpeter points
Rex Schrader
@SaintPeter
Oct 09 2015 06:52
@Jauble Honestly, not an expert on animate.js :D
Best of luck
Jason
@Jauble
Oct 09 2015 06:55
@SaintPeter Me either, I guess i'll have to do some research. Thanks though :smile:
CamperBot
@camperbot
Oct 09 2015 06:55
jauble sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: jauble already gave saintpeter points
straightmac998
@straightmac998
Oct 09 2015 07:02
Inside your script element, add this code: $(document).ready(function() { to your script. Then close it on the following line (still inside your script element) with: });
<script $(document).ready(function() { });></script>
what am i doing wrong>>
Reggie
@Reggie01
Oct 09 2015 07:09
@straightmac998 <script>
@straightmac998 first tag is still open
straightmac998
@straightmac998
Oct 09 2015 07:12
im still unsure
Reggie
@Reggie01
Oct 09 2015 07:13

you included the function

$(document).ready(function() {});

inside your <script> tag

straightmac998
@straightmac998
Oct 09 2015 07:14
yes as i was inmstructed too
Reggie
@Reggie01
Oct 09 2015 07:14
yeah, but it's how you structured the code
DJ
@qualitymanifest
Oct 09 2015 07:15
it needs to be within <script> and </script>. you put it inside the opening <script ... tag
Reggie
@Reggie01
Oct 09 2015 07:15
<script $(document).ready(function() { });></script>

<script>$(document).ready(function() {});</script>
straightmac998
@straightmac998
Oct 09 2015 07:17
hmmm thank you
CamperBot
@camperbot
Oct 09 2015 07:17
if you want to thank someone, put an @ before their name!
straightmac998
@straightmac998
Oct 09 2015 07:17
i did that on my second guess must have been a typing error
thank you very much tho
CamperBot
@camperbot
Oct 09 2015 07:17
if you want to thank someone, put an @ before their name!
straightmac998
@straightmac998
Oct 09 2015 07:18
@Reggie01 thank you
CamperBot
@camperbot
Oct 09 2015 07:18
straightmac998 sends brownie points to @reggie01 :sparkles: :thumbsup: :sparkles:
:star: 212 | @reggie01 | http://www.freecodecamp.com/reggie01
Korry Williams
@korrywill
Oct 09 2015 07:27
Anyone else have any issues with Waypoint 32?
navicyclical
@navicyclical
Oct 09 2015 07:29
@Reggie01
@edper
It's getting late for me - I don't like blindly copying code but I'll take a look at the methods and see how they click
Edper
@edper
Oct 09 2015 07:32
@navicyclical you're right. Just showing some other way of doing it and hopefully you could some ideas with.
Reggie
@Reggie01
Oct 09 2015 07:36
@kwill-i-am there are two waypoint 32. What is the name of the waypoint?
Korry Williams
@korrywill
Oct 09 2015 07:37
@Reggie01 my bad, I never noticed that. its Waypoint 32: Use Conditional Logic with If and Else Statements
Reggie
@Reggie01
Oct 09 2015 07:41
@kwill-i-am no problem. Can you post your code?
Korry Williams
@korrywill
Oct 09 2015 07:42
Screen Shot 2015-10-09 at 3.41.55 AM.png
@Reggie01 the error I’m getting is “missing ; before statement"
Reggie
@Reggie01
Oct 09 2015 07:44
your "if" is capitalized it needs to be lowercase
also you can post code by placing it in between a set of backticks ```
Korry Williams
@korrywill
Oct 09 2015 07:45
@Reggie01 Wow…. unbelievable lol
I don’t quite get your last statement
Aha
DTing
@dting
Oct 09 2015 07:51
help formatting
CamperBot
@camperbot
Oct 09 2015 07:51

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

DTing
@dting
Oct 09 2015 07:51
hes talking about formatting your code instead of pasting screen shots
Korry Williams
@korrywill
Oct 09 2015 07:53
@dting cool, thanks @Reggie01
CamperBot
@camperbot
Oct 09 2015 07:53
kwill-i-am sends brownie points to @dting and @reggie01 :sparkles: :thumbsup: :sparkles:
:star: 214 | @reggie01 | http://www.freecodecamp.com/reggie01
:star: 1348 | @dting | http://www.freecodecamp.com/dting
Derek Frankel
@TuvyaYis
Oct 09 2015 08:06
thanks @Rafase282
CamperBot
@camperbot
Oct 09 2015 08:06
tuvyayis sends brownie points to @rafase282 :sparkles: :thumbsup: :sparkles:
:star: 513 | @rafase282 | http://www.freecodecamp.com/rafase282
Derek Frankel
@TuvyaYis
Oct 09 2015 08:24
help factorialize
CamperBot
@camperbot
Oct 09 2015 08:24

:point_right: bonfire factorialize a number [wiki]

The problem

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

Factorials are often represented with the shorthand notation n!

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

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

Edper
@edper
Oct 09 2015 08:43
@bmoree
Roylyan Nikita
@Roylyan-Nikita
Oct 09 2015 08:43
Thanks @abhisekp @dting
CamperBot
@camperbot
Oct 09 2015 08:43
roylyan-nikita sends brownie points to @abhisekp and @dting :sparkles: :thumbsup: :sparkles:
:star: 561 | @abhisekp | http://www.freecodecamp.com/abhisekp
:star: 1350 | @dting | http://www.freecodecamp.com/dting
Edper
@edper
Oct 09 2015 08:43
```
function diff(arr1, arr2) {
  if (arr1.length==0)
      return arr2;
  newArr = arr1.concat(arr2);

  return newArr.filter(function(val,el,a){
     return (a.indexOf(val) == a.lastIndexOf(val));
  });
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Here's my solution to the same problem as yours. I used concat then filter it and then use IndexOf and lastIndexOf to see if index key is the same then that means no duplicate.
DTing
@dting
Oct 09 2015 09:01
@edper thats an interesting solution
how come there is a special case for arr1.length == 0 but not arr2.length == 0 seems a asymmetric
Edper
@edper
Oct 09 2015 09:12
@dting that's for the case when the first array arr1 is empty. Like [], ["snuffleupagus", "cookie monster", "elmo"]
Edper
@edper
Oct 09 2015 09:20
@dting you give me an idea to remove the special case and here it is.
function diff(arr1, arr2) {
  return (arr1.length == 0 ? arr2 : arr1.concat(arr2).filter(function(val,el,a){
     return (a.indexOf(val) == a.lastIndexOf(val));
  }));
}
I mean not really remove but refactored ;-)
Edper
@edper
Oct 09 2015 09:25
@dting That's what the example [by FreeCodeCamp] calls for but it could be refactored accommodate such case.
DTing
@dting
Oct 09 2015 09:30
@edper ya im wondering why there isnt the same check for the second array being empty
i know the tests don't require it to pass but seems strange to be not commutative
Edper
@edper
Oct 09 2015 09:32
That's my thinking also when I saw it.
We could probably do something like this
function diff(arr1, arr2) { 
if (arr1.length==0) return arr2; 
if (arr2.length==0) return arr1; 
return (arr1.concat(arr2).filter(function(val,el,a){ return (a.indexOf(val) == a.lastIndexOf(val)); })); }
DTing
@dting
Oct 09 2015 09:38
bf diff
CamperBot
@camperbot
Oct 09 2015 09:38

: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

DTing
@dting
Oct 09 2015 09:42
seems like that check isn't necessary:
function diff(arr1, arr2) {
  return arr1.concat(arr2).filter(function(val,_,a) {
     return a.indexOf(val) == a.lastIndexOf(val);
  });
}
nice solution tho @edper interesting take on the challenge
Edper
@edper
Oct 09 2015 09:44
@dting what does _ (underscore) do here?
NobisPete
@NobisPete
Oct 09 2015 09:44
Thanks
CamperBot
@camperbot
Oct 09 2015 09:44
if you want to thank someone, put an @ before their name!
NobisPete
@NobisPete
Oct 09 2015 09:45
Thanks @dting @edper ... I swear I learn the most just from following chat :)
CamperBot
@camperbot
Oct 09 2015 09:45
nobispete sends brownie points to @dting and @edper :sparkles: :thumbsup: :sparkles:
:star: 42 | @edper | http://www.freecodecamp.com/edper
:star: 1353 | @dting | http://www.freecodecamp.com/dting
Edper
@edper
Oct 09 2015 09:46
You're welcome @NobisPete!
DTing
@dting
Oct 09 2015 09:50
@edper _ is just a placeholder since i'm not using that variable
Edper
@edper
Oct 09 2015 09:50
Here's another one, the BF's Seek and Destroy. I was asking for comment before I go to work but nobody give me an answer. This is my original work that solves the problem but for me it's too long.
function destroyer(arr) {
for(i=1;i<arguments.length;i++)
    {
      for(j=0;j<arr.length;j++)
        {
          if(arguments[i]==arr[j])
             arr.splice(j,j+1)
        }
    }
}
But here's my refactored version.
function destroyer(arr) {
  args = Array.prototype.slice.call(arguments);
  return arr.filter(function(val){
       return (args.indexOf(val)==-1);  
  });
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3, "");
@dting ok.
DTing
@dting
Oct 09 2015 09:53
looks good. only thing i can think of is not using global args (var args) and maybe call slice with 1 as an argument since you are using slice.call already
something like
function destroyer(arr) {
  var args = [].slice.call(arguments, 1);
  return arr.filter(function(val) {
       return args.indexOf(val) == -1;  
  });
}
Edper
@edper
Oct 09 2015 10:19
@dting the [].slice.call is neat. What's does the argument 1 do here?
vere perrot
@perrot
Oct 09 2015 10:21
Find simon game
CamperBot
@camperbot
Oct 09 2015 10:21
find simon game
nothing found
vere perrot
@perrot
Oct 09 2015 10:22
Wiki simon game
CamperBot
@camperbot
Oct 09 2015 10:22
no wiki entry for: simon game
:pencil: click here to create one now!after creating your page type update to reload it here
DTing
@dting
Oct 09 2015 10:24
@edper 1 as the second argument will not copy the first element. since the first element is your arr you dont need to check that
Revathy
@revathynair
Oct 09 2015 10:52
'''
CamperBot
@camperbot
Oct 09 2015 10:52
:bulb: to format code use backticks! ``` more info
Revathy
@revathynair
Oct 09 2015 10:53
<script>
  $(document).ready(function() {
    $("button").addClass("animated bounce");
    $(".well").addClass("animated shake");
    $("#target3").addClass("animated fadeOut");
    $("#target1").removeClass("btn-default");
    $("#target2").removeClass("btn-default");
    $("#target3").removeClass("btn-default");
    $("#target4").removeClass("btn-default");
    $("#target5").removeClass("btn-default");
    $("#target6").removeClass("btn-default");
  });
</script>

<!-- You shouldn't need to modify code below this line -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <h4>#left-well</h4>
      <div class="well" id="left-well">
        <button class="btn target" id="target1">#target1</button>
        <button class="btn target" id="target2">#target2</button>
        <button class="btn target" id="target3">#target3</button>
I'm stuck here
kindly help
shitala
@shitala099
Oct 09 2015 10:54
hi guys..can anyone tell php site for online problem solving like freecodecamp??
Revathy
@revathynair
Oct 09 2015 10:54
Error: Only use jQuery to remove this class from the element
Michael Bomholt
@bomholtm
Oct 09 2015 10:55
what do you guys use to minify your css files
shitala
@shitala099
Oct 09 2015 10:56
@bomholt use thsi one http://cssminifier.com/
Mateja Trifunovski
@Matko95
Oct 09 2015 10:56
@revathynair you need to remove all the btn-default classes only with one line of code
Revathy
@revathynair
Oct 09 2015 10:57
I tried many suggestions but it isn't helping
Mateja Trifunovski
@Matko95
Oct 09 2015 10:57
@revathynair $("button").removeClass("btn-default");
Revathy
@revathynair
Oct 09 2015 10:57
@Matko95 as in (#target1, )
ok
let me check
Vietnamese Donkey
@vietnamkong
Oct 09 2015 10:57
help Find the Longest Word in a String
CamperBot
@camperbot
Oct 09 2015 10:57

:point_right: bonfire find the longest word in a string [wiki]

Explanation:

You have to go through each word and figure out which one is the longest and return not the word, but how many characters it has.

:pencil: read more about bonfire find the longest word in a string on the FCC Wiki

Mateja Trifunovski
@Matko95
Oct 09 2015 10:58
@revathynair because in the assignment it says Remove the btn-default class from all of your button elements. so you remove it directly from button, not by targeting every target one by one.
Revathy
@revathynair
Oct 09 2015 10:58
@Matko95 its not working
Mateja Trifunovski
@Matko95
Oct 09 2015 10:58
@revathynair could you post the code again?
Revathy
@revathynair
Oct 09 2015 10:59
sure
<script>
  $(document).ready(function() {
    $("button").addClass("animated bounce");
    $(".well").addClass("animated shake");
    $("#target3").addClass("animated fadeOut");
    $("button").removeClass("btn-default");

  });
</script>
Mateja Trifunovski
@Matko95
Oct 09 2015 11:11
@revathynair that seems to be working
could you try a different browser maybe?
This message was deleted
wiki storage
CamperBot
@camperbot
Oct 09 2015 11:11

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

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

In Chrome:

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

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

DTing
@dting
Oct 09 2015 11:12
@revathynair which one are you working on?
Mateja Trifunovski
@Matko95
Oct 09 2015 11:12
@revathynair or this
Jas K
@jask84
Oct 09 2015 11:12
Hello everyone. I was wondering if I could get some help on the Bonfire: Mutations. I'll post it once I'm asked to by someone. Thanks.
Revathy
@revathynair
Oct 09 2015 11:15
THANK YOU SO MUCH @Matko95
CamperBot
@camperbot
Oct 09 2015 11:15
revathynair sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 419 | @matko95 | http://www.freecodecamp.com/matko95
Revathy
@revathynair
Oct 09 2015 11:15
I couldn't just take it out of my mind :D
Thanks @Matko95
CamperBot
@camperbot
Oct 09 2015 11:15
revathynair sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:warning: revathynair already gave matko95 points
Mateja Trifunovski
@Matko95
Oct 09 2015 11:16
@revathynair no prob :)
Jas K
@jask84
Oct 09 2015 11:20
function mutation(arr) {
 var elem2 = arr[0].toLowerCase().split("");
 var elem3 = arr[1].toLowerCase().split("");
  for (var i=0; i<elem3.length; i++){
  if (elem2.indexOf(elem3[i]) >= 0){
    return true;
  } else {
    return false;
  }
}
}

mutation(["hello", "hey"], "");
This works for all the other tests except the one shown. I can't figure out why. There is something wrong in the loop?
Mateja Trifunovski
@Matko95
Oct 09 2015 11:22
@jask84 what test?
Jas K
@jask84
Oct 09 2015 11:23
apologies. I mean when I call the function with "hello" and "hey"
it returns true, when it should be false. I really cannot figure out why as it works for all the other combinations in the bonfire...
I have a feeling there is something significant missing and I may have fluked returning true for the other combinations of words.
Mateja Trifunovski
@Matko95
Oct 09 2015 11:25
@jask84 your for loop only runs once, because return breaks it
Jas K
@jask84
Oct 09 2015 11:27
thanks for that. that makes more sense. So would it be better to modify the if statement to be one that returns false?
CamperBot
@camperbot
Oct 09 2015 11:27
if you want to thank someone, put an @ before their name!
Revathy
@revathynair
Oct 09 2015 11:27
1.JPG
Jas K
@jask84
Oct 09 2015 11:27
@Matko95 thanks
CamperBot
@camperbot
Oct 09 2015 11:27
jask84 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 420 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Oct 09 2015 11:29
@jask84 you could store the value, then return it after the loop ends
Jas K
@jask84
Oct 09 2015 11:29
thanks a lot. I'm going to go adjust it now.
CamperBot
@camperbot
Oct 09 2015 11:29
if you want to thank someone, put an @ before their name!
Abhisek Pattnaik
@abhisekp
Oct 09 2015 11:34

@dting @edper @NobisPete this solution doesn't work for the test case i've written here. And it's not a good idea to use _ (underscore) as it might conflict with the lodash (aka underscore) library.

function diff(arr1, arr2) {
  return arr1.concat(arr2).filter(function(val,_,a) {
     return a.indexOf(val) == a.lastIndexOf(val);
  });
}

diff([1, 2, 3, 3], [1]); // [ 2 ] should be [ 2, 3, 3 ]

See https://repl.it/BPDW

Michael Bomholt
@bomholtm
Oct 09 2015 11:35
@shitala099 thanks and sorry was in a rush ^^
CamperBot
@camperbot
Oct 09 2015 11:35
bomholt sends brownie points to @shitala099 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for shitala099
Michael Bomholt
@bomholtm
Oct 09 2015 11:37
is there any significant differences between the methods of minimizing css?
Abhisek Pattnaik
@abhisekp
Oct 09 2015 11:38
@bomholt certainly. The formatting and comment removal. :P
DTing
@dting
Oct 09 2015 11:41
only if you are using lodash or underscore...
Abhisek Pattnaik
@abhisekp
Oct 09 2015 11:41
@bomholt btw, Use http://csscompressor.com/
DTing
@dting
Oct 09 2015 11:41
bf diff
CamperBot
@camperbot
Oct 09 2015 11:41

:fire:Bonfire: Diff Two Arrays :link:

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

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

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

more info:  bf details | bf links | hint

Abhisek Pattnaik
@abhisekp
Oct 09 2015 11:42
@dting what i meant was one shouldn't practice using _(underscore) as a placeholder.
better to use some other unicode characters other than the english chars or punctuations. :D
Mateja Trifunovski
@Matko95
Oct 09 2015 11:43
@abhisekp do those compressors really make a difference?
Michael Bomholt
@bomholtm
Oct 09 2015 11:45
@abhisekp thanks
CamperBot
@camperbot
Oct 09 2015 11:45
bomholt sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 563 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Oct 09 2015 11:47
@Matko95 certainly. Small size files are faster to process and download. In server side, they reduce the memory footprint. :D
Pekmen
@Pekmen
Oct 09 2015 12:06
I need you guys. In Bonfire: Spinal Tap Case my pass everything except the one with camelcase. I don't know how to regex that one
bf Spinal Tap Case
CamperBot
@camperbot
Oct 09 2015 12:07

:fire:Bonfire: Spinal Tap Case :link:

function spinalCase(str) {
  // "It's such a fine line between stupid, and clever."
  // --David St. Hubbins
  return str;
}

spinalCase('This Is Spinal Tap');

Convert a string to spinal case. Spinal case is all-lowercase-words-joined-by-dashes.

more info:  bf details | bf links | hint

Pekmen
@Pekmen
Oct 09 2015 12:09
nvm, found it on SO
Edper
@edper
Oct 09 2015 12:11
@abhisekp it's @dting revision's of my original work. This is my original work (actually refactored).
function diff(arr1, arr2) {
  return (arr1.length == 0 ? arr2 : arr1.concat(arr2).filter(function(val,el,a){
     return (a.indexOf(val) == a.lastIndexOf(val));
  }));
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Abhisek Pattnaik
@abhisekp
Oct 09 2015 12:12
@edper your work is also showing incorrect output. See https://repl.it/BPDW/1
DTing
@dting
Oct 09 2015 12:13
el is a misnomer there
that should be index or something like that
Edper
@edper
Oct 09 2015 12:13
@dting you're right.
Alex
@wishe
Oct 09 2015 12:14
Even though ive been through all the waypoints and all the first group of bonfires twice, i still struggle with each of the intermediate bonfire challenges and spend alot of time thinking about how to solve each one. It seems something is not clicking for me, any suggestions?
DTing
@dting
Oct 09 2015 12:14
@abhisekp is correct that your code doesnt handle duplicate items
in the same array that is
Abhisek Pattnaik
@abhisekp
Oct 09 2015 12:15
@dting making a PR to add the test case....
DTing
@dting
Oct 09 2015 12:15
cool
Edper
@edper
Oct 09 2015 12:15
@abhisekp you're right because this is not a case wherein there is duplicate already in any of the two array.
But it works on FCC's BF test.
Abhisek Pattnaik
@abhisekp
Oct 09 2015 12:16
@edper FCC tests need some corrections.
Miłosz Zalewski
@Tolinieg
Oct 09 2015 12:18

Hi, I need some help. I tried to make an algorithm that will factorialize numbers but for some reason it doesn't call itself:
function factorialize(num) {
if(num == 0){
return 1;
} else {
return (num*( num-1 ))
}
};

factorialize(5);

When I input 5 it returns 20 and that's it
DTing
@dting
Oct 09 2015 12:19
if you want to call the function inside your function you can use the name of the function inside your function
function fn() {
  fn();
}
Miłosz Zalewski
@Tolinieg
Oct 09 2015 12:21
Like this?

function factorialize(num) {
if(num == 0){
return 1;
} else {
return (num*( num-1 ));
factorialize(num);
}
};

factorialize(5);

It still doesn't work
Miłosz Zalewski
@Tolinieg
Oct 09 2015 12:26
So?
Any Idea?
DTing
@dting
Oct 09 2015 12:27
you have a function call after a non conditional return statement
that function will never run
you probably want to change the return statement
Miłosz Zalewski
@Tolinieg
Oct 09 2015 12:28
what should I change?
Oh, wait
I think I know
Edper
@edper
Oct 09 2015 12:29
@abhisekp I'll try GOD willing to refactor.
Miłosz Zalewski
@Tolinieg
Oct 09 2015 12:30
It works
thanks @dting
CamperBot
@camperbot
Oct 09 2015 12:30
tolinieg sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1356 | @dting | http://www.freecodecamp.com/dting
piaffe
@piaffe
Oct 09 2015 12:30

I have just started, but i already have got stuck... I can't figure out what is wrong here. <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;
}
.gray-background {
background-color: gray;
}
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}

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

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

<p>Click here for <a href="#">cat photos</a>.</p>

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

<div class="gray-backround">
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>

<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>

I'm suppose to give backround colour to div element.
Aleksander Gębicki
@Takumar
Oct 09 2015 12:31
@piaffe when you paste your code, please format it using three backticks "```" before and after your code. It is simpler to read and everybody sees it's your code.
piaffe
@piaffe
Oct 09 2015 12:32
@Takumar Thank you, i did not know. =)
CamperBot
@camperbot
Oct 09 2015 12:32
piaffe sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 418 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Oct 09 2015 12:32
It looks that you've added class to <div> element.
which waypoint it is?
piaffe
@piaffe
Oct 09 2015 12:34
@Takumar should it not be there? Waypoint 37
Aleksander Gębicki
@Takumar
Oct 09 2015 12:35
@piaffe it should be, I say that it looks good for first sight.
@piaffe no :-) you miss one letter: <div class="gray-backround"> You need "gray-background" instead.
Travis
@TravisHi
Oct 09 2015 12:38
:)
nicely spotted
piaffe
@piaffe
Oct 09 2015 12:38
@Takumar Omg, i'm a fool... Thank you. =D
CamperBot
@camperbot
Oct 09 2015 12:38
piaffe sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: piaffe already gave takumar points
Aleksander Gębicki
@Takumar
Oct 09 2015 12:39
It is easier to read when your code is coloured. @piaffe please edit your block of code for training - add missing backticks.
wiki format
CamperBot
@camperbot
Oct 09 2015 12:39

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

piaffe
@piaffe
Oct 09 2015 12:39
How can i make smileys here?
Aleksander Gębicki
@Takumar
Oct 09 2015 12:40
type colon and Gitter will give you hints. Colon smile colon === :smile:
Abhisek Pattnaik
@abhisekp
Oct 09 2015 12:43
explain edit
CamperBot
@camperbot
Oct 09 2015 12:43

:point_right: edit or delete message [wiki]

Editing or Deleting a previous message within 5 mins. of posting

How to delete message
:pencil: read more about edit or delete message on the FCC Wiki

Abhisek Pattnaik
@abhisekp
Oct 09 2015 12:43
@piaffe :point_up: October 9, 2015 6:13 PM
piaffe
@piaffe
Oct 09 2015 12:44
I tried to edit my text, but it didn't change. Now i can't get to editing it. Only reply and quote are choosable options.
This message was deleted
Travis
@TravisHi
Oct 09 2015 12:46
press shift + enter to separate the lines
piaffe
@piaffe
Oct 09 2015 12:46
This message was deleted
This message was deleted
<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;
}
.gray-background {
background-color: gray;
}
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}

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

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

<p>Click here for <a href="#">cat photos</a>.</p>

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

<div class="gray-backround">
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>

<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
Travis
@TravisHi
Oct 09 2015 12:50
that's it!
Abhisek Pattnaik
@abhisekp
Oct 09 2015 12:50
@piaffe you can only edit or delete within 5 mins of posting
piaffe
@piaffe
Oct 09 2015 12:52
I did it! =)
Abhisek Pattnaik
@abhisekp
Oct 09 2015 12:55
@piaffe
@piaffe or you can Press :up: arrow key and edit previous post
Travis
@TravisHi
Oct 09 2015 12:56
can someone tell me what (element) does quickly?
vere perrot
@perrot
Oct 09 2015 12:58

Hello,
Have anyone knows how to create a flash text?
Like the text of count on the simon game http://codepen.io/Em-Ant/full/QbRyqq/.
Switch on will change the text of count to a new text "--".
Then click the start button to start the game.

The text of count will show hide.
The text of count will show again.
The text of count will show hide.
The text of count will show again.
The text of count will show text "01".
Then flash the color pad.

I don't know how to do this effect. Have any idea? Many thanks.

CamperBot
@camperbot
Oct 09 2015 12:58
if you want to thank someone, put an @ before their name!
Jas K
@jask84
Oct 09 2015 12:59

Hi, can anyone tell me why the top code works and not the second. Why does omitting the { after the if statement work??

function mutation(arr) {
 var elem2 = arr[0].toLowerCase().split("");
 var elem3 = arr[1].toLowerCase().split("");
  for (var i=0; i<elem3.length; i++){
  if (elem2.indexOf(elem3[i]) < 0)
    return false;
  }
    return true;
  }


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

The code below doesn't work:

function mutation(arr) {
 var elem2 = arr[0].toLowerCase().split("");
 var elem3 = arr[1].toLowerCase().split("");
  for (var i=0; i<elem3.length; i++){
  if (elem2.indexOf(elem3[i]) < 0){
    return false;
  }
    return true;
  }
}

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

I have been trying to figure this out for hours!

Travis
@TravisHi
Oct 09 2015 13:01
return false;
} else {
return true;
}
?
Edper
@edper
Oct 09 2015 13:01
@jask84 the } is an extra in the second code and has therefore no pair.
?
Srikant Devarajan
@srikantdevarajan
Oct 09 2015 13:03
hello world
CamperBot
@camperbot
Oct 09 2015 13:03

welcome to FreeCodeCamp @srikantdevarajan!

Edper
@edper
Oct 09 2015 13:04
@jask84 the second one has the return true inside the for loop while the first one is not.
Jas K
@jask84
Oct 09 2015 13:05
@TravisHi @edper thanks for the help, I'm just trying to get my head around what you said...
CamperBot
@camperbot
Oct 09 2015 13:05
jask84 sends brownie points to @travishi and @edper :sparkles: :thumbsup: :sparkles:
:star: 44 | @edper | http://www.freecodecamp.com/edper
:star: 213 | @travishi | http://www.freecodecamp.com/travishi
Aleksander Gębicki
@Takumar
Oct 09 2015 13:05
Welcome @srikantdevarajan to the FCC. Many happy hours with coding!
Jas K
@jask84
Oct 09 2015 13:08
@edper if return true is inside the for loop, what difference does it make overall? I'm trying to understand the effect so I dont do it again...
Aleksander Gębicki
@Takumar
Oct 09 2015 13:14
@jask84 when you put return inside the loop you exit the loop immediately. I think that's the only "difference". Sometimes you need to exit loop when your condition is met with value 'true', and you place return false; outside the loop.
I don't know if anything else can be said in that matter.
Jas K
@jask84
Oct 09 2015 13:18
thanks, I'll look into it. I think my brain is fried at the moment and I'm not looking at it all properly. I seem to be under the impression a { is needed after an If statement. Thanks for your help
CamperBot
@camperbot
Oct 09 2015 13:18
if you want to thank someone, put an @ before their name!
Aleksander Gębicki
@Takumar
Oct 09 2015 13:20
@jask84 curly brackets '{' and '}' is needed when you put block of code inside the 'if' condition: if (true) { console.out("ABC"); x += 1; }
When you insert only one statement braces are not needed: if (true) x += 2;
Aleksander Gębicki
@Takumar
Oct 09 2015 13:27

In such case:

var x = 0;
var myBool = false;
if (myBool)
    x = 2;
    x += 1;
console.out('Variable x =' + x + " not 3!");

Without braces formatting may look like there were two operations on variable x, but of course x===1 because condition is false and assigning value 2 to variable x is not valid.

Jas K
@jask84
Oct 09 2015 13:29
so x+=1 still stands?
Aleksander Gębicki
@Takumar
Oct 09 2015 13:30
@jask84 only x += 1 is executed because it really doesn't belong to if condition.
so it works like:
if (myBool) {
    x = 2;
}
x += 1;
@jask84 Do you know now what for are braces in if statements? Sometimes code looks simply clearer when they are used.
Jas K
@jask84
Oct 09 2015 13:33
@Takumar block of code inside the statement?
Aleksander Gębicki
@Takumar
Oct 09 2015 13:33
@jask84 yes for blocks of code for sure.
Jas K
@jask84
Oct 09 2015 13:33
@Takumar so does introducing braces for one statement cause problems?
Aleksander Gębicki
@Takumar
Oct 09 2015 13:34
@jask84 no, there is no problem with using braces everytime. When you don't use brases in case of one statement you only write less.
Code is shorter, you can see more code on the screen and read long blocks of code without scrolling.
When you see everything it is easier to check code than when you scroll up and down.
Jas K
@jask84
Oct 09 2015 13:36
@Takumar thanks a lot. You explained it very well
CamperBot
@camperbot
Oct 09 2015 13:36
jask84 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 419 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Oct 09 2015 13:38
@jask84 I will remember to ask you when I'll need help :+1: :smile:
Shilabhadra Sahu
@shilabhadra1979
Oct 09 2015 13:48
<ul>
<li class="red-text">Click here for</li>
<li 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.</li>
<li 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.</li>
</ul>
Any mistake done here?
PersonUvInterest0709
@PersonUvInterest0709
Oct 09 2015 13:51
@Takumar hey can you possible help me with prioritizing one style over another?
Aleksander Gębicki
@Takumar
Oct 09 2015 13:52
@shilabhadra1979 no there is no error in your fragment of code. Do you get any error?
@PersonUvInterest0709 what is your problem?
Sasa
@tanasic
Oct 09 2015 13:54
@shilabhadra1979 looks good.. ?
PersonUvInterest0709
@PersonUvInterest0709
Oct 09 2015 13:56
im trying to priotize pink text for my header over the css class style green for the same header line
im trying to priotize pink text for my header over the css class style green for the same header line @shilabhadra1979
Sasa
@tanasic
Oct 09 2015 13:57
@PersonUvInterest0709 you can always insert inline css ?
@PersonUvInterest0709 or you can make a pink text class and set it as !important
Miłosz Zalewski
@Tolinieg
Oct 09 2015 14:21

I think I have done something wrong in my code, but I don't know what exactly:
´´´
function palindrome(str) {
str.toLowerCase().replace(' ', '').replace('.', '').replace(',', '').replace('-', '');
if(str=str.split('').reverse().join('')) {
return true;
} else {
return false; //I think the problem is somewhere here, because it does never return false
}
};

palindrome("car");
´´´

...
You get my point, right?
Srikar Samudrala
@srikarsams
Oct 09 2015 14:22
Hey I dont know what to do. It's saying that i need to add space after "view more". But i already added ithttps://cloud.githubusercontent.com/assets/11839935/10396209/cdc33b42-6ebe-11e5-8f00-afdf216a0a79.png
Aleksander Gębicki
@Takumar
Oct 09 2015 14:22
@Tolinieg problem is in your condition.
Miłosz Zalewski
@Tolinieg
Oct 09 2015 14:22
What is wrong with my condition?
rickgordon86
@rickgordon86
Oct 09 2015 14:23
@Tolinieg use (/\W|_/g, '') to get rid of punctuation
Aleksander Gębicki
@Takumar
Oct 09 2015 14:23
@Tolinieg you don't compare strings, you assign reversed string to str.
str= str.split.... You should have: if (str === ....
Miłosz Zalewski
@Tolinieg
Oct 09 2015 14:24
What should I write to compare them?
Sasa
@tanasic
Oct 09 2015 14:24
@srikarsams what space ? what is your problem exactly ?
Miłosz Zalewski
@Tolinieg
Oct 09 2015 14:25
ok
Aleksander Gębicki
@Takumar
Oct 09 2015 14:25
@Tolinieg
var x = 1;  //assignment
if (x === 1)  // comparison
noobstar
@namsir
Oct 09 2015 14:25
@srikarsams you had 2 spaces...remove 1
Jason Wood
@catapixel
Oct 09 2015 14:26
@srikarsams leave the space after "View more" and remove the space before "cat photos"
Miłosz Zalewski
@Tolinieg
Oct 09 2015 14:27
ok, thanks @Takumar
CamperBot
@camperbot
Oct 09 2015 14:27
tolinieg sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 422 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Oct 09 2015 14:27
@Tolinieg , @rickgordon86 suggested you that you should use regular expressions to clear you string from unnecessary characters.
Miłosz Zalewski
@Tolinieg
Oct 09 2015 14:28
I used this:
str.toLowerCase().replace(' ', '').replace('.', '').replace(',', '').replace('-', '')
But it doesn't seem to work
noobstar
@namsir
Oct 09 2015 14:29
@Tolinieg use regex.
Jason Wood
@catapixel
Oct 09 2015 14:29
@Tolinieg that is because it doesn't cover all of the characters which need to be replaced. See @rickgordon86 's solution above
Miłosz Zalewski
@Tolinieg
Oct 09 2015 14:29
I don't know how to apply it
rickgordon86
@rickgordon86
Oct 09 2015 14:29
@Tolinieg str = str.replace(/\W|/g, '').toLowerCase(); // the (/\W|/g, '') removes anything thats not a letter or number
Miłosz Zalewski
@Tolinieg
Oct 09 2015 14:30
thanks @rickgordon86
CamperBot
@camperbot
Oct 09 2015 14:30
tolinieg sends brownie points to @rickgordon86 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for rickgordon86
noobstar
@namsir
Oct 09 2015 14:30
@Tolinieg you might want to do a little research about regular expression. it will help you for further challenges.
rickgordon86
@rickgordon86
Oct 09 2015 14:30
@Tolinieg then make a new var and compare them
Miłosz Zalewski
@Tolinieg
Oct 09 2015 14:31
I've read about replacement but not everything is clear to me
noobstar
@namsir
Oct 09 2015 14:32
string.replace(WhatYouWantToReplace, WhatYouReplacingWith)
Miłosz Zalewski
@Tolinieg
Oct 09 2015 14:33
And that's what I did, I think
Aleksander Gębicki
@Takumar
Oct 09 2015 14:33
@rickgordon86 str.replace(/\W|/g, '') will not remove underscores.
@Tolinieg read about regular expressions and return to this bonfire!
Jason Wood
@catapixel
Oct 09 2015 14:34
@Takumar it was just a mistype. @rickgordon86 's original code was (/\W|_/g, '')
Aleksander Gębicki
@Takumar
Oct 09 2015 14:34
@Tolinieg give yourself some time to understand simple expressions.
@catapixel I just wanted @Tolinieg to read about regexp, not only pasted ready regexp to his code.
Miłosz Zalewski
@Tolinieg
Oct 09 2015 14:35
Yeah, exactly. I'm trying to understand my mistakes.
Jason Wood
@catapixel
Oct 09 2015 14:35
@Takumar I totally agree. I was just pointing out the code because of your comment to @rickgordon86
noobstar
@namsir
Oct 09 2015 14:35
giving him the codes doesn't help him.
Aleksander Gębicki
@Takumar
Oct 09 2015 14:36
So, @Tolinieg maybe just read something about regexp presented here, that you will understand why @rickgordon86 did that in that way. Go to i.e. page http://regexr.com/ and try to experiment with that.
Miłosz Zalewski
@Tolinieg
Oct 09 2015 14:38
I did, but it's all gibberish to me. I don't know why, because all the previous sections seemed super easy and now I'm stuck with this bonfire
noobstar
@namsir
Oct 09 2015 14:39
@Tolinieg dude, watch this https://www.youtube.com/watch?v=CvBKX_UYslQ
rickgordon86
@rickgordon86
Oct 09 2015 14:40
yea the bonfires is were it gets alot harder
Jason Wood
@catapixel
Oct 09 2015 14:40
@Tolinieg or try this site: http://regexone.com/
Aleksander Gębicki
@Takumar
Oct 09 2015 14:41
@catapixel I was thinking about that site but I forgot the address :smile:
rickgordon86
@rickgordon86
Oct 09 2015 14:43
@catapixel thanks for the site
CamperBot
@camperbot
Oct 09 2015 14:43
rickgordon86 sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 433 | @catapixel | http://www.freecodecamp.com/catapixel
Miłosz Zalewski
@Tolinieg
Oct 09 2015 14:44
thanks @namsir
CamperBot
@camperbot
Oct 09 2015 14:44
tolinieg sends brownie points to @namsir :sparkles: :thumbsup: :sparkles:
:star: 208 | @namsir | http://www.freecodecamp.com/namsir
noobstar
@namsir
Oct 09 2015 14:44
@Tolinieg watch the rest of those videos and you will be pro with regular expressions :)
Miłosz Zalewski
@Tolinieg
Oct 09 2015 14:46
I will
noobstar
@namsir
Oct 09 2015 14:55
bonfire dna pairing
CamperBot
@camperbot
Oct 09 2015 14:55

:fire:Bonfire: DNA Pairing :link:

function pair(str) {
 return str;
}

pair("GCG");

The DNA strand is missing the pairing element. Match each character with the missing element and return the results as a 2d array.

more info:  bf details | bf links | hint

noobstar
@namsir
Oct 09 2015 14:55
bf details
CamperBot
@camperbot
Oct 09 2015 14:55

:fire:Bonfire: DNA Pairing :link:

function pair(str) {
 return str;
}

pair("GCG");
The DNA strand is missing the pairing element. Match each character with the missing element and return the results as a 2d array.
<a href="http://en.wikipedia.org/wiki/Base_pair">Base pairs</a> are a pair of AT and CG. Match the missing element to the provided character.
Return the provided character as the first element in each array.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
noobstar
@namsir
Oct 09 2015 14:58
i'm lost reading this wiki.
Coira Ellison
@Coira
Oct 09 2015 15:00
@namsir you stuck on what you have to do?
noobstar
@namsir
Oct 09 2015 15:01
i'm stuck on trying to understand the Base Pair
I don't see no patterns.
pair("ATCGA") should return [["A","T"],["T","A"],["C","G"],["G","C"],["A","T"]].
pair("TTGAG") should return [["T","A"],["T","A"],["G","C"],["A","T"],["G","C"]].
pair("CTCTA") should return [["C","G"],["T","A"],["C","G"],["T","A"],["A","T"]].
Coira Ellison
@Coira
Oct 09 2015 15:02
ah ok, so for 'A', you match to 'T', and for 'T' you match to 'A'
and same for C and G
Richard Cox
@RickCoxDev
Oct 09 2015 15:03
Anyone an expert on regular expressions?
M Used
@mildused
Oct 09 2015 15:03
I can try to help
Jason Wood
@catapixel
Oct 09 2015 15:03
@Stackclash not an expert but can probably help
noobstar
@namsir
Oct 09 2015 15:03
@Stackclash not expert but i think i can try to help
M Used
@mildused
Oct 09 2015 15:03
Nobody is really an expert in regex
Jason Wood
@catapixel
Oct 09 2015 15:03
agreed lol
Coira Ellison
@Coira
Oct 09 2015 15:03
:)
Richard Cox
@RickCoxDev
Oct 09 2015 15:03
bonfire palindrome
CamperBot
@camperbot
Oct 09 2015 15:03

: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

noobstar
@namsir
Oct 09 2015 15:04
@Coira lol thanks. hahahha that should be easy
CamperBot
@camperbot
Oct 09 2015 15:04
namsir sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 266 | @coira | http://www.freecodecamp.com/coira
Ademola Adegbuyi
@ooade
Oct 09 2015 15:04
Hi Guys
Richard Cox
@RickCoxDev
Oct 09 2015 15:04
I'm trying to write a regular expression to match any whitespace or punctuation and replace it with an empty string.
Aleksander Gębicki
@Takumar
Oct 09 2015 15:04
@Stackclash not try to expert but I think.
:-)
Bettina Schaden
@bSchaden
Oct 09 2015 15:04
Hello all
Jason Wood
@catapixel
Oct 09 2015 15:05
@Stackclash for that one you just need to find a piece of regex to replace all "non-word" characters and underscores with an empty string
there is regex specifically to do this...
Aleksander Gębicki
@Takumar
Oct 09 2015 15:05
Hello @bschaden. Have you wrote: "Hello world" already?
Richard Cox
@RickCoxDev
Oct 09 2015 15:07
what I have now is /\W|_/ but it only matches the first non-word character or underscore but not the others in the string.
rickgordon86
@rickgordon86
Oct 09 2015 15:07
link your code
Jason Wood
@catapixel
Oct 09 2015 15:08
@Stackclash you need to make it "global"
noobstar
@namsir
Oct 09 2015 15:08
/\W|_/ g
/\W|_/g
when you make it global it will eager to search.
JackSparrowthethird
@JackSparrowthethird
Oct 09 2015 15:10

function where(collection, source) {
var arr = [];
// What's in a name?
var keys = Object.keys(source);
for (var i = 0; i< collection.length; i++) {
var bool = true;
for (var y = 0; y < keys.length; y++) {
if (collection[i].hasOwnProperty(keys[y])==false) {
bool = false;
}
}
if (bool) {
arr.push(collection[i]);
}

}

return arr;
}

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

Jason Wood
@catapixel
Oct 09 2015 15:10
wiki format
CamperBot
@camperbot
Oct 09 2015 15:10

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

JackSparrowthethird
@JackSparrowthethird
Oct 09 2015 15:10
is there a bug, because in the bonfire, they say that the solution is not an array of objects
noobstar
@namsir
Oct 09 2015 15:10
@JackSparrowthethird please format the code so it's easier for us to read.
JackSparrowthethird
@JackSparrowthethird
Oct 09 2015 15:11
'''
CamperBot
@camperbot
Oct 09 2015 15:11
:bulb: to format code use backticks! ``` more info
JackSparrowthethird
@JackSparrowthethird
Oct 09 2015 15:11

'''
function where(collection, source) {
var arr = [];
// What's in a name?
var keys = Object.keys(source);
for (var i = 0; i< collection.length; i++) {
var bool = true;
for (var y = 0; y < keys.length; y++) {
if (collection[i].hasOwnProperty(keys[y])==false) {
bool = false;
}
}
if (bool) {
arr.push(collection[i]);
}

}

return arr;
}

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

CamperBot
@camperbot
Oct 09 2015 15:11
:bulb: to format code use backticks! ``` more info
noobstar
@namsir
Oct 09 2015 15:11
3 backticks and hit Enter then paste
JackSparrowthethird
@JackSparrowthethird
Oct 09 2015 15:11

'''
function where(collection, source) {
var arr = [];
// What's in a name?
var keys = Object.keys(source);
for (var i = 0; i< collection.length; i++) {
var bool = true;
for (var y = 0; y < keys.length; y++) {
if (collection[i].hasOwnProperty(keys[y])==false) {
bool = false;
}
}
if (bool) {
arr.push(collection[i]);
}

}

return arr;
}

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

CamperBot
@camperbot
Oct 09 2015 15:11
:bulb: to format code use backticks! ``` more info
noobstar
@namsir
Oct 09 2015 15:11
the ~ key?
not the one by enter.
JackSparrowthethird
@JackSparrowthethird
Oct 09 2015 15:11
damn sorry
Jason Wood
@catapixel
Oct 09 2015 15:12
@JackSparrowthethird this line is var keys = Object.keys(source); is not doing what you want it to when source has more than one key value pair
more explicitly...in the second test, source has more than one key value pair
Richard Cox
@RickCoxDev
Oct 09 2015 15:25
It worked.
Thanks @catapixel
CamperBot
@camperbot
Oct 09 2015 15:25
stackclash sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 435 | @catapixel | http://www.freecodecamp.com/catapixel
Richard Cox
@RickCoxDev
Oct 09 2015 15:26
Thanks @namsir
CamperBot
@camperbot
Oct 09 2015 15:26
stackclash sends brownie points to @namsir :sparkles: :thumbsup: :sparkles:
:star: 209 | @namsir | http://www.freecodecamp.com/namsir
noobstar
@namsir
Oct 09 2015 15:29
glad i could help
i'm a beginner myself :D
noobstar
@namsir
Oct 09 2015 15:37
bonfire missing letters
CamperBot
@camperbot
Oct 09 2015 15:37

:fire:Bonfire: Missing letters :link:

function fearNotLetter(str) {
  return str;
}

fearNotLetter('abce');

Find the missing letter in the passed letter range and return it.

more info:  bf details | bf links | hint

noobstar
@namsir
Oct 09 2015 15:37
bf hint
CamperBot
@camperbot
Oct 09 2015 15:37
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
noobstar
@namsir
Oct 09 2015 15:37
hint
CamperBot
@camperbot
Oct 09 2015 15:37
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
chstone
@chstone
Oct 09 2015 15:38
I am new to JavaScript. As I am completing the map, is there any resource to find alternate solutions? I am always curious to see how others solved and learn perhaps more elegant solutions.
Jason Wood
@catapixel
Oct 09 2015 15:39
There's another room called FreeCodeCamp/CodeReview. I would suggest you submit your code there an ask others to critique it for areas of improvement
chstone
@chstone
Oct 09 2015 15:39
Awesome, @catapixel ! Thanks!
CamperBot
@camperbot
Oct 09 2015 15:39
chstone sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 436 | @catapixel | http://www.freecodecamp.com/catapixel
noobstar
@namsir
Oct 09 2015 15:40
@catapixel how do i get there?
@catapixel cool got it...thanks
CamperBot
@camperbot
Oct 09 2015 15:40
namsir sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 437 | @catapixel | http://www.freecodecamp.com/catapixel
noobstar
@namsir
Oct 09 2015 15:41
is there a way to turn off new chat notifications?
lol got it :D
Brandon Mellus
@mels065
Oct 09 2015 15:44
Hey everyone! I don't expect a flat out explanation on how to implement this behavior, but does anyone know if it's implemented through Bootstrap or something else? It's when you have a picture on the screen that changes every few seconds, and you can click round circles at the bottom of the image to jump to a particular one. Here's an example of what I'm talking about: http://www.crunchyroll.com/
noobstar
@namsir
Oct 09 2015 15:45
@mels065 you can do that with css or javascript alone
Brandon Mellus
@mels065
Oct 09 2015 15:47
Ah, so it's called the Carousel plugin. I'll go take a look at it. Thanks for the help, @namsir and @catapixel !
CamperBot
@camperbot
Oct 09 2015 15:47
mels065 sends brownie points to @namsir and @catapixel :sparkles: :thumbsup: :sparkles:
:star: 211 | @namsir | http://www.freecodecamp.com/namsir
:star: 438 | @catapixel | http://www.freecodecamp.com/catapixel
Moisés Man
@moigithub
Oct 09 2015 16:04
any1 know a free TTS module ? (wanna make my app talks ) found one but voice sound pretty "robotic"
Tom Lorimer
@Ellf
Oct 09 2015 16:07
help Bonfire: Diff Two Arrays
CamperBot
@camperbot
Oct 09 2015 16:07

:point_right: bonfire diff two arrays [wiki]

Explanation:

Check two arrays and return a new array that contains only the items that are not in either of the original arrays.

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

chstone
@chstone
Oct 09 2015 16:13
@Ellf , I did that yesterday. I am new to JavaScript, but I can try to help.
DefinitelyHot
@DefinitelyHot
Oct 09 2015 16:16

hello, can u check this code and tell me where to put isNan function in the filter :) everything other work
function bouncer(arr) {
// Don't show a false ID to this bouncer.
function checkit(value){
return value !== 0 &&
value!== false &&
value!== "" &&
value !== isNaN() &&
value !== undefined &&
value !== null;
}
var secondarr = arr.filter(checkit);

return secondarr;
}

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

EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:16
@Ellf
do you understand what you need to do?
@DefinitelyHot do you understand what it means for something to be 'falsey'
Nic Galluzzo
@ngalluzzo
Oct 09 2015 16:18
hey guys, I’m working on a personal project for fun using Dropbox API.. simply allows you to select a file and upload to your own account. My design kind of sucks though… anyone looking to contribute feel free to msg me :)
DefinitelyHot
@DefinitelyHot
Oct 09 2015 16:18
yes , @EngineeredEdge and my bonefire work, but cant pass the NaN check, i googled it but cant find how to use it when its come to array, not just a number
EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:19
to directly answer your question, isNaN is a function
you pass isNaN a value, and it returns whether or not the value is a NaN
isNaN('real') = False
woops
DefinitelyHot
@DefinitelyHot
Oct 09 2015 16:20
i understand that, the point is that i dont know how to use it to work with filter and array
EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:21
hey could you link to the bonfire real quick for me
DefinitelyHot
@DefinitelyHot
Oct 09 2015 16:22
bonfire is Falsy Bouncer
CamperBot
@camperbot
Oct 09 2015 16:22
Sorry, can't find a bonfire called is falsy bouncer . [ Check the map? ]
EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:23
so
what you're doing is creating a bunch of booleans to check to make sure they are all true, correct?
to create that boolean you are going (value !== null) et cetera
isNaN is a function that returns a boolean
true if the value is NaN, false otherwise
DefinitelyHot
@DefinitelyHot
Oct 09 2015 16:25
so how to filter it out of an arra ["",0,false, Nan];?
EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:26
go to www.repl.it
what does isNaN(9) give you? what does isNaN(NaN) give you? What does isNaN('blah') give you?
Nikola Mitić
@JohneyCodeUp
Oct 09 2015 16:29
Has anyone ever work on non-profit project and if yes, can the person explain me how it went, what do I get from it when it's come to knowledge and expiriance?
DefinitelyHot
@DefinitelyHot
Oct 09 2015 16:30
@EngineeredEdge false, true, true should i go trough th ewhole array and check them with isNaN, and push it out ? if some value is NaN?
EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:31
why can't you just add it to your filter?
DefinitelyHot
@DefinitelyHot
Oct 09 2015 16:31
how ?
EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:31
your checkIt function?
?
function bouncer(arr) {
// Don't show a false ID to this bouncer.
    function checkit(value){
        return value !== 0 &&
        value!== false &&
        value!== "" &&
        !(isNaN(value)) &&
        value !== undefined &&
        value !== null;
        }
var secondarr = arr.filter(checkit);

return secondarr;
}
DefinitelyHot
@DefinitelyHot
Oct 09 2015 16:31
i dont understand the sintacsis
EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:31
i'm confused on what you don't understand
DefinitelyHot
@DefinitelyHot
Oct 09 2015 16:32
!(isNaN(value)) didint know that should i type it this way
that I was asking, I am beginner to js
Herman Fassett
@HermanFassett
Oct 09 2015 16:32
It's easier if you just use Boolean
EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:33
or easier still with just
DefinitelyHot
@DefinitelyHot
Oct 09 2015 16:33
@HermanFassett what did u mean
EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:34
@HermanFassett
function bouncer(arr) {
// Don't show a false ID to this bouncer.
    return arr.filter(function(x) {return x;});
}

bouncer([false, null, 0, NaN, undefined, ""])
DefinitelyHot
@DefinitelyHot
Oct 09 2015 16:34
@EngineeredEdge btw now my other checks of the bonefire didint pass , why is that when i type the isNan thing
EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:34
because isNaN('string') returns true
so you need to create a more complicated boolean
Herman Fassett
@HermanFassett
Oct 09 2015 16:34
returning the value of Boolean of value in your filter function should be all that's needed instead of all those other things
EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:35
@HermanFassett or just the value, because falsy values evaluate as falsy!
@DefinitelyHot like so
function bouncer(arr) {
// Don't show a false ID to this bouncer.
    function checkit(value){
        return value !== 0 &&
        value!== false &&
        value!== "" &&
        !(isNaN(value) && typeof(value) !== 'string') &&
        value !== undefined &&
        value !== null;
        }
var secondarr = arr.filter(checkit);

return secondarr;
}

bouncer([false, null, 0, NaN, undefined, ""])
bouncer([7, "ate", "", false, 9])
Sylvester
@impreze
Oct 09 2015 16:35
Is there anyone who can assist with the how-to-npm tasks? Experiencing a bug when adding a distribution tag.
Herman Fassett
@HermanFassett
Oct 09 2015 16:35
;) Cool I didn't see that @EngineeredEdge
Ariel
@ArielLeslie
Oct 09 2015 16:35
@EngineeredEdge That's more complicated than it needs to be.
EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:35
go up a little @ArielLeslie
DefinitelyHot
@DefinitelyHot
Oct 09 2015 16:36
well I get rly confused right now , @EngineeredEdge it worked your way, but didint understand the typeoff thing
Herman Fassett
@HermanFassett
Oct 09 2015 16:37
typeof just gets the type of the object
EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:37
@DefinitelyHot first, google "javascript typeof" read about it. it's a tool you should know how to use (especially in debugging)
Jason Wood
@catapixel
Oct 09 2015 16:37
That's answer is way to complicated for this one. Figure out why his earlier solution worked:
function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  return arr.filter(function(value) { return value; });
}

bouncer([7, "ate", "", false, 9], "");
EngineeredEdge
@EngineeredEdge
Oct 09 2015 16:38
^^^ you should definitely understand what it means for a value to be 'falsy'
but it's also worth figuring out how to chain boolean comparisons / expressions, in the way he's trying to do it
@DefinitelyHot Second, google "javascript Boolean" and think about how you can use that in your code
@DefinitelyHot Lastly, understand that 'falsy' means that Boolean(x) evalutates to false- read a litlte about that here: http://www.w3schools.com/js/js_booleans.asp
DefinitelyHot
@DefinitelyHot
Oct 09 2015 16:41
I will, thank you @EngineeredEdge
CamperBot
@camperbot
Oct 09 2015 16:41
definitelyhot sends brownie points to @engineerededge :sparkles: :thumbsup: :sparkles:
:star: 373 | @engineerededge | http://www.freecodecamp.com/engineerededge
PabloPap
@PabloPap
Oct 09 2015 16:57
my code for bonfire:binary agents gives me correct answer in repl.it and webstorm ide's but not here in exercise's page.
can i pots here my code?
*post
Jason Wood
@catapixel
Oct 09 2015 17:03
@PabloPap let's see your code
Rita M
@lizette112162
Oct 09 2015 17:11
I am hung up on Javascript: Waypoint: Generate Random Whole Numbers within a Range Waypoint Lesson 31. This is my code: Math.floor(Math.random() * (max + 1 - min)) + min.
Based on the test run:The random number generated by myFunction should be an integer, not a decimal. I am not quite sure how to fix it.
Herman Fassett
@HermanFassett
Oct 09 2015 17:13
They give you the random code in the description I think
Bettina Schaden
@bSchaden
Oct 09 2015 17:13
Hi, I'm having trouble with Waypoint: Add Borders Around your Elements. It says border width is not right.
.thick-green-border { border-color: green; border-width: 10px; border-style: solid; }
Jason Wood
@catapixel
Oct 09 2015 17:13
@lizette112162 you need return before the code they supply:
var min = 0;
var max = 9;
function myFunction() {
  // Make myFunction return a random number between zero and nine instead of a decimal
  // Only change code below this line.

  return Math.floor(Math.random() * (max - min + 1)) + min;
}

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return myFunction();})();
Bettina Schaden
@bSchaden
Oct 09 2015 17:14
@Takumar Yes, I've been here before. Do I have to do it every time?
Herman Fassett
@HermanFassett
Oct 09 2015 17:15
@bschaden that code works for me...
Bettina Schaden
@bSchaden
Oct 09 2015 17:16
@HermanFassett weird, it won't let me go on.
Herman Fassett
@HermanFassett
Oct 09 2015 17:16

So you have

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

With that added to your image? Cause that's all I need to do to submit.

Bettina Schaden
@bSchaden
Oct 09 2015 17:17
It does look right in the preview.
How do you make your code look like that in the chat?
Yes, that's what I have.
Herman Fassett
@HermanFassett
Oct 09 2015 17:17
wiki code format
CamperBot
@camperbot
Oct 09 2015 17:17

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

PabloPap
@PabloPap
Oct 09 2015 17:18
function binaryAgent(str) {
    function getText(element){
        element = parseInt(element,2);
        return String.fromCharCode(element);
    }
    var arr = str.split(" ");
    arr.forEach(getText);
}
Bettina Schaden
@bSchaden
Oct 09 2015 17:19
Give your image a border width of 10px. that's the only checkmark I'm not getting
Huh, I did three back ticks and it showed inline in the chat.
Jason Wood
@catapixel
Oct 09 2015 17:20
@bschaden I'm running into the same error. I'm guessing it's a problem with the assert for the test. Looking into it now.
This code doesn't pass the "Give your image a border width of 10px" test:
<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="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Bettina Schaden
@bSchaden
Oct 09 2015 17:20
Thanks, @catapixel
CamperBot
@camperbot
Oct 09 2015 17:20
bschaden sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 439 | @catapixel | http://www.freecodecamp.com/catapixel
Rita M
@lizette112162
Oct 09 2015 17:21
@catapixel thanks!
CamperBot
@camperbot
Oct 09 2015 17:21
lizette112162 sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 440 | @catapixel | http://www.freecodecamp.com/catapixel
Bettina Schaden
@bSchaden
Oct 09 2015 17:23
should I report a bug?
Herman Fassett
@HermanFassett
Oct 09 2015 17:25
@bschaden I guess. That code works for me.
You could always reset or clear your cache and try again but it should work
Jason Wood
@catapixel
Oct 09 2015 17:28
@bschaden Looks like this is a know issue with Chrome and Firefox. Code works in IE. FreeCodeCamp/FreeCodeCamp#3204
Bettina Schaden
@bSchaden
Oct 09 2015 17:29
Ugh. IE????? Seriously???
I don't even have that installed! LOL!
Jason Wood
@catapixel
Oct 09 2015 17:29
I'm reading through the issue to confirm...
Herman Fassett
@HermanFassett
Oct 09 2015 17:32
Hmm works fine on chrome for me
Jason Wood
@catapixel
Oct 09 2015 17:32
@bschaden identified the issue and how to work around/through it after reading the ticket. The issue is how the sizing is being computed. If the zoom on your browser window is 100% you will pass with the code you have written. If you zoom in or out (I was at 75%) it will not.
Herman Fassett
@HermanFassett
Oct 09 2015 17:32
lol
Jason Wood
@catapixel
Oct 09 2015 17:33
After I reset to 100% zoom and ran the code I passed in Chrome no problem
Bettina Schaden
@bSchaden
Oct 09 2015 17:33
trying...
Jason Wood
@catapixel
Oct 09 2015 17:33
went back to 75%, ran the same code, and failed at the same point
Bettina Schaden
@bSchaden
Oct 09 2015 17:34
Zoom was set to 100% in Firefox window. Not working.
In fact, I also reset code and tried again, and now I'm not getting any checks except first one which is from previous waypoint.
Jason Wood
@catapixel
Oct 09 2015 17:36
@bschaden I just ran it on Firefox (Windows 7) and passed without issue.
can you copy your code here so I can see
Here is my exact passing code at 100% zoom in Chrome and Firefox on Windows 7:
<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="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Bettina Schaden
@bSchaden
Oct 09 2015 17:41
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
I found what was causing the others not to check, but I still don't get that border width check.
Jason Wood
@catapixel
Oct 09 2015 17:44
@bschaden at 100% in both Chrome and Firefox your code passes all tests as written. I would copy your code to the clipboard, confirm the browser is at 100%, reset the waypoint, paste your code back in, and run the tests. Let me know what happens...
Bettina Schaden
@bSchaden
Oct 09 2015 17:47
Nothing. By 100% you mean checking in the menu in the top right, correct?
Ok, I just tried it in Chrome and it worked. Pasted the exact same code.
@catapixel thanks
CamperBot
@camperbot
Oct 09 2015 17:49
bschaden sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:warning: bschaden already gave catapixel points
Jason Wood
@catapixel
Oct 09 2015 17:49
Yes, that's it. Ctrl+0 also works to reset the view to 100% in either browser...Glad you got it to pass
Bettina Schaden
@bSchaden
Oct 09 2015 17:50
Seems to be Firefox only for me. It was 100% for sure.
Anders Bengtsson
@anders462
Oct 09 2015 17:55
Web Portfolio: Background Images responsive? Still struggling to get this one right. How do I make the background images responsive? For example, the content in the portfolio container, will float into the next section when smaller screen width. I want the background image for that section to adjust to contain the portfolio elements....
Tyler Moeller
@TylerMoeller
Oct 09 2015 18:20
@anders462 Try changing background-size: 100% 100%; to background-size: cover;
AnbuKakashi
@AnbuKakashi
Oct 09 2015 18:38
@anders462 did you use paralax for that?
btw it looks good
Edgar S. Hurtado
@edgarshurtado
Oct 09 2015 18:39
@anders462 verify you email in order to let us view your portfolio full page mode =P
Samuil
@Samuil1914
Oct 09 2015 18:39
i'm stuck on 1 of chalanges pls help!
Edgar S. Hurtado
@edgarshurtado
Oct 09 2015 18:39
@Samuil1914 which one?
Samuil
@Samuil1914
Oct 09 2015 18:41
@edgarshurtado uncomment HTML
Edgar S. Hurtado
@edgarshurtado
Oct 09 2015 18:41
mmm, let me see
ok
paste here your link plz
Edgar S. Hurtado
@edgarshurtado
Oct 09 2015 18:42
but you have to erese just <!—and —>
Samuil
@Samuil1914
Oct 09 2015 18:43
аха
Edgar S. Hurtado
@edgarshurtado
Oct 09 2015 18:43
erease*
you have just closed the tags. erease them and will work
Samuil
@Samuil1914
Oct 09 2015 18:44
ok tnx
CamperBot
@camperbot
Oct 09 2015 18:44
if you want to thank someone, put an @ before their name!
AnbuKakashi
@AnbuKakashi
Oct 09 2015 18:46
ok now i have a question bout html and css
can you make a website scrolable with just using html and css
Matt Everson
@matteverson
Oct 09 2015 18:48
scrollable? Just make your content longer than the viewport...what do you mean?
Samuil
@Samuil1914
Oct 09 2015 18:48
@edgarshurtado pleace send me a photo becouse a don't understand i am a new
AnbuKakashi
@AnbuKakashi
Oct 09 2015 18:49
@matteverson li ke icreate a header and footer and a few articles in between
so i want to scrool the articles and then reach the footer
Robin Ellzey
@rellzey
Oct 09 2015 18:50
Hello, I am on Waypoint: Nest an Anchor in a paragraph. I am getting the error "Your p element should have the text "View more " (with a space after it)." here is my code:
Matt Everson
@matteverson
Oct 09 2015 18:50
Ah, sticky header and footer. Yes, that can be done with css alone
Robin Ellzey
@rellzey
Oct 09 2015 18:50
<p class="red-text">
View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>
AnbuKakashi
@AnbuKakashi
Oct 09 2015 18:50
not have it locked on bot of wievport
do i just need morearticles?
Edgar S. Hurtado
@edgarshurtado
Oct 09 2015 18:50
@Samuil1914 you have to erease what the red arrows are pointing
all that lines, out! :smile:
Matt Everson
@matteverson
Oct 09 2015 18:52
@AnbuKakashi If you don't want the footer locked on the bottom, then just make it part of your content that goes on the bottom. If you want your content div to be taller so it scrolls no matter what's inside, you'll want to set an explicit height.
@AnbuKakashi http://www.w3schools.com/cssref/pr_dim_min-height.asp might be what you're looking for.
If you have more content the div will be taller, otherwise it will be at least that tall.
Joe Hill
@cupofjoey
Oct 09 2015 18:54
Hi guys. Has anyone gotten to the algorithm scripting sections yet?
AnbuKakashi
@AnbuKakashi
Oct 09 2015 18:54
@matteverson i will take a loook a that thank you
CamperBot
@camperbot
Oct 09 2015 18:54
anbukakashi sends brownie points to @matteverson :sparkles: :thumbsup: :sparkles:
:star: 399 | @matteverson | http://www.freecodecamp.com/matteverson
Matt Everson
@matteverson
Oct 09 2015 18:54
@rellzey Try removing the new line after the first <p> tag
@cupofjoey yes
Joe Hill
@cupofjoey
Oct 09 2015 18:55
I'm really having a hard time with them. I can't get anywhere near the answers with some of them. I'm typing in the problems into google and getting answers that way. seems like cheating
is there anything I can do to study these methods closer?
Matt Everson
@matteverson
Oct 09 2015 18:57
Are you having trouble coming up with how you'd get an answer (an algorithm) or how you would get javascript to carry out that plan (implementation)?
Anders Bengtsson
@anders462
Oct 09 2015 18:59
@edgarshurtado Thanks, I just did it now!
CamperBot
@camperbot
Oct 09 2015 18:59
anders462 sends brownie points to @edgarshurtado :sparkles: :thumbsup: :sparkles:
:star: 183 | @edgarshurtado | http://www.freecodecamp.com/edgarshurtado
Joe Hill
@cupofjoey
Oct 09 2015 18:59
both to be honest. well getting javascript to split the arrays and such isn't the problem. I know how to do that, but getting an algorithm to solve the problem and writing that into JS is the issue
its a bit of a big wall to be honest. haven't coded much in the last week and a half because of it
Matt Everson
@matteverson
Oct 09 2015 19:00
Take a look at the functions they link to in each problem description. Those are hints toward potential solutions. In the helpbonfire room here you can get further hints.
CamperBot
@camperbot
Oct 09 2015 19:00
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Matt Everson
@matteverson
Oct 09 2015 19:01
With those pieces you should begin to be able to see the bricks in the big wall.
Joe Hill
@cupofjoey
Oct 09 2015 19:01
I do look at the functions and that is a help, but I'll look at the helpbonfire definitely.
CamperBot
@camperbot
Oct 09 2015 19:01
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Matt Everson
@matteverson
Oct 09 2015 19:01
@camperbot Yes, the bot there can provide hints. Start with bonfire name, like it's talking about here :)
Joe Hill
@cupofjoey
Oct 09 2015 19:02
sounds good. i've been going along alone for so long I forgot about the chat room. I'll lean on that a bit more too
Anders Bengtsson
@anders462
Oct 09 2015 19:04
@TylerMoeller Tried that and I am afraid it doesn't change anything
Tyler Moeller
@TylerMoeller
Oct 09 2015 19:04
@anders462 When I change it in your pen, it works for me.
mjeff7
@mjeff7
Oct 09 2015 19:05
Regarding position: absolute, does anyone understand the point relative to which it is positioned? It appears to not be as simple as the first of the ancestors not having position: static.
Tyler Moeller
@TylerMoeller
Oct 09 2015 19:05
@anders462 Try this:
/*container 1 styling*/
.cont_1 {
  height: 755px;
  background-image: url("http://cdn1.3dtotal.com/admin/new_cropper/gallery_originals/2012-04-21(62444)_office_space.jpg");
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}
Johnny Garces
@jginbound
Oct 09 2015 19:05
hey campers- i have a question about the slot machine exercise in basic javascript waypoints. Why do we have to call the function like this:
```
Tyler Moeller
@TylerMoeller
Oct 09 2015 19:05
@anders462 The last line is the one that needs to change
Anders Bengtsson
@anders462
Oct 09 2015 19:06
@AnbuKakashi No I just defined 4 containers and each one has their own background image
Johnny Garces
@jginbound
Oct 09 2015 19:06
 $(document).ready(function(){
     $('.go').click(function(){
       runSlots();
     });
   });
why call the function like this instead of:
$('.go').click(runSlots());
Edgar S. Hurtado
@edgarshurtado
Oct 09 2015 19:07
You’re welcome @anders462 =). Happy to help
Matt Everson
@matteverson
Oct 09 2015 19:08
@jginbound You could, you'd change that to just runSlots though, no parens at the end of it.
@jginbound $('.go').click(runSlots);
Johnny Garces
@jginbound
Oct 09 2015 19:08
ahh I'll give it a shot @matteverson
interesting, b/c we're taught to call functions by including parens
Matt Everson
@matteverson
Oct 09 2015 19:09
Otherwise you're running runSlots and placing its return value (probably undefined) as the click handler.
In this case you don't want to call the function, you want to give jquery its address.
So jquery can call it later.
Anders Bengtsson
@anders462
Oct 09 2015 19:11
@TylerMoeller Try making the browser window smaller, eventually, the social buttons floats into the "about" sections backgorund image. I didn't see any difference when i changed to background-size: cover;?
Johnny Garces
@jginbound
Oct 09 2015 19:11
it worked!
Tyler Moeller
@TylerMoeller
Oct 09 2015 19:13
@anders462 I misunderstood your question. Your background image was not scaling correctly on smaller screens. That's fixed for the first background image now that you are using cover. Otherwise, it gets all skinny and stretched out looking. I'll look at the buttons now.
@anders462 Take your buttons out of the <li> list and use a <span> instead. If you want them all in the same row, there is no need to put them in a column.
Johnny Garces
@jginbound
Oct 09 2015 19:14
thanks again @matteverson
CamperBot
@camperbot
Oct 09 2015 19:14
jginbound sends brownie points to @matteverson :sparkles: :thumbsup: :sparkles:
:star: 400 | @matteverson | http://www.freecodecamp.com/matteverson
Anders Bengtsson
@anders462
Oct 09 2015 19:21
@TylerMoeller Your right it doesn't but that should't affect my problem? I still have the issue with very narrow screens, and content overflowing. Most visible on "portfolio" section I guess
Tyler Moeller
@TylerMoeller
Oct 09 2015 19:24
@anders462 Background image and buttons are separate, yes. All of those overflow issues are because you are not using Bootstrap Grids correctly. Take a good look at this: https://getbootstrap.com/examples/grid/
@anders462 This was also a useful article for me with the "Try it" section to play around and see how it works: http://www.w3schools.com/bootstrap/bootstrap_grid_system.asp
Anders Bengtsson
@anders462
Oct 09 2015 19:28
@TylerMoeller I will try for sure.
Mateo Pool
@IAmMyself
Oct 09 2015 19:34
This message was deleted
This message was deleted
This message was deleted
Is there anything wrong with this code?
This message was deleted
function sumAll(arr) {
  var x = 0;
  for (var i = Math.min(arr[0], arr[1]); i <= Math.max(arr[0], arr[1]); i++) {
    x += i;
  }
  return x;
}

sumAll([1, 4]);
Knut Jackowski
@doxanthropos
Oct 09 2015 19:40
@IAmMyself It seems to work fine.
Kishore Kumar Vaishnav
@kishorevaishnav
Oct 09 2015 19:40
is there any chat room available for immutable.js ?
Mateo Pool
@IAmMyself
Oct 09 2015 19:42
Knut Jackowski
@doxanthropos
Oct 09 2015 19:42
@IAmMyself Which one of the test fails?
Mateo Pool
@IAmMyself
Oct 09 2015 19:42
It isn't even trying
Knut Jackowski
@doxanthropos
Oct 09 2015 19:44
@IAmMyself I just pasted it in and it worked. Maybe there is a glitch with this bonfire and your browser? The code seems to be okay.
Barna Farkas
@bearbox
Oct 09 2015 19:44
Hey guys, first time asking a question here. I'm just starting jQuery, and wondering, howcome when adding animations to a class with $().addClass(), button doesn't need a . before it but well (and text-primary) does?
<script>
  $(document).ready(function() {
    $(".well").addClass("animated shake");
    $(".text-primary").addClass("animated shake");
    //why does button not need a "." in front of it, while well and text-primary do?
    $("button").addClass("animated bounce");   
  });

</script>
@IAmMyself try hard reload on your browser, or a different browser...maybe that will work. I had an instance where my main browser wouldn't run the tests.
Knut Jackowski
@doxanthropos
Oct 09 2015 19:45
@bearbox The "." signifies a class. So ".text-primary" is a class. While "button" is the html element <button>. Like in css.
Mateo Pool
@IAmMyself
Oct 09 2015 19:45
Already tried a hard refresh, didn't work
AM trying a different browser now
Barna Farkas
@bearbox
Oct 09 2015 19:46
@doxanthropos Thank you!
CamperBot
@camperbot
Oct 09 2015 19:46
bearbox sends brownie points to @doxanthropos :sparkles: :thumbsup: :sparkles:
:star: 265 | @doxanthropos | http://www.freecodecamp.com/doxanthropos
Chris
@Shifthawke
Oct 09 2015 19:46
@doxanthropos Wonderful explanation. I fumbled for a moment thinking of how to describe it lol.
Knut Jackowski
@doxanthropos
Oct 09 2015 19:47
@bearbox @Shifthawke That's one of the cool things about jQuery: It works very similar to CSS, so if you know one, you can use the knowledge for the other.
Mateo Pool
@IAmMyself
Oct 09 2015 19:48
Different browser did the same thing
It isn't even showing me the tests
Knut Jackowski
@doxanthropos
Oct 09 2015 19:50
@IAmMyself That's strange. I copied your code exactly like it is into the box of the bonfire and it just worked.
Barna Farkas
@bearbox
Oct 09 2015 19:50
Interesting, will have to learn more CSS/jQuery! :)
Mateo Pool
@IAmMyself
Oct 09 2015 19:51
This message was deleted
Knut Jackowski
@doxanthropos
Oct 09 2015 19:51
@IAmMyself I had sometimes bonfires, where the tests appeared very slow.
Mateo Pool
@IAmMyself
Oct 09 2015 19:52
blob
Knut Jackowski
@doxanthropos
Oct 09 2015 19:52
@IAmMyself Just to make sure (don't laugh): You did click on the run button?
Mateo Pool
@IAmMyself
Oct 09 2015 19:52
Yes
Knut Jackowski
@doxanthropos
Oct 09 2015 19:52
@IAmMyself If so, maybe try the ctrl+return?
Mateo Pool
@IAmMyself
Oct 09 2015 19:53
Nope, not working
Hold on I'm gonna reboot my computer, see if that works.
Knut Jackowski
@doxanthropos
Oct 09 2015 19:54
@IAmMyself I wish you luck ;)
Chris
@Shifthawke
Oct 09 2015 19:56
@doxanthropos Lol, I know you were being serious but this made me think of the joke about a guy who couldn't get his pc to work... And the power was out lol
Graham Whitley
@lotusgraham
Oct 09 2015 19:58

Heeey, asipring bonfire noob here:

when i post this in my console i get a ‘olleh’ and all is good. BUT when i take it to the bonfire room i get WRONG! Help?? what am i doing wrong here?

function reverseString(str) {

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

console.log(arr);

}

reverseString('hello');

Knut Jackowski
@doxanthropos
Oct 09 2015 20:00
@Shifthawke I have to admit, I work as technical support for a learning management system at a university. We have all watched and found true the jokes from the IT Crowd TV show ("Have you tried turning it off and on again?"). But you would be surprised, how often the solution to a seemingly mysterious problem is something very simple that was just overlooked.
Aleksandar B.
@aleksandar-b
Oct 09 2015 20:00
@lotusgraham you have to return not console.log it.
Mateo Pool
@IAmMyself
Oct 09 2015 20:01
K guys, I rebooted, and it still isn't working
Knut Jackowski
@doxanthropos
Oct 09 2015 20:02
@IAmMyself Then I really have no idea. You might file a bug report.
Mateo Pool
@IAmMyself
Oct 09 2015 20:02
Thanks for trying
CamperBot
@camperbot
Oct 09 2015 20:02
if you want to thank someone, put an @ before their name!
Chris
@Shifthawke
Oct 09 2015 20:03
@doxanthropos -Nods- I had that #notfeelingsmart moment the other. Couldn't figure out why my keyboard wasn't working on my ps3... Remembered after two minutes of going from 0-60, that I had plugged it up to my pc... Which solved the problem of my random fb posts as well. -sigh-. What having a head cold will do to you.
@IAmMyself What browser did you try?
Mateo Pool
@IAmMyself
Oct 09 2015 20:03
@Shifthawke Both chrome and edge
Chris
@Shifthawke
Oct 09 2015 20:04
Oh. Never mind then. I know there were some way points that would only work in edge.
Graham Whitley
@lotusgraham
Oct 09 2015 20:05

function reverseString(str) {

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

return str;

}

reverseString('hello');

still doesn’t work right
Knut Jackowski
@doxanthropos
Oct 09 2015 20:05
@IAmMyself I have most of the time the best experience here with Firefox. If you still have the nerve to try it, it might be worth a shot. Otherwise you can be assured, that the code you posted here is correct and do something that gets you to move on (the next bonfire or a zipline or something) ;)
@lotusgraham You could get an idea, what is wrong with this one, if you compare it with the one where you console logged it.
Mateo Pool
@IAmMyself
Oct 09 2015 20:07
@doxanthropos @Shifthawke Thanks for trying
CamperBot
@camperbot
Oct 09 2015 20:07
iammyself sends brownie points to @doxanthropos and @shifthawke :sparkles: :thumbsup: :sparkles:
:star: 412 | @shifthawke | http://www.freecodecamp.com/shifthawke
:star: 266 | @doxanthropos | http://www.freecodecamp.com/doxanthropos
Spondon Kundu
@nodnops164
Oct 09 2015 20:07

Hi All,
I am on Bonfire: Seek and Destroy

I have written a code which is fulfilling all the given tests, but still it is not getting accepted

Code:

function destroyer(arr) {
// Remove all the values

var arr1 = arguments;
console.log(arr1.length);
var i =1;
var filtered = 0;
while(i < arr1.length-1){
filtered = arr.filter(function x(element,index,array){
// console.log(arguments);
return element != arr1[i];
});
arr = filtered;
i++;
}
//console.log(arguments);
return filtered;
}

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

Can someone tell me why this is happening ?

Thanks :)

marzelin
@marzelin
Oct 09 2015 20:10
@nodnops164 paste here the url from your browser
Graham Whitley
@lotusgraham
Oct 09 2015 20:14
yeah it works on my console but doesn’t in the codecamp thingy
why’s that again?
Herman Fassett
@HermanFassett
Oct 09 2015 20:15
@nodnops164 you should only need to call the filter function once without a loop
AnbuKakashi
@AnbuKakashi
Oct 09 2015 20:15
hey guys got a question about headers and footers
Herman Fassett
@HermanFassett
Oct 09 2015 20:15
Though you'll need to change your filter function itself
Spondon Kundu
@nodnops164
Oct 09 2015 20:16
@HermanFassett Okay, I understand that there is an optimised version of the code I provided
Nevertheless if some code is fulfilling all tests, it should work right ?
Herman Fassett
@HermanFassett
Oct 09 2015 20:17
It's not fulfilling it for me
Knut Jackowski
@doxanthropos
Oct 09 2015 20:17
@nodnops164 I just ran the first test offline on my machine and the result was: [ 1, 3, 1, 3 ] where it should have been [1,1]. So I would say, it does not really fulfill the tests.
Tyler Moeller
@TylerMoeller
Oct 09 2015 20:18
What is the << called in this: for (j = i << 1; j <= num; j += i)?
Herman Fassett
@HermanFassett
Oct 09 2015 20:18
@nodnops164 the reason your code is working is because of the extra "" in the arguments sent to the function. When you remove that it doesn't remove the last given argument
And the tests don't have that blank last argument
AnbuKakashi
@AnbuKakashi
Oct 09 2015 20:18
@anders462 thank you
CamperBot
@camperbot
Oct 09 2015 20:18
anbukakashi sends brownie points to @anders462 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for anders462
Herman Fassett
@HermanFassett
Oct 09 2015 20:19
@nodnops164 change your while to simply less than arr1.length and it should work
AnbuKakashi
@AnbuKakashi
Oct 09 2015 20:19
@matteverson are you stil here?
Spondon Kundu
@nodnops164
Oct 09 2015 20:20
@doxanthropos Thanks for trying @HermanFassett Thats right, thanks for pointing that out :)
It is working now :D
CamperBot
@camperbot
Oct 09 2015 20:20
nodnops164 sends brownie points to @doxanthropos and @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 267 | @doxanthropos | http://www.freecodecamp.com/doxanthropos
:star: 339 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Oct 09 2015 20:21
Yep
Tyler Moeller
@TylerMoeller
Oct 09 2015 20:25
Got it. Shift Left Operator: <<, so for (j = i << 1; j <= num; j += i) is the same as for (j = i *i; j <= num; j += i)
Peter
@ObaPeter
Oct 09 2015 20:26
please how do i add the button to tweet out content in the zipline build a random quote machine
Tyler Moeller
@TylerMoeller
Oct 09 2015 20:27
@ObaPeter Here's a good resource on adding buttons with bootstrap: http://www.w3schools.com/bootstrap/bootstrap_ref_css_buttons.asp
Nikola Mitić
@JohneyCodeUp
Oct 09 2015 20:27
Hey good people, this is a great way for understanding how true and false work in JS, i have made this just a sec before. Check it out.
https://jsfiddle.net/JohneyCodeUp/rnkxyacf/6/
Mateo Pool
@IAmMyself
Oct 09 2015 20:33
Hey guys, it's me again, none of the Bonfires are working, any idea why?
This message was deleted
Nor are any of the JS Waypoints working
Knut Jackowski
@doxanthropos
Oct 09 2015 20:42
@IAmMyself They seem to work for me, but the Console prints some error messages.
Mike G.
@mgraham134
Oct 09 2015 20:45
Anyone available for a quick question regarding the JS .pop function?
Mateo Pool
@IAmMyself
Oct 09 2015 20:45
My console has no error messages
@doxanthropos
Knut Jackowski
@doxanthropos
Oct 09 2015 20:46
@IAmMyself Did you look into the security warnings?
Mateo Pool
@IAmMyself
Oct 09 2015 20:46
I have no warnings either
My console is completely blank
Knut Jackowski
@doxanthropos
Oct 09 2015 20:50
@IAmMyself I posted the output I saw in github thread.
Mateo Pool
@IAmMyself
Oct 09 2015 20:50
OK
Thanks again for all the help
CamperBot
@camperbot
Oct 09 2015 20:51
if you want to thank someone, put an @ before their name!
Juan Riquelme
@soulchainer
Oct 09 2015 20:58
@mgraham134 What about it?
Mike G.
@mgraham134
Oct 09 2015 21:00
@soulchainer myArray.pop(); isn't working
Juan Riquelme
@soulchainer
Oct 09 2015 21:01
Define "isn't working". What do you want to get and what do you get? And what do you do, exactly.
(Or show some code that "isn't working").
Mike G.
@mgraham134
Oct 09 2015 21:02
trying to enter the code now
var myArray = ["John", 23, ["cat", 2]];
myArray.pop();
Juan Riquelme
@soulchainer
Oct 09 2015 21:03
wiki format
CamperBot
@camperbot
Oct 09 2015 21:03

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Juan Riquelme
@soulchainer
Oct 09 2015 21:03
and... you want to... ?
That code only removes the last element of myArray, which, in that case, is ["cat", 2], if I'm not wrong.
Mike G.
@mgraham134
Oct 09 2015 21:05
Right, I'm trying to remove the last item
Juan Riquelme
@soulchainer
Oct 09 2015 21:05
(It also returns that element, but, how you aren't asigning it to a variable, that value is missing
ah
Mateo Pool
@IAmMyself
Oct 09 2015 21:05
Is this for a specific challenge? @mgraham134
Juan Riquelme
@soulchainer
Oct 09 2015 21:05
and ["cat", 2] isn't removed? Umm.. I will try.
Mike G.
@mgraham134
Oct 09 2015 21:06
@IAmMyself it's for one of the JS lessons