These are chat archives for FreeCodeCamp/Help

3rd
Nov 2015
jpjenkins
@jpjenkins
Nov 03 2015 00:04
test
find whole
sarahunter
@sarahunter
Nov 03 2015 00:08
hint Construct JavaScript Objects with Functions
CamperBot
@camperbot
Nov 03 2015 00:08
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Quincy Larson
@QuincyLarson
Nov 03 2015 00:08
thanks @bektasuteubekov for helping :)
CamperBot
@camperbot
Nov 03 2015 00:08
quincylarson sends brownie points to @bektasuteubekov :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for bektasuteubekov
Quincy Larson
@QuincyLarson
Nov 03 2015 00:09
thanks @jpjenkins
CamperBot
@camperbot
Nov 03 2015 00:09
quincylarson sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
:star: 189 | @jpjenkins | http://www.freecodecamp.com/jpjenkins
Quincy Larson
@QuincyLarson
Nov 03 2015 00:09
OK - camperbot is working again. :)
Aniruddh Agarwal
@anrddh
Nov 03 2015 00:10
Finally!
Boris
@boris-in-london
Nov 03 2015 00:11
little guy had a sick day huh?
Matthew Vogel
@matthewsvm
Nov 03 2015 00:13
thanks @camperbot
CamperBot
@camperbot
Nov 03 2015 00:13
matthewsvm sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 479 | @camperbot | http://www.freecodecamp.com/camperbot
sarahunter
@sarahunter
Nov 03 2015 00:14
hey hey
i'm having trouble with Waypoint: Make Object Properties Private
Rafal Rudzinski
@rrudzinski
Nov 03 2015 00:16
I am trying to remove all special characters and spaces from a string and convert to lower case. I thought I could you replace() function with regex to do this, I can’t seem to figure out why it’s not working. I am using a character class that is negated with range a-z, shouldn’t this create a new string “neveroddoreven” ?
var str="Never odd or even##";

str=str.replace(/^[a-z]/).toLowerCase();

console.log(str);
sarahunter
@sarahunter
Nov 03 2015 00:19

'''var Bike = function() {

// Only change code below this line.

var myBike = function(){

};
this.getSpeed = function(){};
this.speed = 100;

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

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

};

// Only change code above this line.
'''

CamperBot
@camperbot
Nov 03 2015 00:19
:bulb: to format code use backticks! ``` more info
sarahunter
@sarahunter
Nov 03 2015 00:19
var Bike = function() { // Only change code below this line. var myBike = function(){ }; this.getSpeed = function(){}; this.speed = 100; function addUnit(value) { return value + "KM/H"; } getSpeed = function () { return addUnit(speed); }; }; // Only change code above this line.
var Bike = function() {

// Only change code below this line.

var myBike = function(){
};

this.getSpeed = function(){};
this.speed = 100;

function addUnit(value) {
return value + "KM/H";
}
getSpeed = function () {
return addUnit(speed);
};
};
// Only change code above this line.
sorry about that formatting, anyway, I can't seem to figure out what the correct syntax is to "See if you can keep myBike.speed and myBike.addUnit private, while making myBike.getSpeed publicly accessible."
so i got the getSpeed thing
but then i don't understand what to do for myBike.speed or myBike.addUnit. I tried defining them as variables var = speed, i tried using an object var myBike = { "speed":; "addUnit":; };
those things don't work
Rafal Rudzinski
@rrudzinski
Nov 03 2015 00:26
@sarahunter you don’t need to create another constructor myBike, you need to edit Bike and make spee and addUnit private and getSpeed public
sarahunter
@sarahunter
Nov 03 2015 00:28
@rrudzinski okay. i'm not really understanding that the difference between private and public is
Rafal Rudzinski
@rrudzinski
Nov 03 2015 00:31
@sarahunter your speed property and getSpeed method are correct.
Boris
@boris-in-london
Nov 03 2015 00:31
@rrudzinski Try this...
var str="Never odd or even##";

str=str.replace(/[^a-z]+/g, " ").toLowerCase();

console.log(str);
sarahunter
@sarahunter
Nov 03 2015 00:32
@rrudzinski so my understanding is that the getSpeed is public, what makes something private?
Rafal Rudzinski
@rrudzinski
Nov 03 2015 00:34
@sarahunter I think the point of that excercise is to realize that you can use a constructor to make properites and functions private
Mark Dowdle
@Atroxide
Nov 03 2015 00:34
@rrudzinski , @boris-in-london, use str = str.toLowerCase().replace(/[^a-z]+/g, ""); You will want to replace the uppercase with lowercase before you use the regex, or if you do want to do it afterwards (for whatever reason then your regex should be /[^a-zA-Z]+/g
Boris
@boris-in-london
Nov 03 2015 00:37
@Atroxide thank you, i didnt realize the order would do that.
CamperBot
@camperbot
Nov 03 2015 00:37
boris-in-london sends brownie points to @atroxide :sparkles: :thumbsup: :sparkles:
:star: 14 | @atroxide | http://www.freecodecamp.com/atroxide
sarahunter
@sarahunter
Nov 03 2015 00:38
@rrudzinski i understand the lesson, except i am not writing the code properly to get it to execute
@rrudzinski and thanks for helping :sparkles:
CamperBot
@camperbot
Nov 03 2015 00:38
sarahunter sends brownie points to @rrudzinski :sparkles: :thumbsup: :sparkles:
:star: 187 | @rrudzinski | http://www.freecodecamp.com/rrudzinski
Rafal Rudzinski
@rrudzinski
Nov 03 2015 00:40
@sarahunter you’re creating another contructor myBike, you don't need to do that. the constructor is already provided for you, Bike, you need to edit it’s properties.
@Atroxide that’s still not working for me when i test it, i get “odd or even##”
@Atroxide never mind, i was not negating it correctly. thank you!
CamperBot
@camperbot
Nov 03 2015 00:42
rrudzinski sends brownie points to @atroxide :sparkles: :thumbsup: :sparkles:
:star: 15 | @atroxide | http://www.freecodecamp.com/atroxide
Mark Dowdle
@Atroxide
Nov 03 2015 00:43

`var str="Never odd or even##";

str=str.replace(/[^a-z]+/g, "");

console.log(str);` that works for me

ahh just saw your reply. yeah
sarahunter
@sarahunter
Nov 03 2015 00:48
@rrudzinski thanks that helps
CamperBot
@camperbot
Nov 03 2015 00:48
sarahunter sends brownie points to @rrudzinski :sparkles: :thumbsup: :sparkles:
:warning: sarahunter already gave rrudzinski points
Jeremy Roe
@jeremyroe
Nov 03 2015 01:12
completely stuck on a solution to animating my pomodoro timer - any more tips would be appreciated
Boris
@boris-in-london
Nov 03 2015 01:15
@jeremyroe what sort of animations are you looking for?
Jeremy Roe
@jeremyroe
Nov 03 2015 01:16
I’m open to options - the demo is a circle filling from the bottom as the timer completes although I’d be happy with anything that emulates a timer - I’ve been digging into CSS animations and various libraries but none fit the bill. There’s got to be a more straightforward method I’m just missing I expect
Krista Prenesti
@kprenesti
Nov 03 2015 01:17
Hi everyone. I'm Krista and I'm stuck. I'm completely confused about the difference between a private and public function. I get that a private method or property is enclosed within a given function, but on the Waypoint about making Public properties private, I don't understand why the function that starts with 'this' is a public property; after all, it's included in the function, too. Does 'this' make it public? And what does that mean in practice? I'd appreciate an answer or even just some suggestions for further reading/practice on this. Thanks!
sarahunter
@sarahunter
Nov 03 2015 01:19
@kprenesti I'm having the same issue too, can't seem to figure it out
Jeremy Roe
@jeremyroe
Nov 03 2015 01:21
Whats the title of the waypoint @kprenesti @sarahunter ?
sarahunter
@sarahunter
Nov 03 2015 01:21
@jeremyroe Waypoint: Make Object Properties Private
Jeremy Roe
@jeremyroe
Nov 03 2015 01:21
or #
Krista Prenesti
@kprenesti
Nov 03 2015 01:23
@jeremyroe It's number 3 in Object Oriented Programming
Boris
@boris-in-london
Nov 03 2015 01:24
@jeremyroe something like this? http://www.northfieldx.co.uk/pietimer/#
Jeremy Roe
@jeremyroe
Nov 03 2015 01:24
I “think” it’s because on this waypoint we’re working with an Object - So when using “this” we are assgiining a property to the object thus making it public - however when the property such as “speed” is a variable within a property (function) of the object then it’s scope is limited to that nested function - does that help?
Boris
@boris-in-london
Nov 03 2015 01:25
here is the code at the bottom... http://www.northfieldx.co.uk/pietimer/
Jeremy Roe
@jeremyroe
Nov 03 2015 01:25
Thanks @boris-in-london I’ll take a look
CamperBot
@camperbot
Nov 03 2015 01:25
jeremyroe sends brownie points to @boris-in-london :sparkles: :thumbsup: :sparkles:
:star: 209 | @boris-in-london | http://www.freecodecamp.com/boris-in-london
Jeremy Roe
@jeremyroe
Nov 03 2015 01:25
that above was for @kprenesti @sarahunter forgot to @ mention
sarahunter
@sarahunter
Nov 03 2015 01:26
@jeremyroe it makes sense that it needs to be nested, i can't seem to get the syntax right
Jeremy Roe
@jeremyroe
Nov 03 2015 01:28
@sarahunter public would be var item = function(){ this.property = “stuff”; } where as private would be more like var item = function(){ var property = “stuff” } the first sets a property of item the second sets a nested variable within the scope - If I’m off on this anyone feel free to correct me
Matt Yamamoto
@MattYamamoto
Nov 03 2015 01:29
@kprenesti @sarahunter are you guys still confused a bit on objects and public vs private?
I think I've answered this question once for the past few days... seems to be confusing to a lot of people.
Jeremy Roe
@jeremyroe
Nov 03 2015 01:29
@MattYamamoto Yes thats what were chatting about now
sarahunter
@sarahunter
Nov 03 2015 01:29
yes, thank you
CamperBot
@camperbot
Nov 03 2015 01:29
if you want to thank someone, put an @ before their name!
Matt Yamamoto
@MattYamamoto
Nov 03 2015 01:30
well, ready? let's dive in. and @jeremyroe what you said was essentially correct.
sarahunter
@sarahunter
Nov 03 2015 01:30
:)
Matt Yamamoto
@MattYamamoto
Nov 03 2015 01:30
I may have to get up real fast at some point, but I'll make sure I finish.. at some point.
okay, so we're making objects here using constructor functions...
var Car = function() {
   this.speed = 100;
}
A constructor function is simply a function, but one that you are going to use to create an object... so it's a special use function
the way you create an object from it is by using the new keyword.
so var myCar = new Car() will create an object using the constructor function and place that object in myCar
everybody on board so far?
sarahunter
@sarahunter
Nov 03 2015 01:33
uh
Matt Yamamoto
@MattYamamoto
Nov 03 2015 01:33
Essentially new creates a new empty object, and then Car() fills that object (there's more depth to it, but this is sufficient for now
Krista Prenesti
@kprenesti
Nov 03 2015 01:33
So do you then place the function within new Car or do you then say myCar = function...
I meant as an argument for new Car Ex var myCar = new Car(function() {});
mastermind6742
@mastermind6742
Nov 03 2015 01:34
)mj
Matt Yamamoto
@MattYamamoto
Nov 03 2015 01:35
no, you would just do var hisCar = new Car() where Car() is the previously defined constructor function
Krista Prenesti
@kprenesti
Nov 03 2015 01:35
Oh ok. So far so good, then.
Matt Yamamoto
@MattYamamoto
Nov 03 2015 01:35
and you can do this as much as you like var herCar = new Car() everytieme you do new Car() a new object is created.
the point of the constructor function is as follows
inside the constructor function you can assign public properties (and methods) using the this keyword.
sarahunter
@sarahunter
Nov 03 2015 01:36
i gotta run, i'll have to look more into this thank you @MattYamamoto
CamperBot
@camperbot
Nov 03 2015 01:36
sarahunter sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 432 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Nov 03 2015 01:36
@sarahunter sure, I'm going to keep typing away, feel free to look back here.
what the this keyword does is bind that property to the object that it's placed on. . . so...
var Car = function() {
   this.speed = 100;
}
the car constructor function has this.speed = 100.. that means all objects created by the constructor function will have the property speed with it's value set to 100.
so myCar.speed is 100 and hisCar.speed is equal to 100, etc
it's public because all objects created from the Car constructor function (using the new keyword) have this property accessible.
as @jeremyroe mentioned earlier, if in your constructor function you have a variable without this
This message was deleted
var Car = function() {
  var seats =  2;

   this.speed = 100;
}
like seats in this example... that will be private to the constructor.
that is myCar.seats will be undefined.
Kevin Smith
@Hopothesis
Nov 03 2015 01:40
How do I create a "script?"
Just started the JQuery exercises.
Matt Yamamoto
@MattYamamoto
Nov 03 2015 01:40
this is useful if you want that value in seats to be used inside the constructor for whatever reason, but not to be available on the objects you create.
Kevin Smith
@Hopothesis
Nov 03 2015 01:41
<script: $(document).ready(function(){});>
Matt Yamamoto
@MattYamamoto
Nov 03 2015 01:41
the same applies to methods...if you create them with the this keyword inside the constructor function (and that's key, this is used in the constructor only) then it will be public.
so.. for anybody still following along... does that help?
Krista Prenesti
@kprenesti
Nov 03 2015 01:42
Ok, so it's almost like a CSS class in that way in that anything changed to a class will change the html the class is assigned to. And private functions are like IDs. Why would one want to make something a part of the object but not use it?
It helps a LOT! I almost kinda sorta get it...in a hazy need more practice way...
Matt Yamamoto
@MattYamamoto
Nov 03 2015 01:44
@kprenesti it's not that you wouldn't use it, it's that you don't need it available to be evaluated publicly. In my car example you could create a function(method) inside the constructor that used the seats variable for a calculation... and then that mehtod might return something to the user. so you are using it, but not exposing it publicly for somebody to see or, perhaps more importantly, alter or modify
Krista Prenesti
@kprenesti
Nov 03 2015 01:49
@MattYamamoto , ok I think I get it. But if I wanted to make a method public, would it just be this.function functionName() {} or this.functionName() {}?
Matt Yamamoto
@MattYamamoto
Nov 03 2015 01:49
@kprenesti ah.. sorry. same as the value this.whateverYouWantToNameIt = function() {.....}
@kprenesti so I think the first way you stated
Krista Prenesti
@kprenesti
Nov 03 2015 01:51
@MattYamamoto Thank you for your awesome explanations! I really really appreciate it! I nearly ripped a few kids heads off in class today for being so noisy I couldn't think straight (I'm a substitute teacher as I learn).
CamperBot
@camperbot
Nov 03 2015 01:51
kprenesti sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 433 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Nov 03 2015 01:51
@kprenesti nice! There's a bit more depth to objects (such as prototype) and more nuance to using the this keyword, but I think you got the basics for now.
Krista Prenesti
@kprenesti
Nov 03 2015 01:54
@MattYamamoto For the moment, the basics work! Any more and I'll just confuse myself and have to start over. lol Thank you again!
CamperBot
@camperbot
Nov 03 2015 01:54
kprenesti sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:warning: kprenesti already gave mattyamamoto points
Matt Yamamoto
@MattYamamoto
Nov 03 2015 01:54
no problem
Krista Prenesti
@kprenesti
Nov 03 2015 01:56
Alright. I'm gonna see if I can't tackle this sucker. Hope you have a great night! Oh, and thanks to @jeremyroe for contributing, too!
CamperBot
@camperbot
Nov 03 2015 01:56
kprenesti sends brownie points to @jeremyroe :sparkles: :thumbsup: :sparkles:
:star: 252 | @jeremyroe | http://www.freecodecamp.com/jeremyroe
Jake Wiseberg
@spyderinc
Nov 03 2015 02:02
quick question: I went through all of the jQuery and bootstrap stuff, but how would I import those class libraries if I actually wanted to use them in a website? liike what would be the tags and what would they say?
Matt Yamamoto
@MattYamamoto
Nov 03 2015 02:05
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
you can find a link to the current version of either on their respective websites
so no need to copy this exactly. simply but you just load the js files in a script tag.... and don't forget to load bootstrap's css file in a link tag
Jake Wiseberg
@spyderinc
Nov 03 2015 02:08
great! thanks @MattYamamoto
CamperBot
@camperbot
Nov 03 2015 02:08
spyderinc sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 436 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
qdev76
@qdev76
Nov 03 2015 02:22
hey all, I'm new to gitter. How do rooms work? Can you only join rooms if you have the URL or can I see subrooms from the FreeCodeCamp root room?
Matt Yamamoto
@MattYamamoto
Nov 03 2015 02:25
wiki rooms
CamperBot
@camperbot
Nov 03 2015 02:25

:point_right: help rooms [wiki]

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

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

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

qdev76
@qdev76
Nov 03 2015 02:25
nvm found the github link to a list of all the sub rooms on the main chat
thanks @MattYamamoto
CamperBot
@camperbot
Nov 03 2015 02:25
qdev76 sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 438 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Nov 03 2015 02:35
@TheHighPriestess just thought I'd comment on my earlier comment. I was wrong, I guess when I was reformatting it to read your playArray function I messed it up.. and then I was logging i instead of x, which bypasses the whole point of using the immediately invoked function. Still reads weird, and is probably not best practice. You might rewrite it as seen in this stackOverflow answer. Anyway, good luck!
Brett Stark
@brettstark73
Nov 03 2015 02:47
Hello All!
newArray.map(function(array) {
return array + 3;
});
Is not adding 3 for some reason:( - I get error saying I should be adding 3 to the array.
ok fixed sorry... guess u need to assign that .map function to something...
Matt Yamamoto
@MattYamamoto
Nov 03 2015 02:51
@brettstark73 map returns an array if I'm not mistaken
oh, you figured it out! nicely done
dantepicasso
@dantepicasso
Nov 03 2015 03:11

'''
function factorialize(num) {
return num;
}

factorialize(5);
'''

CamperBot
@camperbot
Nov 03 2015 03:11
:bulb: to format code use backticks! ``` more info
Kevin Diem
@kgdiem
Nov 03 2015 03:12
Can I get some help with my Simon game? It isn't working as expected and I'm not sure why, after the first round it starts adding multiple integers to the moves array. Here is my player turn function:
function playerRound() {
  moves = [];
  $('.buttons').on('click', function(){
    switch($(this).attr('id')){
      case 'green':
        light($('#green'));
        moves.push(0);
        console.log('Moves: ' + moves);
        if(moves.length === sequence.length){
          return check();
        }
      break;
      case 'red':
        light($('#red'));
        moves.push(1);
        console.log('Moves: ' + moves);
        if(moves.length === sequence.length){
          return check();
        }
      break;
      case 'yellow':
        light($('#yellow'));
        moves.push(2);
        console.log('Moves: ' + moves);
        if(moves.length === sequence.length){
          return check();
        }
      break;
      case 'blue':
        light($('#blue'));
        moves.push(3);
        console.log('Moves: ' + moves);
        if(moves.length === sequence.length){
          return check();
        }
        break;
    }
  })
}
dantepicasso
@dantepicasso
Nov 03 2015 03:12
function factorialize(num) { 
  return num;
}

factorialize(5);
dantepicasso
@dantepicasso
Nov 03 2015 03:12
someone explain this factorial thing to me please
Kevin Diem
@kgdiem
Nov 03 2015 03:13
@dantepicasso you need to factorialize the number, in math it is written 5!
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:13
@dantepicasso are you asking what a factorial is?
Kevin Diem
@kgdiem
Nov 03 2015 03:13
54321
dantepicasso
@dantepicasso
Nov 03 2015 03:13
i mean how do i solve it in a way that is easy to remember
dwitjes89
@dwitjes89
Nov 03 2015 03:14
Brain fart......How do you create a CSS class inside the <style> tag again?
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:15
@kgdiem I'm looking at your simon game... give me a min
@dwitjes89 just put your css inside
<style>
.myClass {
  color: red;
}

</style>
dwitjes89
@dwitjes89
Nov 03 2015 03:16
Thanks thanks
CamperBot
@camperbot
Nov 03 2015 03:16
if you want to thank someone, put an @ before their name!
dwitjes89
@dwitjes89
Nov 03 2015 03:16
That is what I thought!
Rahul Jha
@RJ722
Nov 03 2015 03:19
Guys I am not able to access free code camp. It's been a day. Its showing error 520, but when I use any other device its opening all right.
What to do ?
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:21
@kgdiem so I think the issues is that in your playerRound function you are binding a click event to your buttons... but this happens everytime you run that function so you are getting multiple bindings.
dantepicasso
@dantepicasso
Nov 03 2015 03:22
@RJ722 Try deleting the cookies for freecodecamp
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:22
@kgdiem I think the solution is to just unbind the listener, maybe in your check function since that is called next. $('.buttons).unbind()
Rahul Jha
@RJ722
Nov 03 2015 03:28
@dantepicasso Already tried
Imnotgood1
@Imnotgood1
Nov 03 2015 03:28
I don't understand how to set font size
Kevin Diem
@kgdiem
Nov 03 2015 03:28
ok thanks @MattYamamoto
CamperBot
@camperbot
Nov 03 2015 03:28
kgdiem sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 442 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Imnotgood1
@Imnotgood1
Nov 03 2015 03:29
HELP
CamperBot
@camperbot
Nov 03 2015 03:29

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

Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:30
@RJ722 did you try incognito mode? just throwing something out there.
or private browsing, whatever
Jenny
@Jennyjp23
Nov 03 2015 03:30
find js
CamperBot
@camperbot
Nov 03 2015 03:30

find js

more enteries:

:two::zero: js for in loop
:two::one: js for loop
:two::two: js for of loop
:two::three: js functions
:two::four: js immutable
:two::five: js loops
:two::six: js scope
:two::seven: js ternary
:two::eight: js truthy
:two::nine: js undefined
:three::zero: jsonp
:three::one: testingjson
:three::two: wiki js template

Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:30
@Imnotgood1 which waypoint are you on
Jenny
@Jennyjp23
Nov 03 2015 03:31
Hi. I'm having trouble with Waypoint: Make Instances of Objects with a Constructor Function
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:31
@Jennyjp23 what's the trouble?
Rahul Jha
@RJ722
Nov 03 2015 03:31
@MattYamamoto no effect
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:32
@RJ722 sorry... I wish I had a better idea. and it's only FCC that is affected?
Jenny
@Jennyjp23
Nov 03 2015 03:32

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

// Only change code below this line.
var myCar = new Car(function () {
this.engines = 1;
});

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

I got an error: The property engines of myCar should be a number
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:33
@Jennyjp23 okay, lets back up a second.
a constructor function is a function that is used to build objects... you have one there and it is Car
Jenny
@Jennyjp23
Nov 03 2015 03:33
Yes
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:34
to make an object using the constructor you use the new keyword... so var myCar = new Car(); creates an object, uses the Car function constructor to fill in the object, and then stores that object in the variable myCar
@Jennyjp23 now that you have a myCar object you can add properties to it using dot notation.... so myCar.seats = 4 will create a property of seats in the object myCar and set that equal to 4
so long story short, you don't need to add a "function " or anything, just add the property
@Jennyjp23 which waypoint are you on?
nvm, you already said
Jenny
@Jennyjp23
Nov 03 2015 03:37
I see. I understand it now. Thanks @MattYamamoto
CamperBot
@camperbot
Nov 03 2015 03:37
jennyjp23 sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 443 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:38
you're welcome
Imnotgood1
@Imnotgood1
Nov 03 2015 03:39
Waypoint: Change the Font Size of an Element
you're welcome
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:40

@Imnotgood1 you're following this example

h1 {

  font-size: 30px;

}

here this changes the font size of h1 elements to 30px

you're being asked to change p elements to have a font size of 16px
and this is css, so it goes inside the <style> tags, so below the style .red-text that is already there
Imnotgood1
@Imnotgood1
Nov 03 2015 03:41
<p class="red-text";{font-size:16px}; > ?????????
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:43
@Imnotgood1 you already have styles defined in here
style>
  .red-text {
    color: red;
  }
</style>
just add some more
<style>
  .red-text {
    color: red;
  }

  .another-style {

  }

</style>
but don't type .another-style
dwitjes89
@dwitjes89
Nov 03 2015 03:46
that is a closing angle bracket right? I can't seem to find the error on why I can't move on
'>'
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:46
@dwitjes89 you're on this same one?
dwitjes89
@dwitjes89
Nov 03 2015 03:47
@MattYamamoto I Am?
Imnotgood1
@Imnotgood1
Nov 03 2015 03:47
me either
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:47
@dwitjes89 oh... hahah..nvm, I mistook the quote as you actually talking! sorry
dwitjes89
@dwitjes89
Nov 03 2015 03:47
ah
Imnotgood1
@Imnotgood1
Nov 03 2015 03:48
i just cant handle this
im un doing it all
goodbye
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:48
@Imnotgood1 ?
Imnotgood1
@Imnotgood1
Nov 03 2015 03:48
tell my family
dwitjes89
@dwitjes89
Nov 03 2015 03:49
Never mind....I'm clearly tired.........I feel so dumb haha I got it
Matt Yamamoto
@MattYamamoto
Nov 03 2015 03:51
@dwitjes89 wait, that was you talking! haha, it just made it a quote because of the '>'... now I feel dumb
well gald whatever problem you had is worked through!
dwitjes89
@dwitjes89
Nov 03 2015 03:53
:)
I NEED COFFEE!
Stefanie
@Phajava
Nov 03 2015 04:26
@dwitjes89 for you :coffee:
Don Price
@KingHippo
Nov 03 2015 04:40
Anyone know why my code only generates a single quote? The design is still in progress, it's pretty ugly right now.
IkeaViking
@IkeaViking
Nov 03 2015 04:52
Hey guys, I'm doing the jQuery section of the curriculum and I feel like I'm going nuts

Now let's try moving elements from one div to another.

jQuery has a function called appendTo() that allows you to select HTML elements and append them to another element.

For example, if we wanted to move target4 from our right well to our left well, we would use:

$("#target4").appendTo("#left-well");

Move your target2 element from your left-well to your right-well.

I type in $("#target2").appendTo("#right-well") and it isn't working
Any ideas?
Elliott McNary
@bighitbiker3
Nov 03 2015 04:56
@IkeaViking did you add a ; at the end? :)
I still screw that up all the time
IkeaViking
@IkeaViking
Nov 03 2015 04:57
<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("right-well");
});
</script>
yeah that's what I have in there
thanks for the suggestion though
CamperBot
@camperbot
Nov 03 2015 04:57
if you want to thank someone, put an @ before their name!
IkeaViking
@IkeaViking
Nov 03 2015 04:57
I do the same :)
huh, it's working now, weird
oh, i was missing the # symbol
hahaha
flashbacks to being 17 and trying to learn C++
:)
Elliott McNary
@bighitbiker3
Nov 03 2015 05:00
wow I totally overlooked that as well haha @IkeaViking
IkeaViking
@IkeaViking
Nov 03 2015 05:01
haha! Thanks @bighitbiker3! Hope you have a great night!
CamperBot
@camperbot
Nov 03 2015 05:01
ikeaviking sends brownie points to @bighitbiker3 :sparkles: :thumbsup: :sparkles:
:star: 177 | @bighitbiker3 | http://www.freecodecamp.com/bighitbiker3
Elliott McNary
@bighitbiker3
Nov 03 2015 05:09
Can someone help me with the factorializing?
Do i want to create a loop for that?
DJ
@qualitymanifest
Nov 03 2015 05:11
@bighitbiker3 have you tried anything yet
(if so post your code)
sarahunter
@sarahunter
Nov 03 2015 05:22
thanks for earlier @MattYamamoto great explanation, thank you and thanks to @jeremyroe
CamperBot
@camperbot
Nov 03 2015 05:22
sarahunter sends brownie points to @mattyamamoto and @jeremyroe :sparkles: :thumbsup: :sparkles:
:star: 253 | @jeremyroe | http://www.freecodecamp.com/jeremyroe
:star: 445 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Elliott McNary
@bighitbiker3
Nov 03 2015 05:23
@qualitymanifest i've been trying stuff but currently editor is empty
@qualitymanifest this is the code that's in there:

function factorialize(num) {
return num;
}

factorialize(5);

DJ
@qualitymanifest
Nov 03 2015 05:25
@bighitbiker3 well okay. you can do it with loops. i don't want to say too much but - initialize at num, decrement and keep multiplying until you hit 1
Elliott McNary
@bighitbiker3
Nov 03 2015 05:30
@qualitymanifest okay thank you
CamperBot
@camperbot
Nov 03 2015 05:30
bighitbiker3 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 323 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Boris
@boris-in-london
Nov 03 2015 05:44
This message was deleted
Traisna Kurnia Limijaya
@traisna
Nov 03 2015 05:44
Remove the style attribute from your h2 element.
Create a style element.
Your h2 element should be blue.
Ensure that your stylesheet h2 declaration is valid with a semicolon and closing brace
Make sure all your style elements are valid and have a closing tag.
i dont know how?
Ankur Singh
@Ankurlvv
Nov 03 2015 05:45
function destroyer(arr) {

}

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

function destroyer(arr) {

// Remove all the val

var arg = arguments;

return arr.filter(function(curItem){

for(var i = 1; i < arg.length; i++){       

  if(curItem == arg[i])

    return false;

}  

return true;

});

}

destroyer([1, 2, 3, 1, 2, 3], 2, 3); what's arg.length gonna do in it??

DJ
@qualitymanifest
Nov 03 2015 05:58
@Ankurlvv do you understand how .filter works? it goes through every item in the array it's filtering, like a loop. in this case, it's arr, so it's like you were doing a loop with arr, and each item is temporarily called curItem, much like in your for loop, each argument is temporarily arr[i]
DJ
@qualitymanifest
Nov 03 2015 06:06
that's the best i can explain it right now :beer:
Ankur Singh
@Ankurlvv
Nov 03 2015 06:09
@qualitymanifest that means curItem is using using all destroyer arguments one by one , without cnsidering them as array
DJ
@qualitymanifest
Nov 03 2015 06:13

nope... when the function is given the arguments [1, 2, 3, 1, 2, 3], 2, 3 like at the bottom where it says

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

then [1, 2, 3, 1, 2, 3] is the first argument, which is arr, the input to the destroyer function. 2 and 3 are the additional arguments that you have to filter out of the array (which is, again, arr)

@Ankurlvv so i guess what i am saying is... basically curItem, in your .filter, is saying, is arr[curItem] === 2 or 3? if so remove it.
Rex Schrader
@SaintPeter
Nov 03 2015 06:20
@qualitymanifest Yeah, that's mostly right.
@Ankurlvv Your code looks like it should work, to me
@Ankurlvv Does it not?
Ankur Singh
@Ankurlvv
Nov 03 2015 06:22
@qualitymanifest no offence but buddy, i did't understand what u justtold
DJ
@qualitymanifest
Nov 03 2015 06:23
@SaintPeter thanks, i thought so but i've surpassed the ballmer peak so i wasn't sure haha. yes it does work, i think he was just trying to understand
CamperBot
@camperbot
Nov 03 2015 06:23
qualitymanifest sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1372 | @saintpeter | http://www.freecodecamp.com/saintpeter
Ankur Singh
@Ankurlvv
Nov 03 2015 06:23
@SaintPeter yeah it runs fine but i copied it from somewhere, i was just working on it's functionality
Rex Schrader
@SaintPeter
Nov 03 2015 06:23
@qualitymanifest The one thing that you got wrong is this: arr[curItem] - because curItem is the value from arr, not the index to it.
DJ
@qualitymanifest
Nov 03 2015 06:24
@SaintPeter oh, yeah, i was just trying to make it make sense from a for loop type of understanding
Rex Schrader
@SaintPeter
Nov 03 2015 06:24
@Ankurlvv What filter does is loop through each element of the array it's called on and passed that element to a callback function. The callback function is inline.
@Ankurlvv THe name of the element is, for the callback, curItem
@Ankurlvv When the callback from the filter is true, that element is kept. When it's false, it is not kept.
@Ankurlvv So each item (curItem) is checked to see if it's equal to one of the destroyer args. If it is, it immediatly returns false, since we don't want to keeep it. If it gets through all of those args without matching, it returns true, since we DO want to keep it.
Anyway, that's all I've got - gonna call it.
'night
DJ
@qualitymanifest
Nov 03 2015 06:27
@SaintPeter seeya
Traisna Kurnia Limijaya
@traisna
Nov 03 2015 06:29
hello
<style>

h2 {color: red;}

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
</style>
Remove the style attribute from your h2 element.
Your h2 element should be blue.
Ensure that your stylesheet h2 declaration is valid with a semicolon and closing brace
how sir?
Ankur Singh
@Ankurlvv
Nov 03 2015 06:30
@SaintPeter thanks now i m catching something
CamperBot
@camperbot
Nov 03 2015 06:30
ankurlvv sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1373 | @saintpeter | http://www.freecodecamp.com/saintpeter
Ankur Singh
@Ankurlvv
Nov 03 2015 06:30
@qualitymanifest thanks buddy to u too
DJ
@qualitymanifest
Nov 03 2015 06:32
@traisna you have it colored red, it should be blue
Traisna Kurnia Limijaya
@traisna
Nov 03 2015 06:32
how to change if use css
it means <style>....</style >
Markus Kiili
@Masd925
Nov 03 2015 06:33
@Ankurlvv One thing to note is that filter always makes a new array. It doesn't alter the one that is iterated.
DJ
@qualitymanifest
Nov 03 2015 06:33
@traisna and you have your <p> element, which is HTML, inside your CSS (the <style> elements)
Ankur Singh
@Ankurlvv
Nov 03 2015 06:33
@Masd925 thanks i will keep in mind
Eric
@Solineoz
Nov 03 2015 06:34
@Ankurlvv TEST complete the code to affect "birds" from the "animals" ;)
var animals = ["crow","lion","dog","elephant","duck"];
var birds;
DJ
@qualitymanifest
Nov 03 2015 06:34
@traisna move your <p> element below your <style> element and color your h2 element blue
Traisna Kurnia Limijaya
@traisna
Nov 03 2015 06:34
@qualitymanifest oke i will try
@qualitymanifest oke thanks
CamperBot
@camperbot
Nov 03 2015 06:34
traisna sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 325 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Traisna Kurnia Limijaya
@traisna
Nov 03 2015 06:35
@Solineoz oke thanks
CamperBot
@camperbot
Nov 03 2015 06:35
traisna sends brownie points to @solineoz :sparkles: :thumbsup: :sparkles:
:star: 248 | @solineoz | http://www.freecodecamp.com/solineoz
Ankur Singh
@Ankurlvv
Nov 03 2015 06:35
@Solineoz how i m gonna try??
Eric
@Solineoz
Nov 03 2015 06:35
Just use the .filter method
Here in the chat... it is not an official one
@traisna Why ?
Ankur Singh
@Ankurlvv
Nov 03 2015 06:37
@Solineoz let me try..
Traisna Kurnia Limijaya
@traisna
Nov 03 2015 06:37
<style> catphotoapp</style>
how can be color red " (catphotoapp)
Ankit Panwar
@coderNoob
Nov 03 2015 06:40
Recursion always goes over my head. What should I do?
Eric
@Solineoz
Nov 03 2015 06:40
You have to style it "inline" or in <style> tag with class ?
Traisna Kurnia Limijaya
@traisna
Nov 03 2015 06:40
style sir ? inline i could that
style sir .
h2 {color: red;} use this mr @Solineoz or not? but how ?
Eric
@Solineoz
Nov 03 2015 06:42
@coderNoob A basic example
function add(num) {
  if (num < 3) {
    return add(num+1);
  }
  return num;
}
add(1);
Ankit Panwar
@coderNoob
Nov 03 2015 06:43
@Solineoz Any resources where I can study recursion in more depth?
Eric
@Solineoz
Nov 03 2015 06:43
@traisna Can you share your link to the WP
@coderNoob Not in my mind.
Have you tried Google ?
Traisna Kurnia Limijaya
@traisna
Nov 03 2015 06:43
@Solineoz you have an email i will give you ?
Eric
@Solineoz
Nov 03 2015 06:44
@traisna Lines 3-5 must be after the line 6, under the </style>
@coderNoob You're alright with listening to English ?
Ankit Panwar
@coderNoob
Nov 03 2015 06:45
@Solineoz Yea
@Solineoz Google does come up with some redundant results but it can't take you to the resources that the other users can.
Eric
@Solineoz
Nov 03 2015 06:46
Here is a good Programmer with nice videos.
https://www.youtube.com/watch?v=k7-N8R0-KY4
nightshade007
@nightshade007
Nov 03 2015 06:47
need help on sizing images
Eric
@Solineoz
Nov 03 2015 06:47
Open Photoshop
Yeah go for it.
nightshade007
@nightshade007
Nov 03 2015 06:49
need help here Your img element should have the class smaller-image.
DJ
@qualitymanifest
Nov 03 2015 06:50
@nightshade007 <something class = "someClass"></something>
Traisna Kurnia Limijaya
@traisna
Nov 03 2015 06:50
i dont understand what means?
nightshade007
@nightshade007
Nov 03 2015 06:52
but where does it go?
I need help on waypoint:Size your images activity
Markus Kiili
@Masd925
Nov 03 2015 06:54
<img src="url" class="someClass">
<style> .someClass {rule here;} </style>
Elliott McNary
@bighitbiker3
Nov 03 2015 06:56
@qualitymanifest thanks for that last help re loop...i figured it out!
CamperBot
@camperbot
Nov 03 2015 06:56
bighitbiker3 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 326 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Elliott McNary
@bighitbiker3
Nov 03 2015 06:56
how do I add code snippets in here?
Eric
@Solineoz
Nov 03 2015 06:57
format
wiki format
CamperBot
@camperbot
Nov 03 2015 06:57

:point_right: code format [wiki]

Inline code

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

Code Block

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

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

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

How to Code

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

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

Traisna Kurnia Limijaya
@traisna
Nov 03 2015 06:57
@Solineoz how Your h2 element should be blue. in <style>....</style>
Elliott McNary
@bighitbiker3
Nov 03 2015 06:58
aahhh thanks @Solineoz
CamperBot
@camperbot
Nov 03 2015 06:58
bighitbiker3 sends brownie points to @solineoz :sparkles: :thumbsup: :sparkles:
:star: 249 | @solineoz | http://www.freecodecamp.com/solineoz
Eric
@Solineoz
Nov 03 2015 06:58
By replacing "red" by "blue"
Elliott McNary
@bighitbiker3
Nov 03 2015 06:58
Is this the best way for me to code a palindrome? I passed the bonfire, but feel it's a little messy
function palindrome(str) {
  var pal = str.toLowerCase().split(".").join('').split(",").join('').replace(/\s/g, '').replace(/\W/g, '').replace(/_/g, '').split('').reverse().join('');


 if (pal === str.toLowerCase().replace(/\s/g, '').replace(/\W/g, '').replace(/_/g, "").split(".").join('').split(",").join('')) {
    return true;
  }
  else {
    return false;
  }

}


palindrome("0_0 (: /-\ :) 0-0");
DJ
@qualitymanifest
Nov 03 2015 06:59
@bighitbiker3 right on, glad to hear it
Traisna Kurnia Limijaya
@traisna
Nov 03 2015 06:59
cannot sir @Solineoz
Elliott McNary
@bighitbiker3
Nov 03 2015 06:59
The biggest prob I see with my above code is I just flat out remove the symbols instead of interpret them...
Eric
@Solineoz
Nov 03 2015 07:00
@traisna Line 3 to 5 have to be after the </style>

@bighitbiker3 Advice -- You can go to new line when chaining methods.

function palindrome(str) {
  var pal = str.toLowerCase()
.split(".")
.join('')
.split(",")
.join('')
.replace(/\s/g, '')
.replace(/\W/g, '')
.replace(/_/g, '')
.split('')
.reverse()
.join('');


 if (pal === str.toLowerCase().replace(/\s/g, '').replace(/\W/g, '').replace(/_/g, "").split(".").join('').split(",").join('')) {
    return true;
  }
  else {
    return false;
  }

}

palindrome("0_0 (: /-\ :) 0-0");

DJ
@qualitymanifest
Nov 03 2015 07:02
@bighitbiker3 you could do all of your replacing with one .replace, and then compare it to a reverse with just one split join and reverse
Traisna Kurnia Limijaya
@traisna
Nov 03 2015 07:03
<style>

{color: blue;}CatPhotoApp

<h2>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff</h2>
</style>
like this ?
Elliott McNary
@bighitbiker3
Nov 03 2015 07:04
@Solineoz oh wow thanks! so much easier to read. @qualitymanifest can you show me an example of the replace function with \s \W and _/ all together?? I tried that but couldn't get the code right..
CamperBot
@camperbot
Nov 03 2015 07:04
bighitbiker3 sends brownie points to @solineoz and @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: bighitbiker3 already gave solineoz points
:warning: bighitbiker3 already gave qualitymanifest points
DJ
@qualitymanifest
Nov 03 2015 07:06
@bighitbiker3 since you've already completed it, i'll show you my solution. there's probably even better ones out there too
function palindrome(str) {
  str = str.toLowerCase().replace(/\W|_/g, '');
  var strback = str.split('').reverse().join('');
  if (str === strback) {
    return true;
  }
  else {
    return false;
  }
}
palindrome("eye");
in the regex the | means "or", so, replace non-word characters and underscores
Mukesh Pandey
@mphapy
Nov 03 2015 07:08
Hello People
I need help on something which is pretty basic
Elliott McNary
@bighitbiker3
Nov 03 2015 07:09
aahhh awesome @qualitymanifest thanks again!
Mukesh Pandey
@mphapy
Nov 03 2015 07:09
Understand Boolean Values
CamperBot
@camperbot
Nov 03 2015 07:09
bighitbiker3 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: bighitbiker3 already gave qualitymanifest points
Markus Kiili
@Masd925
Nov 03 2015 07:09
@qualitymanifest Faster way for the palindromity checking part is to loop the characters <L/2 and comparing the first to the last etc.
Mukesh Pandey
@mphapy
Nov 03 2015 07:09
Let's modify our welcomeToBooleans function so that it will return true instead of falsewhen the run button is clicked.
How do I do this?
DJ
@qualitymanifest
Nov 03 2015 07:09
@bighitbiker3 no problem. i actually just made a better one
function palindrome(str) {
  str = str.toLowerCase().replace(/\W|_/g, '');
  return str === str.split('').reverse().join('');
}
palindrome("eye");
@Masd925 could a for loop version be faster than the one i just made?
@Masd925 (not doubting, if you've got a point i'd love to hear it)
@mphapy you just have to change one word
Mukesh Pandey
@mphapy
Nov 03 2015 07:12
false to true right?
DJ
@qualitymanifest
Nov 03 2015 07:12
@mphapy yerp
@mphapy it actually took me a minute on that one because i was like "it can't... just be that simple... right?" don't worry though it gets a lot more interesting soon
Markus Kiili
@Masd925
Nov 03 2015 07:14
@qualitymanifest Not sure, but it seem unnecessary to make an array from the string and do operations on it when you can just read the characters and compare them once.
@qualitymanifest I would quess that looping is much faster.
Fennek
@fennekbe
Nov 03 2015 07:21
Hey, is it alright to use dead links as events for js?
DJ
@qualitymanifest
Nov 03 2015 07:21
@Masd925 i guess you can compare first half to last half backwards, but you still have to get rid of non-word characters and underscores. i haven't done any speed testing with JS so far but it seems to me like comparing two strings would be faster. if you decide to test my version vs your idea please let me know the results.
Dustin Frank
@DustInCompetent
Nov 03 2015 07:24
People seem to have a lot of trouble with "Check for palindromes". I see that every time I come here.
Markus Kiili
@Masd925
Nov 03 2015 07:24
@qualitymanifest Yes, I was talking about the palindromity checking part of your solution. I will test it.
Dustin Frank
@DustInCompetent
Nov 03 2015 07:25
@Masd925 Um.. it's "palindromicality".
Markus Kiili
@Masd925
Nov 03 2015 07:25
Thanks @DustInCompetent
CamperBot
@camperbot
Nov 03 2015 07:25
masd925 sends brownie points to @dustincompetent :sparkles: :thumbsup: :sparkles:
:star: 82 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
Dustin Frank
@DustInCompetent
Nov 03 2015 07:25
No problem
Elliott McNary
@bighitbiker3
Nov 03 2015 07:26
how much do you guys google during the bonfires?
EmotionlessRock
@EmotionlessRock
Nov 03 2015 07:27
So much...
Elliott McNary
@bighitbiker3
Nov 03 2015 07:27
I've been doing this for about two weeks and I do a ton of searching for these bonfires...am I expected to be able to complete this without looking stuff up at this point?
EmotionlessRock
@EmotionlessRock
Nov 03 2015 07:27
I think we're expected to look up everything.
Eric
@Solineoz
Nov 03 2015 07:28
@bighitbiker3 Google send me an email to let me know that they will bill me in the futur ;)
EmotionlessRock
@EmotionlessRock
Nov 03 2015 07:29
Hah!
Dustin Frank
@DustInCompetent
Nov 03 2015 07:29
@bighitbiker3 I think every bonfire literally tells you to look up everything you need
Traisna Kurnia Limijaya
@traisna
Nov 03 2015 07:31
Your h2 element should have the class red-text.
what it means?
Eric
@Solineoz
Nov 03 2015 07:32
There is an exemple in the description if I'm right.
Aleksander Gębicki
@Takumar
Nov 03 2015 07:32
@traisna you can assign your header to some style group - it is the class.
You can style any element i.e. paragraph of text: <p class="your_style">any text</p>
Ravikant Chaudhary
@di-lip
Nov 03 2015 07:33
hi
Eric
@Solineoz
Nov 03 2015 07:33
Basically it means that you won't target the h2 tag itself, but apply a class attribute to the h2 tag and in the <style> target this applied class.
Ankit Panwar
@coderNoob
Nov 03 2015 07:33
This code is returning me the text in Chinese kind of language !
function binaryAgent(str) {
  var newStr = str.split(" "), finalStr = [], word;
  for(var i=0; i<newStr.length; i++){
    word = String.fromCharCode(newStr[i]);
    finalStr.push(word);
  }
  return finalStr.join(" ");
}

binaryAgent("01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111");
This message was deleted
Michael Guest
@MichaelGuest
Nov 03 2015 07:34
How do I paste code in chat?
`
Eric
@Solineoz
Nov 03 2015 07:35
wiki format
CamperBot
@camperbot
Nov 03 2015 07:35

:point_right: code format [wiki]

Inline code

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

Code Block

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

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

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

How to Code

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

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

Michael Guest
@MichaelGuest
Nov 03 2015 07:36
thanks!
CamperBot
@camperbot
Nov 03 2015 07:36
if you want to thank someone, put an @ before their name!
Michael Guest
@MichaelGuest
Nov 03 2015 07:36
thanks @Solineoz
CamperBot
@camperbot
Nov 03 2015 07:36
michaelguest sends brownie points to @solineoz :sparkles: :thumbsup: :sparkles:
:star: 250 | @solineoz | http://www.freecodecamp.com/solineoz
Eric
@Solineoz
Nov 03 2015 07:37
@MichaelGuest You're welcome
Michael Guest
@MichaelGuest
Nov 03 2015 07:38
I need help with Waypoint: Manipulate Arrays With shift
Ravikant Chaudhary
@di-lip
Nov 03 2015 07:38
hi
Michael Guest
@MichaelGuest
Nov 03 2015 07:40
var ourArray = ["Stimpson", "J", ["cat"]];

removedFromOurArray = ourArray.shift(); // removedFromOurArray now equals "Stimpson" and ourArray now equals ["J", ["cat"]].

var myArray = ["John", 23, ["dog", 3]];

// Only change code below this line.

var removedFromMyArray = ["John"];
myArray.shift();
// Only change code above this line.


(function(y, z){return 'myArray = ' + JSON.stringify(y) + ' & removedFromMyArray = ' + JSON.stringify(z);})(myArray, removedFromMyArray);
It says removedFromMyArray should contain "John".
Eric
@Solineoz
Nov 03 2015 07:40
Hi @di-lip
Michael Guest
@MichaelGuest
Nov 03 2015 07:40
Didn't I contain john?
in an array?
Dustin Frank
@DustInCompetent
Nov 03 2015 07:41
@coderNoob Still having trouble with your code?
Ankit Panwar
@coderNoob
Nov 03 2015 07:41
@DustInCompetent Yes
Need to convert it to unicode first
Aleksander Gębicki
@Takumar
Nov 03 2015 07:42
@coderNoob maybe change binary to decimals with parseInt(value, 2);
Dustin Frank
@DustInCompetent
Nov 03 2015 07:42
@coderNoob It's not translating the binary codes to decimals .fromCharCode(); takes decimals
just change the line word = String.fromCharCode(newStr[i]);
to word = String.fromCharCode("0b"+newStr[i]);
that should fix it
Ankit Panwar
@coderNoob
Nov 03 2015 07:42
@DustInCompetent @Takumar String.fromCharCode() doesn't it only accept unicode values?
Markus Kiili
@Masd925
Nov 03 2015 07:43
@qualitymanifest I tested it and speed for non palindromes were 20/2552 and for palindromes 84/3590 in favor of looping. I try to post the code too.
'''
CamperBot
@camperbot
Nov 03 2015 07:43
:bulb: to format code use backticks! ``` more info
Aleksander Gębicki
@Takumar
Nov 03 2015 07:43
@coderNoob but now you pass to it binary numbers
Dustin Frank
@DustInCompetent
Nov 03 2015 07:43
@coderNoob it does, I think, but when you give it a binary number, don't format it like a decimal
Markus Kiili
@Masd925
Nov 03 2015 07:43
<script>
    function paltest(str) {
      return str === str.split('').reverse().join('');
    }
    function paltestloop (str){
      var len = str.length;
      for (var i=0; i<len/2; i++) {
        if (str.charAt(i)!==str.charAt(len-1-i)) return false;
      }
      return true;
    }

    var start = new Date().getTime();
    for (i = 0; i < 1000000; ++i) {
      paltestloop('saippuakauppias');
    }
    var end = new Date().getTime();
    var time = end - start;
    alert('Execution time: ' + time);
  </script>
Eric
@Solineoz
Nov 03 2015 07:44
@MichaelGuest You must affect the removedFromMyArray using the .shift() method onto myArray. If not sure how to use it, read the doc by clicking on the link in the description on the left.
Markus Kiili
@Masd925
Nov 03 2015 07:44
Change the paltestloop to paltest to test the non-looping function.
Dustin Frank
@DustInCompetent
Nov 03 2015 07:45
@coderNoob
0b01000001 gives you an "A"
01000001 gives you "<some weird symbol here>"
Ankit Panwar
@coderNoob
Nov 03 2015 07:45
@DustInCompetent It works now but I don't understand what 0b changed?
Michael Guest
@MichaelGuest
Nov 03 2015 07:45
thanks @Solineoz
CamperBot
@camperbot
Nov 03 2015 07:45
michaelguest sends brownie points to @solineoz :sparkles: :thumbsup: :sparkles:
:warning: michaelguest already gave solineoz points
Ankit Panwar
@coderNoob
Nov 03 2015 07:45
How does this concept of 0b work?
Dustin Frank
@DustInCompetent
Nov 03 2015 07:46
@coderNoob "0b" makes it a binary value
Ankit Panwar
@coderNoob
Nov 03 2015 07:46
@DustInCompetent But the arguments are already in binary ?
Dustin Frank
@DustInCompetent
Nov 03 2015 07:47
@coderNoob how is javascript supposed to know if you mean 1000 (one thousand) or 1000 (8 in binary)
Fennek
@fennekbe
Nov 03 2015 07:47
you know it should be but the computer doesnt
Michael Guest
@MichaelGuest
Nov 03 2015 07:47
@Solineoz What link are you referring to I don't see it?
Ankit Panwar
@coderNoob
Nov 03 2015 07:47
@DustInCompetent Thanks a lot.
CamperBot
@camperbot
Nov 03 2015 07:47
codernoob sends brownie points to @dustincompetent :sparkles: :thumbsup: :sparkles:
:star: 83 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
Dustin Frank
@DustInCompetent
Nov 03 2015 07:48
@coderNoob you put a sort of prefix there defining it as 0b binary, 0x hexadecimal or, in ES6, 0o base-8
Eric
@Solineoz
Nov 03 2015 07:51
@MichaelGuest Sorry my bad, usually there is links for reference in the description.
When referencing JS. Mozilla Developer Network (MDN) is a pretty godd reference..
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift
manoj kumar
@manojrammurthy
Nov 03 2015 07:52

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

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

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

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

// Only change code below this line.

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

if (slotOne === slotTwo && slotTwo === slotThree) {
  return slotOne;
}

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

return [slotOne, slotTwo, slotThree];

}

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

<div>
<div class = 'container inset'>
<div class = 'header inset'>
<img src='https://s3.amazonaws.com/freecodecamp/freecodecamp_logo.svg.gz' alt='learn to code javascript at Free Code Camp logo' class='img-responsive nav-logo'>
<h2>FCC Slot Machine</h2>
</div>
<div class = 'slots inset'>
<div class = 'slot inset'>

</div>
<div class = 'slot inset'>

</div>
<div class = 'slot inset'>

</div>
</div>
<br/>
<div class = 'outset'>
<button class = 'go inset'>
Go
</button>
</div>
<br/>
<div class = 'foot inset'>
<span class = 'logger'></span>
</div>
</div>
</div>

<style>
.slot > img {
margin: 0!important;
height: 71px;
width: 50px;
}
.container {
background-color: #4a2b0f;
height: 400px;
width: 260px;
margin: 50px auto;
border-radius: 4px;
}
.header {
border: 2px solid #fff;
border-radius: 4px;
height: 55px;
margin: 14px auto;
background-color: #457f86
}
.header h2 {
height: 30px;
margin: auto;
}
.header h2 {
font-size: 14px;
margin: 0 0;
padding: 0;
color: #fff;
text-align: center;
}
.slots{
display: flex;
background-color: #457f86;
border-radius: 6px;
border: 2px solid #fff;
}
.slot{
flex: 1 0 auto;
background: white;
height: 75px;
width: 50px;
margin: 8px;
border: 2px solid #215f1e;
border-radius: 4px;
text-align: center;
}
.go {
width: 100%;
color: #fff;
background-color: #457f86;
border: 2px solid #fff;
border-radius: 2px;
box-sizing: none;
outline: none!important;
}
.foot {
height: 150px;
background-color: 457f86;
border: 2px solid #fff;
}

.logger {
color: white;
margin: 10px;
}

.outset {
-webkit-box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
}

.inset {
-webkit-box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
-moz-box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
}
</style>
'''

CamperBot
@camperbot
Nov 03 2015 07:52
:bulb: to format code use backticks! ``` more info
Dustin Frank
@DustInCompetent
Nov 03 2015 07:52
oh god.
manoj kumar
@manojrammurthy
Nov 03 2015 07:52
  function runSlots(){
    var slotOne;
    var slotTwo;
    var slotThree;

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

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

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

    // Only change code below this line.

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

    if (slotOne === slotTwo && slotTwo === slotThree) {
      return slotOne;
    }

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

    return [slotOne, slotTwo, slotThree];
  }

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

<div>
 <div class = 'container inset'>
   <div class = 'header inset'>
     <img src='https://s3.amazonaws.com/freecodecamp/freecodecamp_logo.svg.gz' alt='learn to code javascript at Free Code Camp logo' class='img-responsive nav-logo'>
     <h2>FCC Slot Machine</h2>
   </div>
   <div class = 'slots inset'>
     <div class = 'slot inset'>

     </div>
     <div class = 'slot inset'>

     </div>
     <div class = 'slot inset'>

     </div>
   </div>
   <br/>
   <div class = 'outset'>
     <button class = 'go inset'>
       Go
     </button>
   </div>
   <br/>
   <div class = 'foot inset'>
     <span class = 'logger'></span>
   </div>
 </div>
</div>

<style>
 .slot > img {
  margin: 0!important;
  height: 71px;
  width: 50px;
 }
 .container {
   background-color: #4a2b0f;
   height: 400px;
   width: 260px;
   margin: 50px auto;
   border-radius: 4px;
 }
 .header {
   border: 2px solid #fff;
   border-radius: 4px;
   height: 55px;
   margin: 14px auto;
   background-color: #457f86
 }
 .header h2 {
   height: 30px;
   margin: auto;
 }
 .header h2 {
   font-size: 14px;
   margin: 0 0;
   padding: 0;
   color: #fff;
   text-align: center;
 }
 .slots{
   display: flex;
   background-color: #457f86;
   border-radius: 6px;
   border: 2px solid #fff;
 }
 .slot{
   flex: 1 0 auto;
   background: white;
   height: 75px;
   width: 50px;
   margin: 8px;
   border: 2px solid #215f1e;
   border-radius: 4px;
   text-align: center;
 }
 .go {
   width: 100%;
   color: #fff;
   background-color: #457f86;
   border: 2px solid #fff;
   border-radius: 2px;
   box-sizing: none;
   outline: none!important;
 }
 .foot {
   height: 150px;
   background-color: 457f86;
   border: 2px solid #fff;
 }

 .logger {
   color: white;
   margin: 10px;
 }

 .outset {
   -webkit-box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
   -moz-box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
     box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
 }

 .inset {
   -webkit-box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
   -moz-box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
   box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
 }
</style>
hi wats wrong in this
Dustin Frank
@DustInCompetent
Nov 03 2015 07:53
What's supposed to happen/ What's happening instead, maybe?
$($(".slot")[0]).html('<img src="' +images[slotOne-1] + '">');
$($(".slot")[1]).html('<img src="' +images[slotTwo -1] + '">');
$($(".slot")[2]).html('<img src="' +images[slotThree -1] + '">')
too many dollar signs, I think?
manoj kumar
@manojrammurthy
Nov 03 2015 07:54
This message was deleted
This message was deleted
every thing is correct
Dustin Frank
@DustInCompetent
Nov 03 2015 07:55
cool, then what are you doing here?
manoj kumar
@manojrammurthy
Nov 03 2015 07:56
but it says use the provided code three times one for each slot
Use the provided code three times. One for each slot.
You should have used $('.slot')[0] at least once.
You should have used $('.slot')[1] at least once.
You should have used $('.slot')[2] at least once.
You should have used the slotOne value at least once.
You should have used the slotTwo value at least once.
You should have used the slotThree value at least once.
first one is still not letting me through the exercise
except first rest are green
Eric
@Solineoz
Nov 03 2015 07:58
Maybe the space between the slotOne- 1 ;)
It takes it for an hyphen
manoj kumar
@manojrammurthy
Nov 03 2015 07:59
nope
Dustin Frank
@DustInCompetent
Nov 03 2015 07:59
naa, javascript is cool with whitespace
Waypoint: Create a JavaScript Slot Machine?
Elliott McNary
@bighitbiker3
Nov 03 2015 07:59
Hey guys...trying to get the first letter of every word to capitalize...I can't get it to ignore ' though...my code looks like the below and it's spitting out I'M A Little Tea Pot
function titleCase(str) {
  ucstr = str
  .toLowerCase()
  .replace(/\b\w/g, function (m) {
    return m.toUpperCase();
  });



  return ucstr;



}

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

//.charAt(0);
manoj kumar
@manojrammurthy
Nov 03 2015 08:00
@DustInCompetent yes
Dustin Frank
@DustInCompetent
Nov 03 2015 08:01
@bighitbiker3 you can split the initial string at every " " and then capitalize every part individually and join them again
manoj kumar
@manojrammurthy
Nov 03 2015 08:02
any one ?
Elliott McNary
@bighitbiker3
Nov 03 2015 08:02
@DustInCompetent will give that a shot. thanks
CamperBot
@camperbot
Nov 03 2015 08:02
bighitbiker3 sends brownie points to @dustincompetent :sparkles: :thumbsup: :sparkles:
:star: 84 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
Dustin Frank
@DustInCompetent
Nov 03 2015 08:03
@manojrammurthy looks like you changed code outside the area you were supposed to stay in
manoj kumar
@manojrammurthy
Nov 03 2015 08:04
@DustInCompetent nope i have reset the code and did it again its the same problem
Eric
@Solineoz
Nov 03 2015 08:04
@manojrammurthy That is the missing semi-colon.
Should be the first reflex to check at.
manoj kumar
@manojrammurthy
Nov 03 2015 08:05
i did that that was not a problem and i reset the code again and did it its working now
:)
Elliott McNary
@bighitbiker3
Nov 03 2015 08:06
@DustInCompetent how would I go about capitalizing the first letter of each string in the array after I split it?
Dustin Frank
@DustInCompetent
Nov 03 2015 08:06
    $(".logger").html("");
    $(".logger").html("Not A Win")

got pushed up and you added

if (slotOne === slotTwo && slotTwo === slotThree) {
      return slotOne;
    }

below where you were supposed to add code

@bighitbiker3 loop through the array you get and use .substring() and .toUpperCase()/.toLowerCase()
Eric
@Solineoz
Nov 03 2015 08:08
When I removed the semi-colon on mine the fisrt test didn.t pass anymore.
But good for you... and that is maybe the only thing that I don't like in this kind of site.
When it fail, we scratch our head a lot.
Dustin Frank
@DustInCompetent
Nov 03 2015 08:08
reset and try again ^^
manoj kumar
@manojrammurthy
Nov 03 2015 08:09
i reset the code and its working
i did not make any big changes
Eric
@Solineoz
Nov 03 2015 08:09
Just copy pasting how it should ?
From the very start to the end ;)
Want some prouf
manoj kumar
@manojrammurthy
Nov 03 2015 08:10
you want me to copy paste ? :)
Eric
@Solineoz
Nov 03 2015 08:11
That is not what you did ?
manoj kumar
@manojrammurthy
Nov 03 2015 08:11
``````
  function runSlots(){
    var slotOne;
    var slotTwo;
    var slotThree;

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

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

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

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


    // Only change code above this line.

    if (slotOne === slotTwo && slotTwo === slotThree) {
      return slotOne;
    }

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

    return [slotOne, slotTwo, slotThree];
  }

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

<div>
 <div class = 'container inset'>
   <div class = 'header inset'>
     <img src='https://s3.amazonaws.com/freecodecamp/freecodecamp_logo.svg.gz' alt='learn to code javascript at Free Code Camp logo' class='img-responsive nav-logo'>
     <h2>FCC Slot Machine</h2>
   </div>
   <div class = 'slots inset'>
     <div class = 'slot inset'>

     </div>
     <div class = 'slot inset'>

     </div>
     <div class = 'slot inset'>

     </div>
   </div>
   <br/>
   <div class = 'outset'>
     <button class = 'go inset'>
       Go
     </button>
   </div>
   <br/>
   <div class = 'foot inset'>
     <span class = 'logger'></span>
   </div>
 </div>
</div>

<style>
 .slot > img {
  margin: 0!important;
  height: 71px;
  width: 50px;
 }
 .container {
   background-color: #4a2b0f;
   height: 400px;
   width: 260px;
   margin: 50px auto;
   border-radius: 4px;
 }
 .header {
   border: 2px solid #fff;
   border-radius: 4px;
   height: 55px;
   margin: 14px auto;
   background-color: #457f86
 }
 .header h2 {
   height: 30px;
   margin: auto;
 }
 .header h2 {
   font-size: 14px;
   margin: 0 0;
   padding: 0;
   color: #fff;
   text-align: center;
 }
 .slots{
   display: flex;
   background-color: #457f86;
   border-radius: 6px;
   border: 2px solid #fff;
 }
 .slot{
   flex: 1 0 auto;
   background: white;
   height: 75px;
   width: 50px;
   margin: 8px;
   border: 2px solid #215f1e;
   border-radius: 4px;
   text-align: center;
 }
 .go {
   width: 100%;
   color: #fff;
   background-color: #457f86;
   border: 2px solid #fff;
   border-radius: 2px;
   box-sizing: none;
   outline: none!important;
 }
 .foot {
   height: 150px;
   background-color: 457f86;
   border: 2px solid #fff;
 }

 .logger {
   color: white;
   margin: 10px;
 }

 .outset {
   -webkit-box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
   -moz-box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
     box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
 }

 .inset {
   -webkit-box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
   -moz-box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
   box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
 }
</style>
Eric
@Solineoz
Nov 03 2015 08:11
Ha semi-colon is there now.
manoj kumar
@manojrammurthy
Nov 03 2015 08:12
but i tried with semicolon previously also after i pasted code here it did not work
later i reset the code did exact changes it worked
Dustin Frank
@DustInCompetent
Nov 03 2015 08:12
semicolons at the end of operations shouldn't break anything
manoj kumar
@manojrammurthy
Nov 03 2015 08:13
@DustInCompetent exactly
Mihaela Constantin
@Mihaela-Constantin
Nov 03 2015 08:13
hello
Dustin Frank
@DustInCompetent
Nov 03 2015 08:14
hi
Mihaela Constantin
@Mihaela-Constantin
Nov 03 2015 08:14
I need a little help
manoj kumar
@manojrammurthy
Nov 03 2015 08:14
probably freecodecamp makes sure i use this chat engine by making my code not work for couple of times :) so that i get engaged in the chat app :)
Dustin Frank
@DustInCompetent
Nov 03 2015 08:14
@Mihaela-Constantin what is it?
manoj kumar
@manojrammurthy
Nov 03 2015 08:14
@Mihaela-Constantin wats that
Mihaela Constantin
@Mihaela-Constantin
Nov 03 2015 08:15
I follow the course and I'm stuck
at here "Object Oriented and Functional Programming " in part 3
manoj kumar
@manojrammurthy
Nov 03 2015 08:15
paste code between
Mihaela Constantin
@Mihaela-Constantin
Nov 03 2015 08:15

var Bike = function() {

// Only change code below this line.

this.speed = 100;

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

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

};

The method getSpeed of myBike should be accessible outside the object.
myBike.speed should be undefined.
Eric
@Solineoz
Nov 03 2015 08:16
@DustInCompetent Shouldn't is the word.
Better to code into the console than in those simulated "coded" editor.
Mihaela Constantin
@Mihaela-Constantin
Nov 03 2015 08:16
I don't understand them
Dustin Frank
@DustInCompetent
Nov 03 2015 08:16

between
```

```
please

nvm.
var Bike = function() {

  // Only change code below this line.

  this.speed = 100;

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

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

};
Eric
@Solineoz
Nov 03 2015 08:17
What means nvm ?
Dustin Frank
@DustInCompetent
Nov 03 2015 08:17
nevermind (i pasted your code in right format for you)
Mihaela Constantin
@Mihaela-Constantin
Nov 03 2015 08:17
this is the code where I'm stuck
Eric
@Solineoz
Nov 03 2015 08:18
Ok
Mihaela Constantin
@Mihaela-Constantin
Nov 03 2015 08:19
someone solve this request?
Eric
@Solineoz
Nov 03 2015 08:19
@Mihaela-Constantin Add the "this." before the "speed" in the addUnit function.
Mihaela Constantin
@Mihaela-Constantin
Nov 03 2015 08:19
ok, thank you very much :)
CamperBot
@camperbot
Nov 03 2015 08:19
if you want to thank someone, put an @ before their name!
Dustin Frank
@DustInCompetent
Nov 03 2015 08:19
@Mihaela-Constantin so, as long as speed is defined as an attribute of this (the object you're creating) it is accessible from outside
so remove this. in this.speed = 100; and make it var speed = 100;
Aleksander Gębicki
@Takumar
Nov 03 2015 08:20
@DustInCompetent yes it is public when you declare it using this, without that it is private and accessible only within your object.
Mihaela Constantin
@Mihaela-Constantin
Nov 03 2015 08:20
sorry, is my first time when I write on chat
Dustin Frank
@DustInCompetent
Nov 03 2015 08:20
@Takumar that wasn't a question. The Bonfire wants myBike.speed to return undefined when accessed from outside
wiki format
CamperBot
@camperbot
Nov 03 2015 08:21

:point_right: code format [wiki]

Inline code

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

Code Block

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

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

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

How to Code

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

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

Dustin Frank
@DustInCompetent
Nov 03 2015 08:22
That's all you need for the chat, @Mihaela-Constantin
Aleksander Gębicki
@Takumar
Nov 03 2015 08:22
@DustInCompetent sorry , I haven't noticed that @Mihaela-Constantin asked :-)
Dustin Frank
@DustInCompetent
Nov 03 2015 08:23
@Takumar no problem, thanks for trying ^^
CamperBot
@camperbot
Nov 03 2015 08:23
dustincompetent sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 612 | @takumar | http://www.freecodecamp.com/takumar
Elliott McNary
@bighitbiker3
Nov 03 2015 08:23
@DustInCompetent i cant get .substring to work as a function?
Aleksander Gębicki
@Takumar
Nov 03 2015 08:25
@bighitbiker3 var result = str.substring(0, 3); are you using it like this?
You can omit second parameter which says when to stop: "Abc".substring(1) === "bc"
Elliott McNary
@bighitbiker3
Nov 03 2015 08:28
@Takumar i can get it to work on the original string now
but i'm trying to get it to target the first letter of the strings in an array
Mukesh Pandey
@mphapy
Nov 03 2015 08:29
hello again, please help me understand this
Aleksander Gębicki
@Takumar
Nov 03 2015 08:29
@bighitbiker3 if you have now array of strings, you can work on every element of an array.
i.e. myArr[2].substring(1); which takes third string from array without its first letter.
You can loop through all elements of array and that's it.
Mukesh Pandey
@mphapy
Nov 03 2015 08:30
Math.floor(Math.random() * 20);
Please explain this someone
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:30
Math.random() returns a number between 0 and 1
where 1 is not included
You are multiplying that number by 20
Mukesh Pandey
@mphapy
Nov 03 2015 08:31
Alright
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:31
So the current range is 0 to 20, not including 20
Mukesh Pandey
@mphapy
Nov 03 2015 08:31
okay
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:31
Then you are flooring it, that is knocking everything after the decimal off
19.5 becomes 19
and so on
So essentially, you are finding a random integer from 0 to 19, including both 0 and 19
Mukesh Pandey
@mphapy
Nov 03 2015 08:32
oh, I get it now.
We're rounding down.
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:32
yep
Mukesh Pandey
@mphapy
Nov 03 2015 08:32
thanks
CamperBot
@camperbot
Nov 03 2015 08:32
if you want to thank someone, put an @ before their name!
Mukesh Pandey
@mphapy
Nov 03 2015 08:33
@awesomeaniruddh
thank you
CamperBot
@camperbot
Nov 03 2015 08:33
if you want to thank someone, put an @ before their name!
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:33
thanks @awesomeaniruddh :P
CamperBot
@camperbot
Nov 03 2015 08:33
sorry awesomeaniruddh, you can't send brownie points to yourself! :sparkles: :sparkles:
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:33
@mphapy ^
Aleksander Gębicki
@Takumar
Nov 03 2015 08:33
@mphapy you have to put it in one line otherwise it won't work
Elliott McNary
@bighitbiker3
Nov 03 2015 08:33
@Takumar thank you! i can now select it
CamperBot
@camperbot
Nov 03 2015 08:33
bighitbiker3 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 613 | @takumar | http://www.freecodecamp.com/takumar
Mukesh Pandey
@mphapy
Nov 03 2015 08:33
@awesomeaniruddh Thanks
CamperBot
@camperbot
Nov 03 2015 08:33
mphapy sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 462 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Mukesh Pandey
@mphapy
Nov 03 2015 08:34
Thank you @Takumar for pointing that
CamperBot
@camperbot
Nov 03 2015 08:34
mphapy sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 614 | @takumar | http://www.freecodecamp.com/takumar
Elliott McNary
@bighitbiker3
Nov 03 2015 08:37
can someone point out to me why I can't get this to loop through the array numbers?
function titleCase(str) {
  array = str
  .toLowerCase()
  .split(" ");


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



}
    return array[0].substring(0, 1).toUpperCase();

  }
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:37
for (var i = 0; i == array.length; i++) {
Elliott McNary
@bighitbiker3
Nov 03 2015 08:38
sorry, it's
function titleCase(str) {
  array = str
  .toLowerCase()
  .split(" ");


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



}
    return array[i].substring(0, 1).toUpperCase();

  }
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:38
That must be i < array.length
h4r1m4u
@h4r1m4u
Nov 03 2015 08:38
@bighitbiker3 you don't have any code inside the for loop. even if the for loop runs, it won't do anything
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:39
And the first line of the loop is wrong
h4r1m4u
@h4r1m4u
Nov 03 2015 08:40
that too, yes
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:40
Also
return array[i].substring(0, 1).toUpperCase();
It seems you want the loop to execute that?
Because you have that i in it
Elliott McNary
@bighitbiker3
Nov 03 2015 08:41
yea
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:41
Okay, you never put a return statement inside loops
return terminates the execution of the function immediately
So your loop will only run the first time
Elliott McNary
@bighitbiker3
Nov 03 2015 08:41
aahh okay
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:41
What are you trying to achieve here?
Maybe I can direct you towards a better solution
Elliott McNary
@bighitbiker3
Nov 03 2015 08:42
I am trying to capitalize the first letter of every word
Mukesh Pandey
@mphapy
Nov 03 2015 08:42
return Math.floor(Math.random() * (ourMax - ourMin + 1)) + ourMin;
Elliott McNary
@bighitbiker3
Nov 03 2015 08:43
was going down the path of splitting into an array, then targeting first letter of each string in an array then going to rejoin
Mukesh Pandey
@mphapy
Nov 03 2015 08:43
Pls help me understand, why use +1
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:43
@bighitbiker3 You're not splitting the string in your code
Okay you are
Srry
One approach here
Would be to loop through the array
Then on every iteration, break the word into letters
That is split the string once again into another arra
but you were using substring()
Elliott McNary
@bighitbiker3
Nov 03 2015 08:45
hmmm
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:45
Which would be a better solution
Elliott McNary
@bighitbiker3
Nov 03 2015 08:46
so substring() is the better option?
Fennek
@fennekbe
Nov 03 2015 08:46
Hey, is there a way to make bottom-border only go over 80 % of the bottom of the element instead of the whole bottom?
Mukesh Pandey
@mphapy
Nov 03 2015 08:46
return Math.floor(Math.random() * (ourMax - ourMin + 1)) + ourMin; Why are we using +1 in this. Somebody please ?
Michael Bomholt
@bomholtm
Nov 03 2015 08:46
hey do you guys remember the unofficial fcc ranking some fellow camper made?
Elliott McNary
@bighitbiker3
Nov 03 2015 08:47
@awesomeaniruddh what's wrong with the first line in the loop?
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:47
for(i = 0; i < array.length; i++)
Is what it is supposed to look like
Mukesh Pandey
@mphapy
Nov 03 2015 08:48
@qualitymanifest yeah. I was like it can't be so simple. and I ended up changing more than i should've done. Thanks
CamperBot
@camperbot
Nov 03 2015 08:48
mphapy sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 327 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Sabe Barker
@SabeBarker
Nov 03 2015 08:48
@bighitbiker3 don't forget to think about the suggested link for String.charAt() also
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:48
array[i] = array[i].substring(0, 3).toUpperCase()
Try that @bighitbiker3
Inside the loop
Md. Ohiduzzaman
@ohid1986
Nov 03 2015 08:49

'''var oldArray = [1,2,3,4,5];

// Only change code below this line.

var newArray = oldArray;

var timesthree = oldArray.map(function(val){

return val * 3;

});

// Only change code above this line.

(function() {return newArray;})();
'''

CamperBot
@camperbot
Nov 03 2015 08:49
:bulb: to format code use backticks! ``` more info
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:49
Or you could use charAt()
var oldArray = [1,2,3,4,5];
// Only change code below this line.
var newArray = oldArray;
var timesthree = oldArray.map(function(val){
    return val * 3;
});
// Only change code above this line.
(function() {return newArray;})();
@ohid1986 ^
Elliott McNary
@bighitbiker3
Nov 03 2015 08:50
@awesomeaniruddh ah ha! I forgot to put the array[i] in front. Thanks! @phoenixlaef i started off doing that charAt(), but came in here and someone mentioned substring
CamperBot
@camperbot
Nov 03 2015 08:50
bighitbiker3 sends brownie points to @awesomeaniruddh and @phoenixlaef :sparkles: :thumbsup: :sparkles:
:star: 463 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
:star: 197 | @phoenixlaef | http://www.freecodecamp.com/phoenixlaef
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:50
@ohid1986 What's the issue?
Md. Ohiduzzaman
@ohid1986
Nov 03 2015 08:50
how to add three to each value in the array in above code
@awesomeaniruddh I can't add 3 to each value
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:52
you are multiplying
return val * 3;
there's a * instead of a +
Md. Ohiduzzaman
@ohid1986
Nov 03 2015 08:53
@awesomeaniruddh I also try + not working
Aniruddh Agarwal
@anrddh
Nov 03 2015 08:54
I just realised
var oldArray = [1,2,3,4,5];
// Only change code below this line.
var newArray = oldArray;
var timesthree = oldArray.map(function(val){
    return val * 3;
});
// Only change code above this line.
(function() {return newArray;})();
var oldArray = [1,2,3,4,5];
// Only change code below this line.
var newArray = oldArray.map(function(val){
    return val + 3;
});
// Only change code above this line.
(function() {return newArray;})();
The top one is your code
The bottom one is my edited one
See the difference?
@ohid1986
?
Pranay Kothapalli
@kotAPI
Nov 03 2015 09:00
what up people?
Christine
@TheDuchess
Nov 03 2015 09:02
'sup @kotAPI !
Pranay Kothapalli
@kotAPI
Nov 03 2015 09:02
just woke up, back to codin stuff & things @TheDuchess
Christine
@TheDuchess
Nov 03 2015 09:02
What time is it where you are?
Pranay Kothapalli
@kotAPI
Nov 03 2015 09:03
dont laugh at me, it's 3 PM :P
Christine
@TheDuchess
Nov 03 2015 09:03
I would never laugh!
LOL I woke up about 1pm today myself
I am getting ready for bed soon
I was up WAAAY too late trying to get my code to work
Pranay Kothapalli
@kotAPI
Nov 03 2015 09:04
Haha, So I'm not alone
Christine
@TheDuchess
Nov 03 2015 09:04
Not alone at all!
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:04
Hey Guys, please move the discussion to the main chat :)
Christine
@TheDuchess
Nov 03 2015 09:05
Sorry
:)
Ankit Panwar
@coderNoob
Nov 03 2015 09:07
The following code is not working for the true cases.
function every(collection, pre) {
  // Is everyone being true?
  var a;
  for(var i in collection){
    a = collection.hasOwnProperty(pre);
  }
  return a;
}
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:08
Can you link to the bonfire?
Ankit Panwar
@coderNoob
Nov 03 2015 09:09
This message was deleted
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:09
Well that didn't work out
Ankit Panwar
@coderNoob
Nov 03 2015 09:10
I don't know how else to link you to my BonFire
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:10
[Link](https://freecodecamp.com/lahblahblah/)
Try that
Ankit Panwar
@coderNoob
Nov 03 2015 09:11
This message was deleted
Aren't you able to paste it like that?
Ankit Panwar
@coderNoob
Nov 03 2015 09:11
Nope
It's acting funny.
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:13
for(var i in collection){
is ideally written as for(var i = 0; i < collection.length; i++) {
a = collection.hasOwnProperty(pre); will then become a = collection[i].hasOwnProperty(pre);
That line of code has a flaw though
The value of ais written over with every iteration
An approach could be to create an empty erray
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:19
function every(collection, pre) {
  // Is everyone being true?
  var array = [];
  for(var i  = 0; i < collection.length; i++){
    array[i] = collection[i].hasOwnProperty(pre);
  }
}
You can then check to see if there is a falsey value in array
Does that make sense?
Ankit Panwar
@coderNoob
Nov 03 2015 09:28
@awesomeaniruddh Didn't work.
function every(collection, pre) {
  // Is everyone being true?
  var a = 0, array=[];
  for(var i in collection){
    array[i] = collection[i].hasOwnProperty(pre);
  }
  for(var j in array){
    if(!array[j])
      return false;
    else
      return true;
  }
}
Krzysztof Miąsko
@kmiasko
Nov 03 2015 09:28
if you want to add something to an array, you need to do array.push(element);
That does everything for you
Nabil Silva
@NabilSilva
Nov 03 2015 09:31

include <iostream>

Aniruddh Agarwal
@anrddh
Nov 03 2015 09:31
It passes all tests besides the ones
where the property in question is set to a falsey value
Ankit Panwar
@coderNoob
Nov 03 2015 09:34
@awesomeaniruddh That is the whole point. It is not really passing any of the test. It is only executing the else part and it will show whatever is in the else part no matter what.
This is the new code. The array does contain a false value and yet it passes the if statement.
function every(collection, pre) {
  // Is everyone being true?
  var a = 0, array=[];
  for(var i in collection){
    array.push(collection[i].hasOwnProperty(pre));
  }
  for(var j in array){
    if(!array[j])
      return false;
    else
      return true;
  }
}
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:35
@coderNoob CHeck the code I just sent
THe issue with this code is
It doesn't iterate through every value
If it finds even a single true in the array it will return true
In some of the objects in collection, the property is set to a value that evaluates to false
Values such as "", null ec.
Ankit Panwar
@coderNoob
Nov 03 2015 09:36
@awesomeaniruddh collection[i].hasOwnProperty(pre) makes sure that every element is checked.
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:36
for(var j in array){
    if(!array[j])
      return false;
    else
      return true;
  }
That's where the issue lies
I posted a link
Please take a look
It passes all tests except the ones in which the property is set to a falsey value
Now to break down that for loop for you
Let's take a sample array
[true, false, true]
Let's say array is set to that
The first time the for loop runs through
it will return true and the function will terminate
it will not iterate to the second value
which is false
Ankit Panwar
@coderNoob
Nov 03 2015 09:39
@awesomeaniruddh It will push every value in the array no matter what.
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:40
Pushing the values into the array is not the problem.
Ankit Panwar
@coderNoob
Nov 03 2015 09:40
And what we are checking for is if there is a false value in this array.
This message was deleted
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:40
All true/false values are getting pushed successfully into the array.
The next step is
Checking whether the array has any false value
This is where the issue lies
for(var j in array){
    if(!array[j])
      return false;
    else
      return true;
  }
Let us assume that the array variable here is [true, false, false]
Okay?
?
Ankit Panwar
@coderNoob
Nov 03 2015 09:46
Yes
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:46
The first time the loop runs through the array
We are evaluating true
Esteban
@fr0gs
Nov 03 2015 09:48

Hello, when trying to upload my Random Quote Machine to codepen I get this error message when clicking my Tweet button:

```

The thing is that I access it from this code:
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:48
@coderNoob The if condition fails
So it falls back to else and true is *returned*
Now the first thing about return statements is
Esteban
@fr0gs
Nov 03 2015 09:49
    $(this).attr("href", "https://twitter.com/intent/tweet?text=" + encodeURIComponent($("#quote").text() + "&output=embed"));
and for some reason codepen blocks it
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:49
They terminate execution of the function immediately
That's why, the function returns true
and the for loop never checks for the second or the third value of the array
Do you understand?
Ankit Panwar
@coderNoob
Nov 03 2015 09:50
Yes
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:50
So do you understand the problem in your code?
That's one of two problems
If you click the link I posted earlier
You will see some code in the FCC Editor
That code fixes this problem
Ankit Panwar
@coderNoob
Nov 03 2015 09:51
The if statement should execute till a false is encountered. Then isn't it?
That is the same code I already tried and it doesn't work.
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:51
No, with a return it terminates execution immediately
That code is slightly different
Ankit Panwar
@coderNoob
Nov 03 2015 09:52
It returns false for the first test case and true for the true cases.
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:52
The second problem is
Which the code does not solve
The code I posted does not solve your second problem
The second problem is that if you see the test cases that are failing with the code I posted
Okay wait, let me explain my code first
and why it works
for(var j in array){
    if(!array[j])
        return false;
}
return true;
This is the code I posted
Ankit Panwar
@coderNoob
Nov 03 2015 09:54
Same result.
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:54
Nope
the return true is outside the for loop
This means the loop will continue to execute until it finds a false value in the array
Dustin Frank
@DustInCompetent
Nov 03 2015 09:54
so it only returns true if all elements in array == false
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:54
Which is the only case when the if statement will return true
and thus the function will return false
@DustInCompetent Nope, it only returns true if all the elements are true
Take a closer look :)
Dustin Frank
@DustInCompetent
Nov 03 2015 09:55
oic, sorry
Ankit Panwar
@coderNoob
Nov 03 2015 09:55
Okay I see the problem
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:55
You see?
Now on to your second problem
Ankit Panwar
@coderNoob
Nov 03 2015 09:55
It's broken. The Bonfire.
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:56
Nope it's not
Ankit Panwar
@coderNoob
Nov 03 2015 09:56
I returned the array and it returned all true value when the case states that it should be false.
Yes dude.
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:56
Wait a sec
That's your second problem
In some cases
Ankit Panwar
@coderNoob
Nov 03 2015 09:56
You can check for the second false test case.
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:56
In some tests
Ankit Panwar
@coderNoob
Nov 03 2015 09:56
function every(collection, pre) {
  // Is everyone being true?
  var a = 0, array=[];
  for(var i in collection){
    array.push(collection[i].hasOwnProperty(pre));
  }
  /*for(var j in array){
    if(!array[j])
      return false;
  }
  return true;*/
  return array;
}

every([{"user": "Tinky-Winky", "sex": "male", "age": 0}, {"user": "Dipsy", "sex": "male", "age": 3}, {"user": "Laa-Laa", "sex": "female", "age": 5}, {"user": "Po", "sex": "female", "age": 4}], "age");
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:56
specifically the ones which are turning false with my ode
Ankit Panwar
@coderNoob
Nov 03 2015 09:57
The array returns true, true, true, true
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:57
But the bonfire wants false?
Dustin Frank
@DustInCompetent
Nov 03 2015 09:57
so... your function will also return false if any element in the array is literally false or 0, if that supposed to happen?
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:57
Yes
That's the problem
Ankit Panwar
@coderNoob
Nov 03 2015 09:57
Yes
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:58
The property in question cannot have a falsey value set to it
{"user": "Tinky-Winky", "sex": "male", "age": 0}
age here is set to 0
0 is a false value
Hence the bonfire expects you to return false
Get it?
Other falsey values are false, undefined, null, 0, ""
In each of the test case that is failing, the property is set to one of these values
Dustin Frank
@DustInCompetent
Nov 03 2015 09:59
This message was deleted
Aniruddh Agarwal
@anrddh
Nov 03 2015 09:59
You must test for that
Ankit Panwar
@coderNoob
Nov 03 2015 09:59
Yes it's the undefined case.
I guess not. dev mozilla
The value passed as the first parameter is converted to a boolean value, if necessary. If value is omitted or is 0, -0, null, false, NaN, undefined, or the empty string (""), the object has an initial value of false. All other values, including any object or the string "false", create an object with an initial value of true.
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:02
Yes
So you see?
Ankit Panwar
@coderNoob
Nov 03 2015 10:02
Yes
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:02
Why the tests are returning false?
Ankit Panwar
@coderNoob
Nov 03 2015 10:02
Seems the BF is broken?
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:02
NOOO
Dustin Frank
@DustInCompetent
Nov 03 2015 10:02
which bonfire is that?
Ankit Panwar
@coderNoob
Nov 03 2015 10:02
Everything be true
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:02
Why do you think the bonfire is broken?
Ankit Panwar
@coderNoob
Nov 03 2015 10:02
BF: Everything Be True
CamperBot
@camperbot
Nov 03 2015 10:02

:fire:Bonfire: Everything Be True :link:

function every(collection, pre) {
  // Does everyone have one of these?
  return pre;
}

every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], 'sex');

Check if the predicate (second argument) returns truthy (defined) for all elements of a collection (first argument).

more info:  bf details | bf links | hint

Aniruddh Agarwal
@anrddh
Nov 03 2015 10:03
Can you spell the reason out for me?
Ankit Panwar
@coderNoob
Nov 03 2015 10:03
Because
I tried to return the array in the cases that were not passing the test and the array had all the value set to true.
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:04
Okay.
Now you know how the array is populated?
based on the result of hasOwnProperty()
Right?
Ankit Panwar
@coderNoob
Nov 03 2015 10:04
In the every() function try to pass the test cases in the argument and see the result in the array by returning it.
Yes
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:05
Great
Dustin Frank
@DustInCompetent
Nov 03 2015 10:05
function every(collection, pre) {
  for (var i = 0; i < collection.length; i++) {
    if (!collection[i][pre]) return false;
  }
  return true;

}
ez done didn't take 2 minutes
Ankit Panwar
@coderNoob
Nov 03 2015 10:05
Since we pushed all the values onto the array.
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:05
Now you know how hasOwnPropertyworks?
@DustInCompetent gr8 job
@coderNoob It checks if the property exists
It doesn't check if the property is set to a falsey value
Ankit Panwar
@coderNoob
Nov 03 2015 10:06
Genius
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:06
You have to check whether the property is set to a falsey value
Ankit Panwar
@coderNoob
Nov 03 2015 10:07
But what I want to understand is why the if statement didn't work the way it was supposed to. It should have checked all the value in the boolean array.
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:07
The if statement worked
hasOwnProperty() will return true for { property:false }
Because even though it is set to false
The property exists
Ankit Panwar
@coderNoob
Nov 03 2015 10:09
So we're just checking whether the property exists or not and not what the value it contains? @DustInCompetent
Dustin Frank
@DustInCompetent
Nov 03 2015 10:09
That's what I did
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:09
@DustInCompetent Your code implicitly checked the value as well
Ankit Panwar
@coderNoob
Nov 03 2015 10:09
@DustInCompetent Okay thanks.
CamperBot
@camperbot
Nov 03 2015 10:09
codernoob sends brownie points to @dustincompetent :sparkles: :thumbsup: :sparkles:
:star: 85 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:10
Now I don't know how to make @coderNoob understand that his code is not checking the value
Dustin Frank
@DustInCompetent
Nov 03 2015 10:10
What @awesomeaniruddh did wrong is, he only checked whether a property with the name pre exists, not what value it has
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:11
Exactly.
Dustin Frank
@DustInCompetent
Nov 03 2015 10:11
Why?
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:11
Because I wanted him to implement that himself...
If I told him the answer there is no point of the bonfire
Dustin Frank
@DustInCompetent
Nov 03 2015 10:11
oh, you were helping @coderNoob ?
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:11
Yes
Dustin Frank
@DustInCompetent
Nov 03 2015 10:12
Alright
Elliott McNary
@bighitbiker3
Nov 03 2015 10:12
hey guys...what's the best way for me to combine these two arrays?
function titleCase(str) {
  array = str
  .toLowerCase()
  .split(" ");

  title = [];

  first = str.toLowerCase().split(" ");
  rest = str.toLowerCase().split(" ");
  for (i = 0; i < first.length; i++) {

   first[i] = first[i].charAt(0).toUpperCase();
   rest[i] = rest[i].slice(1);

    title = first + rest;
}


  return title.concat();
  }






titleCase("I'm a little tea pot");
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:12
title.concat(rest)
should work
why are you combining them inside a for loop?
Wait
Dustin Frank
@DustInCompetent
Nov 03 2015 10:13
title[i] = first[i] + rest[i]
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:13
Why do you have two arrays in the first place?
Oh okay
You don't really need two arrays
Dustin Frank
@DustInCompetent
Nov 03 2015 10:14
nope
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:14
@coderNoob are you clear where the problem is?
Elliott McNary
@bighitbiker3
Nov 03 2015 10:15
thanks guys...got it. Why do I need the title[i]
CamperBot
@camperbot
Nov 03 2015 10:15
if you want to thank someone, put an @ before their name!
Elliott McNary
@bighitbiker3
Nov 03 2015 10:15
i'm unclear on that @DustInCompetent
Dustin Frank
@DustInCompetent
Nov 03 2015 10:15
@bighitbiker3 because title's an array too, right?
If you just set title to a different string-value in every iteration of the loop, it's just gonna keep the last value aou set it and you can't .concat() it later
Elliott McNary
@bighitbiker3
Nov 03 2015 10:17
@DustInCompetent aaahhh ok got it thank you
CamperBot
@camperbot
Nov 03 2015 10:17
bighitbiker3 sends brownie points to @dustincompetent :sparkles: :thumbsup: :sparkles:
:star: 86 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
Dremmestar
@Dremmestar
Nov 03 2015 10:18
<div class ="row">
<div class ="col-xs-6">
<button class ="btn btn-block btn-primary"><i class ="fa fa-thumbs-up"></i> Like</button>
</div>
<div class ="col-xs-6">
<button class ="btn btn-block btn-info"><i class ="fa fa-info-circle"></i> Info</button>
</div>
<div class ="col-xs-6">
<button class ="btn btn-block btn-danger"><i class ="fa fa-trash"></i> Delete</button>
</div>
</div>
how do i send the problem in its proper format(black background?
this keeps giving me an error
Dustin Frank
@DustInCompetent
Nov 03 2015 10:19
<div class ="row">
  <div class ="col-xs-6">
    <button class ="btn btn-block btn-primary"><i class ="fa fa-thumbs-up"></i> Like</button>
  </div>
  <div class ="col-xs-6">
    <button class ="btn btn-block btn-info"><i class ="fa fa-info-circle"></i> Info</button>
  </div>
  <div class ="col-xs-6">
    <button class ="btn btn-block btn-danger"><i class ="fa fa-trash"></i> Delete</button>
  </div>
</div>
ftfy
Dremmestar
@Dremmestar
Nov 03 2015 10:19
thanks
CamperBot
@camperbot
Nov 03 2015 10:19
if you want to thank someone, put an @ before their name!
Sabe Barker
@SabeBarker
Nov 03 2015 10:19
explain format
CamperBot
@camperbot
Nov 03 2015 10:19

:point_right: code format [wiki]

Inline code

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

Code Block

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

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

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

How to Code

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

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

Aniruddh Agarwal
@anrddh
Nov 03 2015 10:19
What's the issue @Dremmestar ?
Dremmestar
@Dremmestar
Nov 03 2015 10:20
thanks @DustInCompetent
CamperBot
@camperbot
Nov 03 2015 10:20
dremmestar sends brownie points to @dustincompetent :sparkles: :thumbsup: :sparkles:
:star: 87 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
Dremmestar
@Dremmestar
Nov 03 2015 10:22
i have nested all buttons in divs and does not want to accept it
Aniruddh Agarwal
@anrddh
Nov 03 2015 10:24
Can you post a link to the waypoint?
Dremmestar
@Dremmestar
Nov 03 2015 10:25
responsively style radio buttons
is the waypoint
http://www.freecodecamp.com/challenges/waypoint-responsively-style-radio-buttons#?solution=%3Clink%20href%3D%22http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DLobster%22%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%3E%0A%3Cstyle%3E%0A%20%20h2%20%7B%0A%20%20%20%20font-family%3A%20Lobster%2C%20Monospace%3B%0A%20%20%7D%0A%0A%20%20.thick-green-border%20%7B%0A%20%20%20%20border-color%3A%20green%3B%0A%20%20%20%20border-width%3A%2010px%3B%0A%20%20%20%20border-style%3A%20solid%3B%0A%20%20%20%20border-radius%3A%2050%25%3B%0A%20%20%7D%0A%3C%2Fstyle%3E%0A%0A%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-8%22%3E%0A%20%20%20%20%20%20%3Ch2%20class%3D%22text-primary%20text-center%22%3ECatPhotoApp%3C%2Fh2%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-4%22%3E%0A%20%20%20%20%20%20%3Ca%20href%3D%22%23%22%3E%3Cimg%20class%3D%22img-responsive%20thick-green-border%22%20src%3D%22https%3A%2F%2Fbit.ly%2Ffcc-relaxing-cat%22%3E%3C%2Fa%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%20%20%3Cimg%20src%3D%22http%3A%2F%2Fbit.ly%2Ffcc-running-cats%22%20class%3D%22img-responsive%22%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-block%20btn-primary%22%3E%3Ci%20class%3D%22fa%20fa-thumbs-up%22%3E%3C%2Fi%3E%20Like%3C%2Fbutton%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-block%20btn-info%22%3E%3Ci%20class%3D%22fa%20fa-info-circle%22%3E%3C%2Fi%3E%20Info%3C%2Fbutton%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-block%20btn-danger%22%3E%3Ci%20class%3D%22fa%20fa-trash%22%3E%3C%2Fi%3E%20Delete%3C%2Fbutton%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%20%20%3Cp%3EThings%20cats%20%3Cspan%20class%3D%22text-danger%22%3Elove%3A%3C%2Fspan%3E%3C%2Fp%3E%0A%20%20%3Cul%3E%0A%20%20%20%20%3Cli%3Ecat%20nip%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Elaser%20pointers%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Elasagna%3C%2Fli%3E%0A%20%20%3C%2Ful%3E%0A%20%20%3Cp%3ETop%203%20things%20cats%20hate%3A%3C%2Fp%3E%0A%20%20%3Col%3E%0A%20%20%20%20%3Cli%3Eflea%20treatment%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Ethunder%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Eother%20cats%3C%2Fli%3E%0A%20%20%3C%2Fol%3E%0A%20%20%3Cform%20fccfaa%3D%22%2Fsubmit-cat-photo%22%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%3E%20Indoor%3C%2Flabel%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%3E%20Outdoor%3C%2Flabel%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Loving%3C%2Flabel%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Lazy%3C%2Flabel%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Crazy%3C%2Flabel%3E%0A%20%20%20%20%3Cinput%20type%3D%22text%22%20placeholder%3D%22cat%20photo%20URL%22%20required%3E%0A%20%20%20%20%3Cbutton%20type%3D%22submit%22%3ESubmit%3C%2Fbutton%3E%0A%20%20%3C%2Fform%3E%0A%3C%2Fdiv%3E%0A
Zai Xeno
@removed~zaixeno
Nov 03 2015 10:29
function palindrome(str) {
    var stripStr = str.toLowerCase().replace(/\W|\s/g, '');
    for (i = 0; i < stripStr.length; i++) {
        if (stripStr.charAt(i) != stripStr.charAt(stripStr.length - 1 - i)) {
            console.log("the string is not a palindrome.");
            return false;
        }
    }
    console.log("the string is a palindrome.");
    return true;
}
palindrome("Degas, are we not drawn onward, no? In union, drawn onward to new eras aged?");
I need help on "Bonfire: Check for Palindromes", I cannot seem to get this (palindrome("0_0 (: /-\ :) 0-0") should return true.) to get checked off.
CamperBot
@camperbot
Nov 03 2015 10:29
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Dremmestar
@Dremmestar
Nov 03 2015 10:29
lol
@awesomeaniruddh there?
baba
@shallowkobo
Nov 03 2015 10:41
Hey! i need help in the 'Bring your JavaScript Slot Machine to Life' where it says to use the jquery selector to select the slots.
don't know exactly what to place in the code section
Michael Bomholt
@bomholtm
Nov 03 2015 10:42
can you post the link?
Elliott McNary
@bighitbiker3
Nov 03 2015 10:44
Is there a better way for me to do this one? I passed the challenge, but I think it's pretty messy.
function largestOfFour(arr) {

  one = arr[0];
  one.sort(function(a, b){
    return b - a;
  }); 
  two = arr[1];
  two.sort(function(a, b){
    return b - a;
  });
  three = arr[2];
  three.sort(function(a, b){
    return b - a;
  });
  four = arr[3];
  four.sort(function(a, b){
    return b - a;
  });

  one = one[0];
  two = two[0];
  three = three[0];
  four = four[0];

  newArr = [one, two, three, four];

  return newArr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
nor does it scale
jpjenkins
@jpjenkins
Nov 03 2015 10:44
@xaixeno, you have to work on your regular expressions
regex101.com will help you test them
baba
@shallowkobo
Nov 03 2015 10:45
http://www.freecodecamp.com/challenges/waypoint-bring-your-javascript-slot-machine-to-life#?solution=fccss%0A%20%20function%20runSlots()%7B%0A%20%20%20%20var%20slotOne%3B%0A%20%20%20%20var%20slotTwo%3B%0A%20%20%20%20var%20slotThree%3B%0A%20%20%20%20%0A%20%20%20%20var%20images%20%3D%20%5B%22http%3A%2F%2Fi.imgur.com%2F9H17QFk.png%22%2C%20%22http%3A%2F%2Fi.imgur.com%2F9RmpXTy.png%22%2C%20%22http%3A%2F%2Fi.imgur.com%2FVJnmtt5.png%22%5D%3B%0A%20%20%20%20%0A%20%20%20%20slotOne%20%3D%20Math.floor(Math.random()%20*%20(3%20-%201%20%2B%201))%20%2B%201%3B%0A%20%20%20%20slotTwo%20%3D%20Math.floor(Math.random()%20*%20(3%20-%201%20%2B%201))%20%2B%201%3B%0A%20%20%20%20slotThree%20%3D%20Math.floor(Math.random()%20*%20(3%20-%201%20%2B%201))%20%2B%201%3B%0A%20%20%20%20%0A%20%20%20%20%24(%22.logger%22).html(%22%22)%3B%0A%20%20%20%20%24(%22.logger%22).html(%22Not%20A%20Win%22)%0A%20%20%20%20%0A%20%20%20%20%2F%2F%20Only%20change%20code%20below%20this%20line.%0A%20%20%20%20%0A%20%20%20%20%24(%22.slot%22).addClass.(%22slotOne%22)%3B%0A%20%20%20%20%0A%20%20%20%20%2F%2F%20Only%20change%20code%20above%20this%20line.%0A%20%20%20%20%0A%20%20%20%20if%20(slotOne%20%3D%3D%3D%20slotTwo%20%26%26%20slotTwo%20%3D%3D%3D%20slotThree)%20%7B%0A%20%20%20%20%20%20return%20slotOne%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20if(slotOne%20!%3D%3D%20undefined%20%26%26%20slotTwo%20!%3D%3D%20undefined%20%26%26%20slotThree%20!%3D%3D%20undefined)%7B%0A%20%20%20%20%20%20%24(%22.logger%22).html(slotOne)%3B%0A%20%20%20%20%20%20%24(%22.logger%22).append(%22%20%22%20%2B%20slotTwo)%3B%0A%20%20%20%20%20%20%24(%22.logger%22).append(%22%20%22%20%2B%20slotThree)%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20return%20%5BslotOne%2C%20slotTwo%2C%20slotThree%5D%3B%0A%20%20%7D%0A%0A%20%20%24(document).ready(function()%7B%0A%20%20%20%20%20%24(%22.go%22).click(function()%7B%0A%20%20%20%20%20%20%20runSlots()%3B%0A%20%20%20%20%20%7D)%3B%0A%20%20%20%7D)%3B%0Afcces%0A%20%0A%3Cdiv%3E%0A%20%3Cdiv%20class%20%3D%20%22container%20inset%22%3E%0A%20%20%20%3Cdiv%20class%20%3D%20%22header%20inset%22%3E%0A%20%20%20%20%20%3Cimg%20src%3D%22https%3A%2F%2Fs3.amazonaws.com%2Ffreecodecamp%2Ffreecodecamp_logo.svg.gz%22%20alt%3D%22learn%20to%20code%20javascript%20at%20Free%20Code%20Camp%20logo%22%20class%3D%22img-responsive%20nav-logo%22%3E%0A%20%20%20%20%20%3Ch2%3EFCC%20Slot%20Machine%3C%2Fh2%3E%0A%20%20%20%3C%2Fdiv%3E%0A%20%20%20%3Cdiv%20class%20%3D%20%22slots%20inset%22%3E%0A%20%20%20%20%20%3Cdiv%20class%20%3D%20%22slot%20inset%22%3E%0A%20%20%20%20%20%20%20%0A%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%20%3Cdiv%20class%20%3D%20%22slot%20inset%22%3E%0A%20%20%20%20%20%20%20%0A%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%20%3Cdiv%20class%20%3D%20%22slot%20inset%22%3E%0A%20%20%20%20%20%20%20%0A%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%3C%2Fdiv%3E%0A%20%20%20%3Cbr%2F%3E%0A%20%20%20%3Cdiv%20class%20%3D%20%22outset%22%3E%0A%20%20%20%20%20%3Cbutton%20class%20%3D%20%22go%20inset%22%3E%0A%20%20%20%20%20%20%20Go%0A%20%20%20%20%20%3C%2Fbutton%3E%0A%20%20%20%3C%2Fdiv%3E%0A%20%20%20%3Cbr%2F%3E%0A%20%20%20%3Cdiv%20class%20%3D%20%22foot%20inset%22%3E%0A%20%20%20%20%20%3Cspan%20class%20%3D%20%22logger%22%3E%3C%2Fspan%3E%0A%20%20%20%3C%2Fdiv%3E%0A%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A%0A%3Cstyle%3E%0A%20.container%20%7B%0A%20%20%20background-color%3A%20%234a2b0f%3B%0A%20%20%20height%3A%20400px%3B%0A%20%20%20width%3A%20260px%3B%0A%20%20%20margin%3A%2050px%20auto%3B%0A%20%20%20border-radius%3A%204px%3B%0A%20%7D%0A%20.header%20%7B%0A%20%20%20border%3A%202px%20solid%20%23fff%3B%0A%20%20%20border-radius%3A%204px%3B%0A%20%20%20height%3A%2055px%3B%0A%20%20%20margin%3A%2014px%20auto%3B%0A%20%20%20background-color%3A%20%23457f86%0A%20%7D%0A%20.header%20h2%20%7B%0A%20%20%20height%3A%2030px%3B%0A%20%20%20margin%3A%20auto%3B%0A%20%7D%0A%20.header%20h2%20%7B%0A%20%20%20font-size%3A%2014px%3B%0A%20%20%20margin%3A%200%200%3B%0A%20%20%20padding%3A%200%3B%0A%20%20%20color%3A%20%23fff%3B%0A%20%20%20text-align%3A%20center%3B%0A%20%7D%0A%20.slots%7B%0A%20%20%20display%3A%20flex%3B%0A%20%20%20background-color%3A%20%23457f86%3B%0A%20%20%20bord
jpjenkins
@jpjenkins
Nov 03 2015 10:45
and the answer is withing this page: http://www.w3schools.com/jsref/jsref_obj_regexp.asp
:)
Nikola Mitić
@JohneyCodeUp
Nov 03 2015 10:45
Hello god people. How would i approach building JS calculator in OO manner? Any guidelines you can share with me? :D
baba
@shallowkobo
Nov 03 2015 10:45
@awesomeaniruddh
jpjenkins
@jpjenkins
Nov 03 2015 10:45
@xaixeno ^
@zaixeno ^
:)
Zai Xeno
@removed~zaixeno
Nov 03 2015 10:46
?
jpjenkins
@jpjenkins
Nov 03 2015 10:46
what I wrote above
x34passenger
@x34passenger
Nov 03 2015 10:47
Is it possible to use the array method indexOf() to search for an item in an embedded array?
Zai Xeno
@removed~zaixeno
Nov 03 2015 10:47
Oh! Thanks! @jpjenkins
CamperBot
@camperbot
Nov 03 2015 10:47
zaixeno sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
:star: 190 | @jpjenkins | http://www.freecodecamp.com/jpjenkins
jpjenkins
@jpjenkins
Nov 03 2015 10:47
you're welcome :)
Michael Bomholt
@bomholtm
Nov 03 2015 10:48
@shallowkobo you need to use the code that is supplied in the description
use it 3 times
slotOne slotTwo slotThree
baba
@shallowkobo
Nov 03 2015 10:48
@bomholt thanks trying it now.
CamperBot
@camperbot
Nov 03 2015 10:48
shallowkobo sends brownie points to @bomholt :sparkles: :thumbsup: :sparkles:
:star: 415 | @bomholt | http://www.freecodecamp.com/bomholt
Michael Bomholt
@bomholtm
Nov 03 2015 10:48
do the same for the position ...[0] [1] [2]
Mukesh Pandey
@mphapy
Nov 03 2015 10:48
hello All
Waypoint: Create a JavaScript Slot Machine
how do I use this formula Math.floor(Math.random() * (3 - 1 + 1)) + 1;
x34passenger
@x34passenger
Nov 03 2015 10:49
how do you check for an item in the bonfire: inventory update, how do you check for the string in an embedded array/
?
baba
@shallowkobo
Nov 03 2015 10:55
mphapy,more explanation on you issue needs to be clarified
i still need an explanation on this $($(".slot")[0]).html(slotOne); the extra $ sign what is it's job in the code,and if i'm to guess the .html() is a function like the addClass(),right,please i need answers
Mukesh Pandey
@mphapy
Nov 03 2015 11:00
I am not there yet @shallowkobo
I am stuck again at Add your JavaScript Slot Machine Slots

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

return null;

}

I would appreciate if someone can help with the explanation too.
baba
@shallowkobo
Nov 03 2015 11:06
with the Math.random() a random number is generated for each of the slots 1 to 3,hence slotOne variable pointing to Math.floor(Math.random() * (3 - 1 + 1)) + 1;, each slot generated a different number Math.floor() helps to convert a decimal like 5.4 to 5, 8.1 to 8,the Math.random() helps to generate a random decimal number,the formula just helps to make sure your slot variable generates a whole number and not decimal based number. @mphapy
anthonygallina1
@anthonygallina1
Nov 03 2015 11:08
Hello let me know when it is agood time to jump in I dont want to wreck the thread
h4r1m4u
@h4r1m4u
Nov 03 2015 11:13

@shallowkobo
$(".slot") this returns a JQUERY OBJECT which contains a collection of all the .slot DOM elements
$(".slot")[0] is the first RAW DOM ELEMENT from the .slot collection. because it's a raw DOM element, it doesn't have all the jQuery methods such as .html(), .addClass(), etc.
$($(".slot")[0]) using the jQuery wrapper on the raw DOM element ensures that it's again a jQUERY OBJECT, so that you can use all the jQuery methods on it

try logging each of these code bits into your console and see what gets logged. it'll help you understand the difference

Ravikant Chaudhary
@di-lip
Nov 03 2015 11:14
<style>
body { color: rgb(0, 0, 0); }
</style>
is naything wrong with thi scode
*anything
It doesn't change the background color to black as expected
h4r1m4u
@h4r1m4u
Nov 03 2015 11:16
@di-lip color sets the color of text.
changing background color requires a different property
i'll let you figure out which one ;)
anthonygallina1
@anthonygallina1
Nov 03 2015 11:22
I am working on a interface for twitch tv but I am having a hard time getting my type to be responsive I think there is a easier way than what I am trying any body want to help me?
Dustin Frank
@DustInCompetent
Nov 03 2015 11:24
@di-lip also, afaik rgb(r, g , b) should be a string, like "rgb(0, 0, 0)"
h4r1m4u
@h4r1m4u
Nov 03 2015 11:27
@DustInCompetent nope, it shouldn't be wrapped in the quotes color: rgb(0, 0, 0); is just fine
Abhisek Pattnaik
@abhisekp
Nov 03 2015 11:28
@anthonygallina1 what you trying to do now? :point_up: November 3, 2015 4:52 PM
anthonygallina1
@anthonygallina1
Nov 03 2015 11:29
can I post the pen?
Abhisek Pattnaik
@abhisekp
Nov 03 2015 11:29
@anthonygallina1 umm... ok :+1: :D
Abhisek Pattnaik
@abhisekp
Nov 03 2015 11:30
@anthonygallina1 nice! :+1: but what's the issue?
Yona
@JonaYona
Nov 03 2015 11:31

Waypoint: Style Multiple Elements with a CSS Class
Remember that you can attach classes to HTML elements by using class="your-class-here" within the relevant element's opening tag.

this should be easy:Remember that CSS class selectors require a period at the beginning like this:

.blue-text {

color: blue;

}

But also remember that class declarations don't use a period, like this:

<h2 class="blue-text">CatPhotoApp<h2>

Apply the red-text class to your h2 and p elements.

so i wrote: .red-text {
colour:red;
}

<h2 class="red-text">CatPhotoApp<h2>
<p class="red-text">This is a cat app <p>

and after running, i get: Your h2 element should be red.
Your h2 element should have the class red-text.
Your p element should be red.
Your p element should have the class red-text.
Markus Kiili
@Masd925
Nov 03 2015 11:33
end tags should be </h2> and </p>
anthonygallina1
@anthonygallina1
Nov 03 2015 11:33
@abhisekp cant get the type to resize at @media screen and (max-width: 767px) I can but I thin there is a easier way that wont cause me too many headaches when I put the twitch part in?
@abhisekp I can make the type smaller but I really need it to center at the smaller size
Markus Kiili
@Masd925
Nov 03 2015 11:35
@JonaYona and the css rule inside style element: <style> .red-text {...;} </style>
Du Do
@vaan1990
Nov 03 2015 11:38
i am stuck at the border of image exercise. I typed this .thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
}
Mukesh Pandey
@mphapy
Nov 03 2015 11:38
@shallowkobo Thanks. Can you please explain what does extra $ do?
CamperBot
@camperbot
Nov 03 2015 11:38
mphapy sends brownie points to @shallowkobo :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for shallowkobo
Du Do
@vaan1990
Nov 03 2015 11:39
but it still gives me "Give your image a border width of 10px."
Dustin Frank
@DustInCompetent
Nov 03 2015 11:40
@vaan1990 try border-width: 11px;
I had that problem too
Du Do
@vaan1990
Nov 03 2015 11:41
oh, i passed the challenge. but i don't really understand the logic behind that
is that a bug or something?
Dustin Frank
@DustInCompetent
Nov 03 2015 11:41
it's broken
I guess.
Du Do
@vaan1990
Nov 03 2015 11:41
ok thanks for your help :D
CamperBot
@camperbot
Nov 03 2015 11:41
if you want to thank someone, put an @ before their name!
Du Do
@vaan1990
Nov 03 2015 11:41
@DustInCompetent @camperbot thank you both :D
CamperBot
@camperbot
Nov 03 2015 11:41
vaan1990 sends brownie points to @dustincompetent and @camperbot :sparkles: :thumbsup: :sparkles:
:star: 481 | @camperbot | http://www.freecodecamp.com/camperbot
:star: 89 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
h4r1m4u
@h4r1m4u
Nov 03 2015 11:43
@mphapy please see my reply to @shallowkobo regarding the extra $:
$(".slot") this returns a JQUERY OBJECT which contains a collection of all the .slot DOM elements
$(".slot")[0] is the first RAW DOM ELEMENT from the .slot collection. because it's a raw DOM element, it doesn't have all the jQuery methods such as .html(), .addClass(), etc.
$($(".slot")[0]) using the jQuery wrapper on the raw DOM element ensures that it's again a jQUERY OBJECT, so that you can use all the jQuery methods on it
try logging each of these code bits into your console and see what gets logged. it'll help you understand the difference
Ankit Panwar
@coderNoob
Nov 03 2015 11:43
Ignoring the else statement, this code should give me the sum of two arguments but it is not.
function add() {
  var number1, number2;
  var checkNumber = function(number){
    if(typeof number !=='number')
      return undefined;
    else
      return number;
  };
  if(arguments>1){
    number1 = checkNumber(arguments[0]);
    number2 = checkNumber(arguments[1]);
    if(number1===undefined||number2===undefined){
      return undefined;
    }      
    else{
      return number1+number2;
    }      
  }
  else{

  }
}

add(2,3);
the nested else is not executing.
Sabe Barker
@SabeBarker
Nov 03 2015 11:46
@vaan1990 did you add class thick-green-border to your img element?
i.e <img class="thick-green-border" src="...">
@coderNoob double check you have all your curly braces {...}
Ankit Panwar
@coderNoob
Nov 03 2015 11:49
@phoenixlaef single statement don't require {..}
Dustin Frank
@DustInCompetent
Nov 03 2015 11:51
@coderNoob that's javascript, my friend
typeof number !=='number'
returns "boolean"
because number !=='number' is executed first and returns true
then typeof checks the type of true
adding parentesis should fix it:
(typeof number) !=='number'
Mukesh Pandey
@mphapy
Nov 03 2015 11:53
thanks @h4r1m4u
CamperBot
@camperbot
Nov 03 2015 11:53
mphapy sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 482 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Ankit Panwar
@coderNoob
Nov 03 2015 11:54
@DustInCompetent Still the same result.
Dustin Frank
@DustInCompetent
Nov 03 2015 11:54
really
let me check
Markus Kiili
@Masd925
Nov 03 2015 11:55
@DustInCompetent typeof has higher precedence than !==
Dustin Frank
@DustInCompetent
Nov 03 2015 11:55
if(arguments>1){
you mean arguments.length
You know what.. Never set a variable to undefined, set it to null instead
undefined is only the initial value of a variable that was just created
Ankit Panwar
@coderNoob
Nov 03 2015 11:58
@DustInCompetent Thanks.
CamperBot
@camperbot
Nov 03 2015 11:58
codernoob sends brownie points to @dustincompetent :sparkles: :thumbsup: :sparkles:
:star: 90 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
Dustin Frank
@DustInCompetent
Nov 03 2015 11:59
if you had returned null in line 5, insteaf of undefined, you would've noticed by the variables' final value, it's not even the function checkNumber()that doesn't work, but that it isn't even called in the first place
Ankit Panwar
@coderNoob
Nov 03 2015 12:00
@DustInCompetent Not sure if I understand.
Dustin Frank
@DustInCompetent
Nov 03 2015 12:00
tl;dr: don't assign the value of undefinedto anything, ever! Use null instead
Ankit Panwar
@coderNoob
Nov 03 2015 12:01
@DustInCompetent If I do return null in line 5, then i get 2 for an output for the case add(2, "3") instead of undefined.
Dustin Frank
@DustInCompetent
Nov 03 2015 12:01
undefined means no value set yet
nullmeans empty value
@coderNoob you then have to replace undefined with null later too:
if(number1===null || number2===null){
    return null; // (return undefined)
}
Ankit Panwar
@coderNoob
Nov 03 2015 12:04
@DustInCompetent Now it returned null instead of undefined
Dustin Frank
@DustInCompetent
Nov 03 2015 12:04
@coderNoob With what input?
Ankit Panwar
@coderNoob
Nov 03 2015 12:05
add(2, "3"); @DustInCompetent
Mukesh Pandey
@mphapy
Nov 03 2015 12:05
Make Object Properties Private
Dustin Frank
@DustInCompetent
Nov 03 2015 12:05
@coderNoob what output do you want?
Mukesh Pandey
@mphapy
Nov 03 2015 12:05
@h4r1m4u See if you can keep myBike.speed and myBike.addUnit private, while making myBike.getSpeed publicly accessible.
Ankit Panwar
@coderNoob
Nov 03 2015 12:06
@DustInCompetent Bonfire: Arguments Optional
Mukesh Pandey
@mphapy
Nov 03 2015 12:06
how do i do this.
Dustin Frank
@DustInCompetent
Nov 03 2015 12:07
@coderNoob oh, it wants it to return undefined, alright, then just change that last null back
@coderNoob in order for that add(2)(3) to work, you might have to return a function in case there's only one argument
h4r1m4u
@h4r1m4u
Nov 03 2015 12:10
@mphapy the word 'this' is the key:
var Dog = function() {
  var tail = "short"; // this is a private property
  this.legs = 4; // this a public property
}

var myDog = new Dog();

console.log(myDog.tail); // returns 'undefined' because tail is a private property
console.log(myDog.legs); // returns 4; legs is a public property
Ankit Panwar
@coderNoob
Nov 03 2015 12:10
@DustInCompetent Yea. I'm working on it now. I was testing and noticed the case you just solved.
h4r1m4u
@h4r1m4u
Nov 03 2015 12:10
methods work the same
Dustin Frank
@DustInCompetent
Nov 03 2015 12:10
This message was deleted
nicky
@NickyOkeyo
Nov 03 2015 12:12
Its fun learning a new skill
Mukesh Pandey
@mphapy
Nov 03 2015 12:17
Hello @h4r1m4u Thanks again!
Jamie
@UniMass
Nov 03 2015 12:39

Hey, could someone help me with the font size style? I'm not sure what I'm doing wrong <style>
.red-text {
color: red;
}
.font-size {
font: 16px;
}
</style>

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

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

Jose Barakat
@JoseBarakat
Nov 03 2015 12:42
@UniMass , .font-size {
font: 16px;
} is wrong
font-size: 16px;
instead, write p {
font-size: 16px;
font-family: Monospace;
}
Jamie
@UniMass
Nov 03 2015 12:45
Ah-ha got it! Thank you so much @JoseBarakat
CamperBot
@camperbot
Nov 03 2015 12:45
unimass sends brownie points to @josebarakat :sparkles: :thumbsup: :sparkles:
:star: 44 | @josebarakat | http://www.freecodecamp.com/josebarakat
Jose Barakat
@JoseBarakat
Nov 03 2015 12:47
@ your service
Mukesh Pandey
@mphapy
Nov 03 2015 12:50

array = array.filter(function(val) {

return val % 2 === 0;

});

Use filter to remove all elements from array that are greater than 5

Please help here.
Blertan
@Blertan
Nov 03 2015 12:51
@mphapy return >5
Jason Wood
@catapixel
Nov 03 2015 12:52
@mphapy return val > 5;
Mukesh Pandey
@mphapy
Nov 03 2015 12:52
@Blertan & @catapixel what's incorrect in this?

var newArray = oldArray.filter(function(val) {

return val > 5; });

Blertan
@Blertan
Nov 03 2015 12:53
@mphapy  return val <= 5
Mukesh Pandey
@mphapy
Nov 03 2015 12:55
Oh, I did not read it right
thank you @Blertan and @catapixel
CamperBot
@camperbot
Nov 03 2015 12:55
mphapy sends brownie points to @blertan and @catapixel :sparkles: :thumbsup: :sparkles:
:star: 187 | @blertan | http://www.freecodecamp.com/blertan
:star: 562 | @catapixel | http://www.freecodecamp.com/catapixel
Jason Wood
@catapixel
Nov 03 2015 12:55
:+1:
Mukesh Pandey
@mphapy
Nov 03 2015 13:00
how do one write reverse method
how do I write reverse method code
loftyrama
@loftyrama
Nov 03 2015 13:01
@mphapy what do you need to do exactly?
Mukesh Pandey
@mphapy
Nov 03 2015 13:04
@loftyrama I figured. array.reverse();
RebelWoman
@RebelWoman
Nov 03 2015 13:06
Looking for a bit of help, how do you make a dead link, I need to replace the "href" attribute into a "#", which i have done but there is no change
Abhisek Pattnaik
@abhisekp
Nov 03 2015 13:07
@RebelWoman not replace, assign!
Markus Kiili
@Masd925
Nov 03 2015 13:07
@RebelWoman try href="#"
Blertan
@Blertan
Nov 03 2015 13:07
@RebelWoman <a href ="#" ...
Dustin Frank
@DustInCompetent
Nov 03 2015 13:07
} ()noiƚɔnuʇ = ɘulɒVƚɘǫ.ƨiʜƚ
              ⁏ɘulɒv nɿuƚɘɿ
                           {
reverse method
Abhisek Pattnaik
@abhisekp
Nov 03 2015 13:07
@DustInCompetent nice !
RebelWoman
@RebelWoman
Nov 03 2015 13:09
The instuctions---Replace your a element's href attribute with a #, also known as a hash symbol, to turn it into a dead link.
abhisekp @abhisekp cries out for help. His brain is reversed looking at :point_up: November 3, 2015 6:37 PM ;)
Abhisek Pattnaik
@abhisekp
Nov 03 2015 13:09
@RebelWoman the value of href attribute not the attribute name itself.
RebelWoman
@RebelWoman
Nov 03 2015 13:10
Thank you @Masd925 , @Blertan, @abhisekp
CamperBot
@camperbot
Nov 03 2015 13:10
rebelwoman sends brownie points to @masd925 and @blertan and @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 167 | @masd925 | http://www.freecodecamp.com/masd925
:star: 802 | @abhisekp | http://www.freecodecamp.com/abhisekp
:star: 188 | @blertan | http://www.freecodecamp.com/blertan
kaomry
@kaomry
Nov 03 2015 13:25
someone can help me? i dont see what i missing here.... i typed in the style scope:
.thick-green-border {
border-style: solid;
border-color: green;
border-width: 10px;
}
the pic is now in green thick border, but the 10px action still marked as not finished
Ashraful Islam
@iashraful
Nov 03 2015 13:28
.thick-green-border {
border-style: solid;
border-color: green;
border-width: 10px;
}
looks good to me
Geoff Hutson
@Reggedon89
Nov 03 2015 13:34
hey there guys, little confused here. My problem says I should use the correct index to modify the value in the array
myArray [0] =3;
which gets the output I need but the second requirment isnt being satisfied
Geoff Hutson
@Reggedon89
Nov 03 2015 13:40
i'm such an idiot......It was the space haha
Dustin Frank
@DustInCompetent
Nov 03 2015 13:47
@iashraful @kaomry it's issue FreeCodeCamp/FreeCodeCamp#3204
just skip, @kaomry, your code is correct
Geoff Hutson
@Reggedon89
Nov 03 2015 13:56
i had some simular issues @kaomry but i just reloaded the question and it went through
Matt Leonard
@matty22
Nov 03 2015 13:58
@SaintPeter Yes, someone pointed us in the right direction. Thanks @SaintPeter!
CamperBot
@camperbot
Nov 03 2015 13:58
matty22 sends brownie points to @saintpeter and @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1374 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 1374 | @saintpeter | http://www.freecodecamp.com/saintpeter
David
@Swiftzn
Nov 03 2015 14:04
ok so first off how do i ask for help with my problem haha do i link your something?
Dustin Frank
@DustInCompetent
Nov 03 2015 14:07
What's ur bonfire/waypoint, code and what's wrong with it?
Geoff Hutson
@Reggedon89
Nov 03 2015 14:07
well..whats your problem?
David
@Swiftzn
Nov 03 2015 14:07
Waypoint: Target a Specific Child of an Element Using jQuery
but seems i am sorted
Dustin Frank
@DustInCompetent
Nov 03 2015 14:08
You're welcome :)
Geoff Hutson
@Reggedon89
Nov 03 2015 14:08
can we see your code?
David
@Swiftzn
Nov 03 2015 14:09
$(".target:nth-child(2)").addClass("animated bounce");
unfortunatly i have no clue how to show you my bonfire/waypoint
Marie Pelletier
@Marie000
Nov 03 2015 14:10
good morning! I am working on the git section. Things seem to be working okay, but the "git-it verify" line doesn't work. I am using Windows powershell.
Geoff Hutson
@Reggedon89
Nov 03 2015 14:10
hmm 1 sec
and what isn't working again, cause your code is the same as mine
loftyrama
@loftyrama
Nov 03 2015 14:14
Hey folks, I need some help with the Palindrome JS function.
It's expected to find out palindromes. This is my code:
var palindrome = function (x) {
  var x = x.toLowerCase().replace(/[., ]/ig, '');

  reverse = x.split('').reverse().join('');

  console.log(reverse);

  return x === reverse;
};


palindrome("0_0 (: /-\ :) 0-0");
the last line of code is expected to return true, however it returns: 0-0):-/:(0_0
(which in itself should return false, since it's not the same, but w/e)
(my question is, why does the slash get omitted, and what do i need about the underscore?)
Abhisek Pattnaik
@abhisekp
Nov 03 2015 14:20
@loftyrama x is not a good name! :P
loftyrama
@loftyrama
Nov 03 2015 14:21
but, Captain Jack Sparrow likes x :smile:
is that the problem though?
Ab