These are chat archives for FreeCodeCamp/Help

18th
Aug 2015
Giorgio
@gDelgado14
Aug 18 2015 00:15
does anyone know if FCC is going to bring back bonfire solutions to our profile again ?
Marc Davenport
@oneate7
Aug 18 2015 00:22
@gDelgado14 - They're going to be available as part of the new API, but I haven't heard a timeline for that yet.
Juan Martínez
@jbmartinez
Aug 18 2015 00:32
hey everyone!
Fabio
@FabioSeves
Aug 18 2015 00:33
@gDelgado14 I don't think so
@gDelgado14 Qynce talked about it on the video
Ash Roulston
@AshRoulston
Aug 18 2015 00:42
Haven't been on in 5 days, what happened to my map?
Rex Schrader
@SaintPeter
Aug 18 2015 00:57
wiki 2015
CamperBot
@camperbot
Aug 18 2015 00:57

:point_right: august 2015 improvements [wiki]

We're super slow today. Sorry for the inconvenience. We are working to fix this as fast as possible.

In short, we switched to Loopback.js, and they have a faulty Mongo connection that only shows up at scale. We're fixing it, and will commit the fix back to Loopback.js as well.

In the meantime, we invite you to:

WIP

:pencil: read more about august 2015 improvements on the FCC Wiki

Rex Schrader
@SaintPeter
Aug 18 2015 00:58
@AshRoulston Click through the Wiki to find out more
Ash Roulston
@AshRoulston
Aug 18 2015 01:02
@SaintPeter i did thanks :)
CamperBot
@camperbot
Aug 18 2015 01:02
ashroulston sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 204 | @saintpeter | http://www.freecodecamp.com/saintpeter
Dan Stockham
@DanStockham
Aug 18 2015 01:03

That is really strange:

function add() {
 for(var i = 0; i < arguments.length; i++) { 
  if(typeof arguments[i] === "number") {
    console.log(arguments);
    return arguments[0] + arguments[1];

  } else {

    return undefined;
  }
 }

}

add(2)(3);

Even though the function only has one argument it still recognizes 2 arguments .

Rex Schrader
@SaintPeter
Aug 18 2015 01:04
@DanStockham arguments is an object, not an array. I'm not sure if .length works in the same way.
Dan Stockham
@DanStockham
Aug 18 2015 01:06
@SaintPeter I just thought it was strange when I logged it that I got back [2]
Zion
@learnor
Aug 18 2015 01:06
Anyone here can help me with Waypoint: Generate Random Whole Numbers within a Range
Rex Schrader
@SaintPeter
Aug 18 2015 01:07
@DanStockham ok - another note: You need to return an actual function when there is only one argument - you may not have gotten there yet.
Dan Stockham
@DanStockham
Aug 18 2015 01:08
@SaintPeter But the second set of parentheses don't mean anything right? Wouldn't I need to set up add() to about to wait for another function?
Fabio
@FabioSeves
Aug 18 2015 01:08
@DanStockham You need to make a function that waits for the second argument
Dan Stockham
@DanStockham
Aug 18 2015 01:10
Hmmm... let me figure that one out.
Rex Schrader
@SaintPeter
Aug 18 2015 01:14
@DanStockham Think of it this way: The first call passes in a single argument and returns a function - a function which can be called with the secon set of parentheses with a second single argument.
Dan Stockham
@DanStockham
Aug 18 2015 01:16
@SaintPeter Oh I see, so basically add() takes one argument 2 and it will return itself. The second parentheses is add().
Rex Schrader
@SaintPeter
Aug 18 2015 01:17
@DanStockham Not itself, per se. It's actually returning a function. Remember that functions are "first class objects", just like a string or an array.
@DanStockham One way you can decalre a funciton is like this:
var funct = function(thing) {
   return thing + 1;
}
Just by example.
@DanStockham You can then pass "funct" into another function, store it in an array or an object . . slice it, dice it, etc.
Dan Stockham
@DanStockham
Aug 18 2015 01:20
Hmmm...
It is still bit foggy.
Dan Stockham
@DanStockham
Aug 18 2015 01:26
I'm still kinda of lost here:
function add() {
 var addAgain = function(val) {
   return val + add(); 

 };

 if(typeof arguments === "number") {

    return addAgain(arguments[1]);

  } else {

    return undefined;
  }


}

add(2)(3);
Rex Schrader
@SaintPeter
Aug 18 2015 01:27
@DanStockham You're on the right track, but you can't make a call to add from within a function within itself. You're going to need to add that first parameter.
Dan Stockham
@DanStockham
Aug 18 2015 01:30
var addAgain = function(val) {
   return val + add(); 
 };

function add() {


 if(typeof arguments === "number") {

    return addAgain(arguments);

  } else {

    return undefined;
  }


}

add(2)(3);
Rex Schrader
@SaintPeter
Aug 18 2015 01:31
@DanStockham addAgain without parenthes, returns a function. With paretheses it tries to call itself.
Dan Stockham
@DanStockham
Aug 18 2015 01:32
That make sense to me that we need an function outside our main one and we need to return that function to work but I still don't understand how I can get the second set to be used in addAgain within add()
Rex Schrader
@SaintPeter
Aug 18 2015 01:32
@DanStockham Step one: Determine the number of arguments and set up logic for doing things with either one or two arguments.
Dan Stockham
@DanStockham
Aug 18 2015 01:37
Well we know it has to be a number and if the argument length is less than 2 -> pass into addAgain()
Rex Schrader
@SaintPeter
Aug 18 2015 01:38
@DanStockham The key thing here is to NOT pass it into addAgain. You can't "call" addAgain. You have to define it and return it, uncalled.
Dan Stockham
@DanStockham
Aug 18 2015 01:41
I don't really understand a function will not work unless it has a value passed into it.
Rex Schrader
@SaintPeter
Aug 18 2015 01:42
@DanStockham It's like an unexploded firecracker. It's still something you can pass around. the only way to make it explode is to lite it's fuse/call it
eeseesee
@eeseesee
Aug 18 2015 01:54
I am working through the new jQuery pages. Does anyone know what exactly are they asking for in the Waypoint: Target the same element with multiple jQuery Selectors"? This is what I came up with:
<script>
$(document).ready(function() {
$("button").addClass("animated");
$(".btn").addClass("shake");
$("#target1").addclass("btn-primary");
});
</script>
...but I get the following errors: (1) Only add one class with each of your three selectors.
(2) Your #target1 element should have the classes animated‚ shake and btn-primary.
Ah sorry...lower case c in class
miss ji
@starlessji
Aug 18 2015 01:56
@eseesee it looks right. I also had to reload the page a few times to move forward.
eeseesee
@eeseesee
Aug 18 2015 01:56
Just seeing the code in a different font helped a lot!
miss ji
@starlessji
Aug 18 2015 01:56
addClass
Jamie King
@king0120
Aug 18 2015 02:00
Can anyone with some $.getJSON knowledge help me out? I don’t know why my method is randomly failing for seemingly no reason.

http://s.codepen.io/king0120/debug/OVGdjE?

For example, if you refresh the page, some of the twitch users will show up just fine, while others will only have a <p> element saying Offline

Rex Schrader
@SaintPeter
Aug 18 2015 02:03
@king0120 Humm
@king0120 You're appending to streamerHTML - I'm wondering if you have a race condition? If more than one call comes back at the same time it might interlace them? I don't know if that's even possible.
Jamie King
@king0120
Aug 18 2015 02:05
would there be any way to make sure they come back one at a time?
Rex Schrader
@SaintPeter
Aug 18 2015 02:06
@king0120 You need to call your second $.getJSON (the one for the stream status) inside your success function for the first one.
Jamie King
@king0120
Aug 18 2015 02:08
@SaintPeter That fixed it! And fixed an issue I was having with the buttons. Thanks!!
CamperBot
@camperbot
Aug 18 2015 02:08
king0120 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 206 | @saintpeter | http://www.freecodecamp.com/saintpeter
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 02:15

Okay. I'm working on Symmetric difference. I think I just didn't understand the concept of symmetric differences, cause I got it to work on the first test but not the rest. I could do it easy with looping but I'm trying to stay away from that:

function sym(args) {
        var symetric = Array.from(arguments)
           .reduce(function (prev, curr) {
               return prev.concat(curr);
        });
        symetric = symetric.filter(function (elem) {
            var counter = 0;
            symetric.forEach(function (obj) {
                if (obj === elem) counter++;
            });
            return counter === 1;
        });
        return symetric;
    }

    console.log(sym([1, 2, 3], [5, 2, 1, 4]));

(oh, and you may have to polyfill Array.from)

TuiLaHiep
@TuiLaHiep
Aug 18 2015 02:41
sr guys can anyone help me ??

```function reverseString(str) {
var arrString = str.split(' ');
var arrReverse = arrString.reverse();
str = arrReverse.join(' ');
return str;
}

reverseString('hello');```

i dont know where i go wrong
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 02:46
@TuiLaHiep are there spaces in between your apostrophes?
TuiLaHiep
@TuiLaHiep
Aug 18 2015 02:47
@ChadKreutzer yes it is
Moisés Man
@moigithub
Aug 18 2015 02:48
add some console.log
check what ur commands are doin with ur data
and if the function.. its suppose to do what u think it should...
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 02:48
@TuiLaHiep you don't want them (instead of str.split(' ') you want str.split(''))
likewise for join
TuiLaHiep
@TuiLaHiep
Aug 18 2015 02:50
@ChadKreutzer @moigithub thank u guys it worked :smile: :+1:
CamperBot
@camperbot
Aug 18 2015 02:50
tuilahiep sends brownie points to @chadkreutzer and @moigithub :sparkles: :thumbsup: :sparkles:
:star: 2 | @moigithub | http://www.freecodecamp.com/moigithub
:star: 181 | @chadkreutzer | http://www.freecodecamp.com/chadkreutzer
Rex Schrader
@SaintPeter
Aug 18 2015 02:51
@ChadKreutzer Did you get any further?
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 02:52
@SaintPeter Than what I posted a little bit ago? Not to the typing stage, but I'm thinking I need to perhaps somehow move the filter into the reduce.
Donavin Northrup
@dnorthrupva
Aug 18 2015 02:53
help
CamperBot
@camperbot
Aug 18 2015 02:53

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

Donavin Northrup
@dnorthrupva
Aug 18 2015 02:53
find Waypoint: Create Bootstrap Wells
CamperBot
@camperbot
Aug 18 2015 02:53
find waypoint create bootstrap wells
nothing found
Donavin Northrup
@dnorthrupva
Aug 18 2015 02:53
Didn’t work!
I’m trying to see if anyone knows why it’s bugged?
Rex Schrader
@SaintPeter
Aug 18 2015 02:54
@ChadKreutzer ok, here is my hint: You cannot do it all at once. You have to do the Symdiff of A and B, and then take that results and diff it with C
@ChadKreutzer This code:
var symetric = Array.from(arguments)
           .reduce(function (prev, curr) {
               return prev.concat(curr);
        });
Will not work . . . well, it'll work, but it means you don't understand how a Symmetric Diffference works
I bet you're confused about the 5, right?
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 02:55
not anymore. I watched the video at the link after my code didn't work.
Rex Schrader
@SaintPeter
Aug 18 2015 02:55
Ah, ok
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 02:55
so I see how my concept won't work.
Rex Schrader
@SaintPeter
Aug 18 2015 02:56
I suggest you write a seperate function that calculates the difference between two arrays.
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 02:56
well, it'll work for only two sets as long as there aren't any duplicates in each set.
Donavin Northrup
@dnorthrupva
Aug 18 2015 02:56
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="well">
    <div class="row">
    <div class="col-xs-6"></div>
    <div class="col-xs-6"></div>
    </div></div>
</div>
I re-wrote the code t match all the requirements and it says one is still missing.
Rex Schrader
@SaintPeter
Aug 18 2015 02:57
@dnorthrupva Dont' you need two wells?
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 02:57
hmm. okay. I gotta go do a patrol (I'm coding at work) and I'll chew on it while I'm gone.
Donavin Northrup
@dnorthrupva
Aug 18 2015 02:58
Add two div elements inside your div class="well"> element both with the class col-xs-6
Nest both of your div class="col-xs-6" elements within your div class="row" element.
Make sure all your div elements have closing tags.
Are the requirements. It’s the middle one that is never met.
NO matter how I re-write it.
Rex Schrader
@SaintPeter
Aug 18 2015 02:59
@dnorthrupva I don't see two divs with classes of well. I only see one.
@dnorthrupva Moreover, they need to be inside the divs with the class="col-xs-6"
Donavin Northrup
@dnorthrupva
Aug 18 2015 03:00
@SaintPeter I do’nt see a requirement for two class-wells. I see it wanting 2 ‘col-xs-6’s inside of your one well.
Rex Schrader
@SaintPeter
Aug 18 2015 03:00
@dnorthrupva "Nest one div element with the class well within each of your col-xs-6 div elements."
(emphasis added)
blob
Donavin Northrup
@dnorthrupva
Aug 18 2015 03:01
Ahh you’re right. I was just bug-testing by going through the objectives, not reading the tutorial. Seems like over-sight for the requirements to have the opposite of the explaination. Thanks @SaintPeter
CamperBot
@camperbot
Aug 18 2015 03:01
dnorthrupva sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 208 | @saintpeter | http://www.freecodecamp.com/saintpeter
André Luiz Souza Costa
@andrelscosta
Aug 18 2015 03:18
@all What happened to my freecodecamp's map, i already did Jquery/Basic Javascript, now that changed it says that i did nothing of it.
malavender
@malavender
Aug 18 2015 03:19
@andrelscosta They changed those two courses
@andrelscosta Remember? Those courses used to point to external sites
Marc Davenport
@oneate7
Aug 18 2015 03:19
@andrelscosta - Those sections are now freecodecamp's own courses instead of codeacademy.
malavender
@malavender
Aug 18 2015 03:20
@andrelscosta FCC replaced those with their own courses
André Luiz Souza Costa
@andrelscosta
Aug 18 2015 03:20
@malavender So i have to start all over? Thats akward.
malavender
@malavender
Aug 18 2015 03:20
@andrelscosta I re-did them. Only took an hour. Knocked it out easy.
Marc Davenport
@oneate7
Aug 18 2015 03:20
@andrelscosta No. You can do them over for a refresher if you want.
The waypoints aren't important though. The bonfires, ziplines, etc are the things that you have to do.
André Luiz Souza Costa
@andrelscosta
Aug 18 2015 03:22
@oneate7 Good point, im at Basic Algorithm Scripting, so ill keep doing it until the end and do the rest as a refresher, thx pal.
CamperBot
@camperbot
Aug 18 2015 03:22
andrelscosta sends brownie points to @oneate7 :sparkles: :thumbsup: :sparkles:
:star: 145 | @oneate7 | http://www.freecodecamp.com/oneate7
malavender
@malavender
Aug 18 2015 03:22
I'm having trouble with a navbar on codepen.io. If I use Bootstrap's navbar in a local file, drop downs and collapsed menus work fine. But they don't work on codepen.io. Any suggestions? They work in one of the Zipline examples :/
Marc Davenport
@oneate7
Aug 18 2015 03:23
@malavender - Did you add bootstrap to the pen in the settings?
malavender
@malavender
Aug 18 2015 03:25
@oneate7 yes...the navbar looks pretty good...but once the screen gets small and the menu collapses, the "dropdown" doesn't work
and the dropdowns don't work no matter the size of the screen :(
Marc Davenport
@oneate7
Aug 18 2015 03:27
@malavender - Ah... well unfortunately that was the extent of my knowledge on the subject :wink: Sorry
malavender
@malavender
Aug 18 2015 03:28
LOL. But decent suggestion. Thanks anyway. @oneate7
CamperBot
@camperbot
Aug 18 2015 03:28
malavender sends brownie points to @oneate7 :sparkles: :thumbsup: :sparkles:
:star: 146 | @oneate7 | http://www.freecodecamp.com/oneate7
malavender
@malavender
Aug 18 2015 03:35
I figured it out. @oneate7 you were sort of close. While I had bootstrap, I apparently didn't have a recent enough version. I updated to the latest and wa-la! It worked.
Marc Davenport
@oneate7
Aug 18 2015 03:35
@malavender - Awesome! YOU'RE WELCOME.
j/k, glad you figured it out :wink2:
malavender
@malavender
Aug 18 2015 03:36
Thanks...though I'm probably like a blind squirrel who just happened to find a nut :)
CamperBot
@camperbot
Aug 18 2015 03:36
if you want to thank someone, put an @ before their name!
malavender
@malavender
Aug 18 2015 03:36
Thanks, @camperbot
CamperBot
@camperbot
Aug 18 2015 03:36
malavender sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 10 | @camperbot | http://www.freecodecamp.com/camperbot
Marc Davenport
@oneate7
Aug 18 2015 03:37
@malavender - So basically, a programmer?
malavender
@malavender
Aug 18 2015 03:40
@oneate7 lol, true that ... I was watching a video recently by Douglas Crockford, where he pointed out that we like to think we spend lots of our development time typing code, whereas most of the time is spent trying to figure out where our typos are.
Marc Davenport
@oneate7
Aug 18 2015 03:42
It's embarrassing how often I fiddle around with code until it works but I have no idea why.
malavender
@malavender
Aug 18 2015 03:43
oh yeah, been there done that
Rockpile
@rock-pile
Aug 18 2015 03:47
whaaaat.. all my progress. fone
gone
guess the update wiped the progress and introduced new modules?
Rockpile
@rock-pile
Aug 18 2015 04:03
crickets
Jesse
@jctm30
Aug 18 2015 04:05
lol
TuiLaHiep
@TuiLaHiep
Aug 18 2015 04:09
hi guys
can anyone help me
function palindrome(str) {
  // Good luck!
  var check = str.toLowerCase().split('').reverse().join( '');
  if(check === str) {
    console.log("the word is a palindrome");
  } else {
    console.log("not a palindrome");
  }
  return true;
}



palindrome("eye")
the console keep telling me "expected true to deeply equal false"
Paul Dynowski
@pdynowski
Aug 18 2015 04:15
@TuiLaHiep well, you're returning true no matter what the check says
so, the system is expecting false for one of the tests, and you're returning true
TuiLaHiep
@TuiLaHiep
Aug 18 2015 04:15
@pdynowski oh yes
but how can i fix this
Paul Dynowski
@pdynowski
Aug 18 2015 04:16
@TuiLaHiep well, you can move the return statement into the if/then, and return true for the true side, false for the else side
TuiLaHiep
@TuiLaHiep
Aug 18 2015 04:18
@pdynowski It's not working
the console now say ""assert.deepEqual(palindrome("some string"), true);expected false to deeply equal true""
i think my error is in the expression
maybe because "some string "has a space ?
Paul Dynowski
@pdynowski
Aug 18 2015 04:22
yeah. you may need to strip the spaces out...
TuiLaHiep
@TuiLaHiep
Aug 18 2015 04:23
@pdynowski yeah thank u
CamperBot
@camperbot
Aug 18 2015 04:23
tuilahiep sends brownie points to @pdynowski :sparkles: :thumbsup: :sparkles:
:star: 147 | @pdynowski | http://www.freecodecamp.com/pdynowski
Paul Dynowski
@pdynowski
Aug 18 2015 04:26
you're quite welcome.
Steven Young
@ShelbyGT
Aug 18 2015 04:27
Now modify the data stored at index 0 of myArray to the value of 3., for wayoint: Modify Array Data With Indexes,, I am not understanding what they want?????
NVM i figured it out,,lol
Prashanth
@dgprashanth
Aug 18 2015 05:37
Guys, need some help. I'm on the title case conversion task, and I found this solution online which I don't totally understand, but would like to
function toTitleCase(str)
{
return str.replace(/\w+/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}
I donot understand the part after "\/w+/g,.........."
What is it exactly doing there? I want to know if there is some documentation I can look at regarding this function(txt){...................}
This works for most of the issues while I'm solving the task except when it changes "I'm a little teapot" to " I'M A Little Teapot"
So clearly, it doesn't work well after '
Herman
@KokkieH
Aug 18 2015 05:47
@dgprashanth The str.replace method takes two arguments: The first is a RegEx or substring that should match the text to be replaced. The second is either the substring OR a function that takes the first parameter (your RegEx) as argument and returns a new value, in this case changing the case. Read the description of the Replace method here for more details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 05:49
@dgprashanth Your regexp is being thrown by the "'" in "I'm". Check out http://www.regexr.com/ and play aorund with it, you should be able to figure it out. Regarding the rest, it's looking at the first character of your expression (.charAt(0)) and changing it to uppercase, then taking the rest of the expression (.substr(1)) and making sure it's all lowercase.
Prashanth
@dgprashanth
Aug 18 2015 05:50
@KokkieH So it is the replace method being used here? Alright cool! Will check it out! Thanks :clap:
CamperBot
@camperbot
Aug 18 2015 05:50
dgprashanth sends brownie points to @kokkieh :sparkles: :thumbsup: :sparkles:
:star: 293 | @kokkieh | http://www.freecodecamp.com/kokkieh
Prashanth
@dgprashanth
Aug 18 2015 05:51
@ChadKreutzer Thanks! Will check this out and see how I can complete the remaining part of the task :D
CamperBot
@camperbot
Aug 18 2015 05:51
dgprashanth sends brownie points to @chadkreutzer :sparkles: :thumbsup: :sparkles:
:star: 188 | @chadkreutzer | http://www.freecodecamp.com/chadkreutzer
Herman
@KokkieH
Aug 18 2015 05:51
@dgprashanth As @ChadKreutzer said, the reason your code won't work is in your RegEx. w+ matches alphanumeric characters, so it DOESN'T match the apostrophe, which means the replace-method sees the "m" as a new word. Try editing your RegEx to look for whitespace instead. You might need to tweak the function as well.
@dgprashanth Yes, it's the replace-method. Look at the start of your answer: return str.replace :)
Prashanth
@dgprashanth
Aug 18 2015 05:53
@KokkieH Ah yeah. it was right under my nose the whole time and I kept trying to make sense of it. I suppose learning programming is all about asking the right questions! Thanks again
CamperBot
@camperbot
Aug 18 2015 05:53
dgprashanth sends brownie points to @kokkieh :sparkles: :thumbsup: :sparkles:
:warning: dgprashanth already gave kokkieh points
Herman
@KokkieH
Aug 18 2015 05:54
@dgprashanth No problem :)
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 05:56
@KokkieH lol. It's a fine line to walk between giving the answer and giving help. :D
Herman
@KokkieH
Aug 18 2015 05:57
@ChadKreutzer Very true!
I do volunteer tech support on WordPress, so I tend to err on the side of too much info :smile:
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 05:59
I do too. I see people give these well crafted hints and directions right after I just blurt the answer.
TuiLaHiep
@TuiLaHiep
Aug 18 2015 05:59
help me pls
CamperBot
@camperbot
Aug 18 2015 05:59
no wiki entry for: me pls
:pencil: click here to create one now!after creating your page type update to reload it here
TuiLaHiep
@TuiLaHiep
Aug 18 2015 06:00
function palindrome(str) {
  // Good luck!
  str.replace(/ /g,'').toLowerCase();
  var len = str.length;
  for ( var i = 0; i < Math.floor(len/2); i++ ) {
      if (str[i] !== str[len - 1 - i]) {
          return false;
      }
  }
  return true;
}

palindrome("eye");
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 06:00
hello again, @TuiLaHiep what's up?
TuiLaHiep
@TuiLaHiep
Aug 18 2015 06:00
hello again @ChadKreutzer
the console teeling me this
expect(palindrome("eye")).to.be.a("boolean");
assert.deepEqual(palindrome("eye"), true);
assert.deepEqual(palindrome("race car"), true);expected false to deeply equal true
assert.deepEqual(palindrome("not a palindrome"), false);
assert.deepEqual(palindrome("A man, a plan, a canal. Panama"), true);expected false to deeply equal true
assert.deepEqual(palindrome("never odd or even"), true);expected false to deeply equal true
assert.deepEqual(palindrome("nope"), false);
assert.deepEqual(palindrome("almostomla"), false);
i dont know where i went wrong
i currently in Bonfire: Check for Palindromes
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 06:06
@TuiLaHiep I'm not sure about your regexp there. (it's empty) also, I think I see what you are trying to do with the loop, but look into splitting, reversing and joining. it might make it easier.
TuiLaHiep
@TuiLaHiep
Aug 18 2015 06:08
@ChadKreutzer I want to strip the white spaces from my string with that regexp.Yes i will try again with your method
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 06:10
I'll tell you the same thing I told @dgprashanth : play around with www.regexer.com.
TuiLaHiep
@TuiLaHiep
Aug 18 2015 06:14
@ChadKreutzer i try again with your method
function palindrome(str) {
  // Good luck!
  str = str.replace(/ /g,'');
  if(str !== str.toLowerCase().split().reverse().join()) {
    console.log("not a palindrome");
    return false;

  } else {
    console.log("the word is a palindrome");
    return true;
  }

}

palindrome("eye");
but the console still tell me
expect(palindrome("eye")).to.be.a("boolean");
assert.deepEqual(palindrome("eye"), true);
assert.deepEqual(palindrome("race car"), true);
assert.deepEqual(palindrome("not a palindrome"), false);expected true to deeply equal false
assert.deepEqual(palindrome("A man, a plan, a canal. Panama"), true);expected false to deeply equal true
assert.deepEqual(palindrome("never odd or even"), true);
assert.deepEqual(palindrome("nope"), false);expected true to deeply equal false
assert.deepEqual(palindrome("almostomla"), false);expected true to deeply equal false
Prashanth
@dgprashanth
Aug 18 2015 06:17
@TuiLaHiep If you look closely, I don't think your code is getting rid of commas(,) and periods(.)
You will have to add to your regexp to get rid of those things as well. If those things stay the way they are input, then those sentences will NOT be palindromes anymore
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 06:18
@TuiLaHiep you are on the right track, @dgprashanth has a point. also, consider you would have to make sure that both sides are completely the same except for the reversing...
TuiLaHiep
@TuiLaHiep
Aug 18 2015 06:19
@dgprashanth yes i just saw it now.but what about "assert.deepEqual(palindrome("nope"), false);expected true to deeply equal false"
Prashanth
@dgprashanth
Aug 18 2015 06:20
@TuiLaHiep Perhaps try reversing the IF-ELSE to return positive first and negative Later?
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 06:20
(apply the .toLowerCase() to both sides)
TuiLaHiep
@TuiLaHiep
Aug 18 2015 06:25
i applied the .toLowerCase() to both sides and reverse the if else statement but it didn't work
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 06:29
what does the code look like now?
Prashanth
@dgprashanth
Aug 18 2015 06:29
@TuiLaHiep Yes, you still have the original issues left to deal with. Try this, Try writing down the text AS IT IS on paper. Reverse and see what is getting in the way
@TuiLaHiep Remember: The Computer takes everything you say LITERALLY. :D
TuiLaHiep
@TuiLaHiep
Aug 18 2015 06:30
the code look like this now
function palindrome(str) {
  // Good luck!
  str = str.replace(/ /g,'').toLowerCase();
  if(str == str.split().reverse().join()) {
    console.log("the word is a palindrome");
    return true; 
  } else {
    console.log("not a palindrome");
    return false;
  }

}

palindrome("eye");
and still same error :worried:
Prashanth
@dgprashanth
Aug 18 2015 06:31
Yes, let us take this example, "A man, a plan, a canal. Panama"
As of now, you have removed the spaces
And converted it to lower case
TuiLaHiep
@TuiLaHiep
Aug 18 2015 06:32
oh yes
Prashanth
@dgprashanth
Aug 18 2015 06:32
So, it should look like this " aman,aplan,acanal.panama" on the Left hand side
And on the right hand side, it looks like this "amanap.lanaca,nalpa,nama"
aman,aplan,acanal.panama is NOT equal to amanap.lanaca,nalpa,nama, right?
TuiLaHiep
@TuiLaHiep
Aug 18 2015 06:34
yes
i see
Prashanth
@dgprashanth
Aug 18 2015 06:34
But do you realise why?
Once you do, you will atleast know where to look and how to fix it
TuiLaHiep
@TuiLaHiep
Aug 18 2015 06:35
so
now i must remove the dot and comma too
right?
Prashanth
@dgprashanth
Aug 18 2015 06:35
Yep! :smile:
TuiLaHiep
@TuiLaHiep
Aug 18 2015 06:36
@dgprashanth @ChadKreutzer thank you you guys is great
CamperBot
@camperbot
Aug 18 2015 06:36
tuilahiep sends brownie points to @dgprashanth and @chadkreutzer :sparkles: :thumbsup: :sparkles:
:star: 196 | @chadkreutzer | http://www.freecodecamp.com/chadkreutzer
:star: 211 | @dgprashanth | http://www.freecodecamp.com/dgprashanth
TuiLaHiep
@TuiLaHiep
Aug 18 2015 06:36
i think i will take a break now
this excersise gave me a headache :smile:
May Dotimas
@emarino0411
Aug 18 2015 06:37
good day fellow campers!
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 06:39
@TuiLaHiep glad we could help.
@emarino0411 good day.
May Dotimas
@emarino0411
Aug 18 2015 06:40
I am having a great time here
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 06:43
@emarino0411 As am I.
May Dotimas
@emarino0411
Aug 18 2015 06:45
@ChadKreutzer how are you? ^_^ I just started the exercises.
Prashant Kumar
@pras09
Aug 18 2015 06:46
@/all , I am stuck at Waypoint: Give your JavaScript Slot Machine some stylish images.
I am not able to clear the first check point and not able to find what is wrong with the code.
Please help
blob
DTing
@dting
Aug 18 2015 06:49
@pras09 did you read the instructions above the green bar?
Prashant Kumar
@pras09
Aug 18 2015 06:50
@dting The thing about pressing GO button?
So does that mean I have to use slotOne's value for all three slots atleast once?
DTing
@dting
Aug 18 2015 06:51
try taking out the spaces
images[slotOne - 1] images[slotOne-1]
I think they use regex to check the code. It is probably strict on the spaces.
Prashant Kumar
@pras09
Aug 18 2015 06:53
@dting Thanks man! that worked.
CamperBot
@camperbot
Aug 18 2015 06:53
pras09 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 292 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 18 2015 06:53
nps
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 06:57
@emarino0411 doing pretty well. I've been working through them for a while. I'm plugging along with the Symmetric one right now and going back to fill in the new gaps right now. and I have about a third of a pint left before I head home.
May Dotimas
@emarino0411
Aug 18 2015 07:00
nice!
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 07:10
And time to go home.
May Dotimas
@emarino0411
Aug 18 2015 07:39
take care
Philosoraptor1981
@Philosoraptor1981
Aug 18 2015 07:45
Anyone around working on the new content?
I'm going back over the Jquery bit...and my nth-child function isn't working
$(".well:nth-child(2)").addClass("animated bounce");
DTing
@dting
Aug 18 2015 07:52
@Philosoraptor1981 add a space between .well and :nth-child
Philosoraptor1981
@Philosoraptor1981
Aug 18 2015 07:53
I just hard coded it instead
For some reason it wanted two elements on one well...idk..it didn't make much sense.
TuiLaHiep
@TuiLaHiep
Aug 18 2015 07:54
Can anyone help me
i'm on Bonfire: Check for Palindromes
and this is my code
function palindrome(str) {
  // Good luck!
  str = str.replace(/ /g,'').toLowerCase();
  if(str !== str.split().reverse().join()) {
    return false;
  } else {
    return true; 
  }

}

palindrome("eye");
it doesnt work :worried:
Philosoraptor1981
@Philosoraptor1981
Aug 18 2015 07:55
What error are you getting?
TuiLaHiep
@TuiLaHiep
Aug 18 2015 07:55
this is my console log
expect(palindrome("eye")).to.be.a("boolean");
assert.deepEqual(palindrome("eye"), true);
assert.deepEqual(palindrome("race car"), true);
assert.deepEqual(palindrome("not a palindrome"), false);expected true to deeply equal false
assert.deepEqual(palindrome("A man, a plan, a canal. Panama"), true);
assert.deepEqual(palindrome("never odd or even"), true);
assert.deepEqual(palindrome("nope"), false);expected true to deeply equal false
assert.deepEqual(palindrome("almostomla"), false);expected true to deeply equal false
DTing
@dting
Aug 18 2015 07:55
@TuiLaHiep you want to replace not only spaces but anything that isnt a letter. try using the regex /[^a-zA-Z]/
Philosoraptor1981
@Philosoraptor1981
Aug 18 2015 07:56
Her regex works in my ide
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 07:57
It won't work in every case.
Philosoraptor1981
@Philosoraptor1981
Aug 18 2015 07:58
No actually it doesn't work in my ide
Yours doesn't remove white space Dting
TuiLaHiep
@TuiLaHiep
Aug 18 2015 07:59
yes
Bill
@kirah1314
Aug 18 2015 07:59
@TuiLaHiep you'll also need '' in the split() and join()
TuiLaHiep
@TuiLaHiep
Aug 18 2015 07:59
i know the problem is in my regex
DTing
@dting
Aug 18 2015 07:59
@TuiLaHiep you also need to split('')
@kirah1314 beat me to it
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 08:00
/[^w*]/g will work.
TuiLaHiep
@TuiLaHiep
Aug 18 2015 08:00
@dting Wow its work
thank u guys
CamperBot
@camperbot
Aug 18 2015 08:00
if you want to thank someone, put an @ before their name!
TuiLaHiep
@TuiLaHiep
Aug 18 2015 08:01
freecodecamp is great :smile:
@ChadKreutzer @dting @kirah1314 @Philosoraptor1981 thanks
CamperBot
@camperbot
Aug 18 2015 08:01
tuilahiep sends brownie points to @chadkreutzer and @dting and @kirah1314 and @philosoraptor1981 :sparkles: :thumbsup: :sparkles:
:star: 168 | @philosoraptor1981 | http://www.freecodecamp.com/philosoraptor1981
:star: 295 | @dting | http://www.freecodecamp.com/dting
:star: 149 | @kirah1314 | http://www.freecodecamp.com/kirah1314
:star: 198 | @chadkreutzer | http://www.freecodecamp.com/chadkreutzer
DTing
@dting
Aug 18 2015 08:01
@TuiLaHiep your split with out '' will split on spaces and give you the array ['eye'] rather than ['e', 'y', 'e']
TuiLaHiep
@TuiLaHiep
Aug 18 2015 08:02
your regex work great @dting
chicachicamji
@chicachicamji
Aug 18 2015 08:05
whats wrong with this? it seems to work but FCC wont let me go to the next bonfire
function largestOfFour(arr) {
  var Largest;
  var largestArray = [];
  for(var x = 0; x < arr.length; x++) {
    for(var y = 0; y < arr[x].length; y++) {
      if(arr[x][0] < arr[x][1]) {
        Largest = arr[x][1];
      } if(Largest < arr[x][2]) {
        Largest = arr[x][2];
      } if(Largest < arr[x][3]) {
        Largest = arr[x][3];
      }
    }
    largestArray.push(Largest);
  }
  return largestArray;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
DTing
@dting
Aug 18 2015 08:06
@chicachicamji you want to move the largest declaration into the first forloop so it gets reset each time.
Woolwit
@Woolwit
Aug 18 2015 08:06
Could it be possible to add an if statement to handle different cases, or am I approaching this entirely wrong?
function spinalCase(str) {
  function upperToHyphenLower(match) {
    return '-' + match.toLowerCase();
  }
  return str.replace(/[A-Z]/g, upperToHyphenLower);
}
console.log(spinalCase("thisIsSpinalTap"));
console.log(spinalCase("The_Andy_Griffith_Show"));
console.log(spinalCase("teletubbies say Eh-oh"));
prameela
@prameelak
Aug 18 2015 08:07
Hi everyone...I am new joinee in this FreeCodecamp.
hakimnasir
@hakimnasir
Aug 18 2015 08:07
Hi campers, I have a job interview tomorrow and need little help. Can someone proof read a paragraph for me to make sure there are no grammar errors.
Philosoraptor1981
@Philosoraptor1981
Aug 18 2015 08:07
C+P it Titans
chicachicamji
@chicachicamji
Aug 18 2015 08:07
@dting that didn't do anything
DTing
@dting
Aug 18 2015 08:09
@chicachicamji
  var largestArray = [];
  for(var x = 0; x < arr.length; x++) {
    var Largest;
hakimnasir
@hakimnasir
Aug 18 2015 08:09
This message was deleted
prameela
@prameelak
Aug 18 2015 08:09
I have a problem with Jquery lessons - Target the children of an element. In that actually it was asked to chage the text color of target6 to green. Can anyone suggest a solution to this using children().
Woolwit
@Woolwit
Aug 18 2015 08:09
Hi @prameelak welcome to FCC!
prameela
@prameelak
Aug 18 2015 08:09
Hi..
chicachicamji
@chicachicamji
Aug 18 2015 08:11
@dting yeah i did that it didn't do anything
DTing
@dting
Aug 18 2015 08:11
@chicachicamji oh
Philosoraptor1981
@Philosoraptor1981
Aug 18 2015 08:11
@prameelak
$("#target6").children().addClass("color: green");  I think
DTing
@dting
Aug 18 2015 08:11
@chicachicamji change your hard coded second index to y
chicachicamji
@chicachicamji
Aug 18 2015 08:12
@dting it seems to be working it just wont let me go to the next bonfire
Chad Kreutzer
@ChadKreutzer
Aug 18 2015 08:14
@Woolwit I used an if-else framework on that one and it worked just fine.
prameela
@prameelak
Aug 18 2015 08:15
@Philosoraptor1981 actually i tried that with css not addClass
for addClass we cannot use property and value concept.
Woolwit
@Woolwit
Aug 18 2015 08:16
@ChadKreutzer thanks, I will try something in that area. Was intrigued by this approach which was in the suggested MDN documentation.
CamperBot
@camperbot
Aug 18 2015 08:16
woolwit sends brownie points to @chadkreutzer :sparkles: :thumbsup: :sparkles:
DTing
@dting
Aug 18 2015 08:16
@chicachicamji your code doesnt pass the last test because you are hard coding the nest forloop.
CamperBot
@camperbot
Aug 18 2015 08:16
:star: 199 | @chadkreutzer | http://www.freecodecamp.com/chadkreutzer
Philosoraptor1981
@Philosoraptor1981
Aug 18 2015 08:17
@prameelak are you using an ID or Class selector?
@titans8pride Here are my recommendations
In order to guarantee that the relevant step is played when the Walk-Thru is started in the middle of the process we can take advantage of the “Super Steps”. Super steps do not have guide balloons instead they perform actions of the walk-thru itself or the page they are set on. Super steps can be accessed by clicking the lighting plus button located at the top right of the walkMe editor (see image 1). Then go to the “Jump” section and click on “To the middle of a Walk-Thru”. Once there, select the step that you want the walk-thru to start at once the user lands on a specific page or if some fields of the page are already present. After that we need to make a rule for that jump to happen. There are many options to pick from under the drop-down menu, but the one recommended is “On Screen Element”. Pick an element on the page and operator to along with the element that will trigger the walk-thru to jump to the specific step. For example: user already signed in or save button is disabled or the specific text is not present or check-box is missing. These are just few examples but variety of combinations can be used to achieve best results. Once the rule is created click “Done.” After the rule is created it will be placed at the bottom the list where it is not really useful. Placement of the super-step is really important it should be placed at the beginning of the Walk-Thru. It ensures that the walk-thru first checks if the user is in the middle of the walk-thru. If the user is in the middle, then it will jump to the correct step, but if the user is not, then the Walk-Thru will start from the beginning.
@prameelak which Jquery lesson are you on?
prameela
@prameelak
Aug 18 2015 08:18
its ID selector
Philosoraptor1981
@Philosoraptor1981
Aug 18 2015 08:18
Okay...which lesson are you on?
prameela
@prameelak
Aug 18 2015 08:19
Jquery 14th lesson
Philosoraptor1981
@Philosoraptor1981
Aug 18 2015 08:21
@prameelak
$("#right-well").children().css("color", "green");
It wants you to change the children of right-well
Not Target6
prameela
@prameelak
Aug 18 2015 08:22
yes
ok leave it
Philosoraptor1981
@Philosoraptor1981
Aug 18 2015 08:22
Right, so the above clears that lesson.
prameela
@prameelak
Aug 18 2015 08:22
I'll go with next lessons
thank you
CamperBot
@camperbot
Aug 18 2015 08:22
if you want to thank someone, put an @ before their name!
prameela
@prameelak
Aug 18 2015 08:22
@Philosoraptor1981
cong2207it
@cong2207it
Aug 18 2015 08:23
anyone can help me with arguments optional plz!
Philosoraptor1981
@Philosoraptor1981
Aug 18 2015 08:25
Not that far yet...sorry Cong!
hakimnasir
@hakimnasir
Aug 18 2015 08:26
thanks @Philosoraptor1981
CamperBot
@camperbot
Aug 18 2015 08:26
titans8pride sends brownie points to @philosoraptor1981 :sparkles: :thumbsup: :sparkles:
:star: 176 | @philosoraptor1981 | http://www.freecodecamp.com/philosoraptor1981
Philosoraptor1981
@Philosoraptor1981
Aug 18 2015 08:27
np Titan
codecampgirl
@codecampgirl
Aug 18 2015 08:28
@fcordoba84 Hi, you have created an id of #cat-photo-element {background-color: green;}> in your styles. But you are applying an id with the name of cat-photo-form to your form element as in <form action="/submit-cat-photo" id="cat-photo-form"> Change the name of your id to be the same in the styles section and in the form element. And remove the closing angle bracket after the style declaration.
cong2207it
@cong2207it
Aug 18 2015 08:46
that's ok @Philosoraptor1981 !
Placid Rodrigues
@placidrod
Aug 18 2015 09:10
Hi All, I am trying to understand a permutation algorithm found on Stack Overflow. Does anyone have time to help me? The code is:
function permutator(inputArr) {
  var results = [];

  function permute(arr, memo) {
    var cur
    var memo = memo || [];

    for (var i = 0; i < arr.length; i++) {
      cur = arr.splice(i, 1);
      if (arr.length === 0) {
        results.push(memo.concat(cur));
      }
      permute(arr.slice(), memo.concat(cur));
      arr.splice(i, 0, cur[0]);
    }
  }
  return permute(inputArr);
}

var arr = ["a", "b", "c"];

permutator(arr);
May Dotimas
@emarino0411
Aug 18 2015 09:14
anyone????
help needed
CamperBot
@camperbot
Aug 18 2015 09:14
no wiki entry for: needed
:pencil: click here to create one now!after creating your page type update to reload it here
TuiLaHiep
@TuiLaHiep
Aug 18 2015 09:15
sr but i cant help :smile:
May Dotimas
@emarino0411
Aug 18 2015 09:15
hi @TuiLaHiep
TuiLaHiep
@TuiLaHiep
Aug 18 2015 09:16
hi @emarino0411 ^^
May Dotimas
@emarino0411
Aug 18 2015 09:16
No User Tests were Run. Any idea about this?
Serse
@Sersee
Aug 18 2015 09:18
guys, I need some help with jQuery "Target the Parent of an element"
after I ad this "$("#left-well").parent().css("background-color", "red");"
it still doesn't work
I think it is bugged
can you help me please?
nvm, it works now, lel
sorry
Brian Daub
@briandaub
Aug 18 2015 09:23
Hi. I am looking for help with bonfire Where art thou. I am stuck on assigning the correct value to the arr array. Anyone able to help?
Here is my code
function where(collection, source) {
  var arr = [];
  // What's in a name?
  for(var i = 0; i < collection.length; i++){
    if(collection[i].hasOwnProperty(Object.keys(source))){
      if(Object.keys(collection[i]) === source){
        arr[i] = collection[i];
      }
    }
  }
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });
Mohamed A. Farouk
@captainmoha
Aug 18 2015 09:29
@codeJunkie01 I think you're not checking for the value here.
Brian Daub
@briandaub
Aug 18 2015 09:31
can you elborate
elaborate*
Mohamed A. Farouk
@captainmoha
Aug 18 2015 09:33
in your second if statement you are comparing a value from an object with an object. You should compare a value with a value.
so you need the value inside source object.
Brian Daub
@briandaub
Aug 18 2015 09:33
Ah I see
Thank you for pointing that out @captainmoha
CamperBot
@camperbot
Aug 18 2015 09:33
codejunkie01 sends brownie points to @captainmoha :sparkles: :thumbsup: :sparkles:
:star: 209 | @captainmoha | http://www.freecodecamp.com/captainmoha
Mohamed A. Farouk
@captainmoha
Aug 18 2015 09:35
@codeJunkie01 Anytime :smile:
@codeJunkie01 One more thing you need to loop through the properties inside each object in the array.
Kelvin O
@kerukelw
Aug 18 2015 09:39
hi im sorry for asking the same question again, does anyone have a solution for accessing the freecodecamp website? :(
Mohamed A. Farouk
@captainmoha
Aug 18 2015 09:40
@kerukelw E-mail login is the only one that's not working now.
Kelvin O
@kerukelw
Aug 18 2015 09:40
@captainmoha I can't even access the page altogether
Mohamed A. Farouk
@captainmoha
Aug 18 2015 09:40
that's weird
Kelvin O
@kerukelw
Aug 18 2015 09:41

Server Error

The following error occurred:
[code=HTTP_MIME_TOO_LONG] The server response MIME header is too long. No action is required.

Please contact the administrator.

its been like that for 3-4 days already
Mohamed A. Farouk
@captainmoha
Aug 18 2015 09:42
@kerukelw Did you try cleaning your browser's cache ?
Antonio Carretero
@aclbros
Aug 18 2015 09:43
Hi, warning and error icons displayed left to the line numbers in code editor are not showing, only the error message when I hover the mouse over it.
Kelvin O
@kerukelw
Aug 18 2015 09:44
@captainmoha yes i did
ok it works on S**ternet explorer
only chrome doesnt work, even on incognito tabs
Mohamed A. Farouk
@captainmoha
Aug 18 2015 09:46
@kerukelw oh god lol :smile:
@kerukelw Get out of there it's a trap!
@kerukelw I would remove chrome and do a clean install.
Kelvin O
@kerukelw
Aug 18 2015 09:48
welll chrome works on my other sites
only freecodecamp :(
Prashanth
@dgprashanth
Aug 18 2015 09:50

function repeat(str, num) {
// repeat after me

if(num>0) {
for(i=0;i<=num;i++) {
console.log(str + " ");
}
}
else {
return(0);
}
}

repeat('abc', 3);

can anybody tell me why I keep getting "undefined" as the error
Mohamed A. Farouk
@captainmoha
Aug 18 2015 09:50
@kerukelw They made some really big updates in the last few days. Your browser might be keeping stuff that's preventing the site from working correctly. So just try it :smile:
Serse
@Sersee
Aug 18 2015 09:51
@dgprashanth If I'm not wrong, you should put return(str + "") instead of console.log
Kelvin O
@kerukelw
Aug 18 2015 09:52
its a 500 server error on my site
side
Mohamed A. Farouk
@captainmoha
Aug 18 2015 09:53
@dgprashanth You should be keeping track of each addition in a variable and then return it.
@kerukelw Even after a clean install ?
Prashanth
@dgprashanth
Aug 18 2015 09:54
@captainmoha so it has to be a return statement?
Soumya Rauth
@soumyaRauth
Aug 18 2015 09:54
Why can't I see the solutions I have done.
Prashanth
@dgprashanth
Aug 18 2015 09:54
Doesn't the program end if a return statement is reached?
Mohamed A. Farouk
@captainmoha
Aug 18 2015 09:54
@dgprashanth Yes. Well you need it to end with the resulting repeated string.
@dgprashanth That's why you return after you have finished repeating ie (after the for loop)
Prashanth
@dgprashanth
Aug 18 2015 09:55
mhmm.. Okay then, will try that.
So I guess I will just keep storing it inside another variable and return it after the loop is done
@captainmoha :+1:
Brian Daub
@briandaub
Aug 18 2015 10:01
This message was deleted
This message was deleted
Timothy Kim
@tea-kay
Aug 18 2015 10:27
Hey guess idk if I missed something but I logged on yesterday and my "map" is telling me that I haven't completed many of the challenges that I have before. Anyone else experiencing this issue?
TuiLaHiep
@TuiLaHiep
Aug 18 2015 10:32
freecodecamp changed their course
Timothy Kim
@tea-kay
Aug 18 2015 10:34
@TuiLaHiep gotcha! thanks
CamperBot
@camperbot
Aug 18 2015 10:34
gzatrader sends brownie points to @tuilahiep :sparkles: :thumbsup: :sparkles:
:star: 79 | @tuilahiep | http://www.freecodecamp.com/tuilahiep
TuiLaHiep
@TuiLaHiep
Aug 18 2015 10:34
no prob :smile:
Andi
@p3rand0r
Aug 18 2015 10:41
Im sorry if i ask a question maybe already asked, but why every time i try to enter an exercise i always get Oops! Something went wrong. Please try again later ??
Jearson Gomez
@jayGorio
Aug 18 2015 10:43
can anyone check my code. The output returns undefined.

function largestOfFour(arr) {
// You can do this!
var largest = Math.max.apply(Math, arr.map(function(i){
return i0;
}));
}

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

Jearson Gomez
@jayGorio
Aug 18 2015 10:50
hello
Brian Daub
@briandaub
Aug 18 2015 10:50
Just wanted to see if someone could offer some help on Where Art Thou? Here is my code.
function where(collection, source) {
  var arr = [];
  // What's in a name?
  for(var i = 0; i < collection.length; i++){
    if(collection[i].hasOwnProperty(Object.keys(source))){
      for(var prop in collection[i]){

      }
    }
  }
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });
Is this going in the right direction or am I way off?
Shane
@sigshane
Aug 18 2015 10:53
good morning all. Question: did the layout of fcc change while I was asleep? I no longer see a "Guide" nor "Learn" button at the top, and some of my progress seems to have been lost.
@gzatrader same here!
Brian Daub
@briandaub
Aug 18 2015 10:55
They switched to a different framework I believe it said in the August 2015 changes wiki
wiki 2015
CamperBot
@camperbot
Aug 18 2015 10:55

:point_right: august 2015 improvements [wiki]

Quick note: we are currently fixing email login

If you have used an alternate authentication source like Twitter or GitHub you may be able to log in with it. Otherwise, we are working on the problem.

If you have any issues with Free Code Camp, please let us know: https://github.com/freecodecamp/freecodecamp/issues/new

:pencil: read more about august 2015 improvements on the FCC Wiki

Mohamed A. Farouk
@captainmoha
Aug 18 2015 10:55
@codeJunkie01 You're in the right direction just do your check with an if statement and if it passes the check push it to the array.
Shane
@sigshane
Aug 18 2015 10:58
@camperbot yep, that pretty much sums up my experience. Thanks!
CamperBot
@camperbot
Aug 18 2015 10:58
sigshane sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 14 | @camperbot | http://www.freecodecamp.com/camperbot
Jearson Gomez
@jayGorio
Aug 18 2015 10:58
can someone please check my code above im having hard time with that exercise.thanks
CamperBot
@camperbot
Aug 18 2015 10:58
if you want to thank someone, put an @ before their name!
Shane
@sigshane
Aug 18 2015 10:59
@camperbot Will do!
Mohamed A. Farouk
@captainmoha
Aug 18 2015 11:00
@jayGorio Can you paste your code with formatting ?
explain format
CamperBot
@camperbot
Aug 18 2015 11:00

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Jearson Gomez
@jayGorio
Aug 18 2015 11:02
okay
Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays.

function largestOfFour(arr) {
// You can do this!
var largest = Math.max.apply(Math, arr.map(function(i){
console.log(i0);
}));
}

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

Mohamed A. Farouk
@captainmoha
Aug 18 2015 11:03
function largestOfFour(arr) {
  // You can do this!
  var largest = Math.max.apply(Math, arr.map(function(i){
    console.log(i[0]);
  }));
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Jearson Gomez
@jayGorio
Aug 18 2015 11:04
thanks @captainmoha for that..
CamperBot
@camperbot
Aug 18 2015 11:04
jaygorio sends brownie points to @captainmoha :sparkles: :thumbsup: :sparkles:
:star: 213 | @captainmoha | http://www.freecodecamp.com/captainmoha
Jearson Gomez
@jayGorio
Aug 18 2015 11:04
how can I also post that way?
Mohamed A. Farouk
@captainmoha
Aug 18 2015 11:05
explain format
CamperBot
@camperbot
Aug 18 2015 11:05

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Mohamed A. Farouk
@captainmoha
Aug 18 2015 11:05
@jayGorio read that
Jearson Gomez
@jayGorio
Aug 18 2015 11:08
Got it @captainmoha .thanks. The problem their is that I want to return all the largest values within that multidimensional array .
CamperBot
@camperbot
Aug 18 2015 11:08
jaygorio sends brownie points to @captainmoha :sparkles: :thumbsup: :sparkles:
:warning: jaygorio already gave captainmoha points
Jearson Gomez
@jayGorio
Aug 18 2015 11:10
however it turns out that it prints the first value of that multidimensional arrays. the output is 4,13,32,1000
Mohamed A. Farouk
@captainmoha
Aug 18 2015 11:12
@jayGorio Why don't you do it in a simpler way ? using for loops to understand how it's moving first then try to do it with map.
Jearson Gomez
@jayGorio
Aug 18 2015 11:14
@captainmoha okay ill try it
Mohamed A. Farouk
@captainmoha
Aug 18 2015 11:15
@jayGorio Your input is an array of arrays so you need a for loop to loop over the arrays and another for loop for the variables inside each array. And do some comparisons remember the biggest value you encounter and finally return that big value.
Jearson Gomez
@jayGorio
Aug 18 2015 11:17
so ill be using two for loops?
Mohamed A. Farouk
@captainmoha
Aug 18 2015 11:22
@jayGorio Yes
Chase Thomas
@ChaseMThomas
Aug 18 2015 11:22
was about to ask for help but figured it out myself... yay! But seriously, it pays to read carefully and understand what is on the page.
Robert Richey
@0x0936
Aug 18 2015 11:42

What is wrong with my code?

Waypoint: Give your JavaScript slot-machine some stylish images

This code passes 3/4 tests - first test is failing: Use the provided code three times. One for each slot

// 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.
ronaldnicol89
@ronaldnicol89
Aug 18 2015 11:52
hey guys anyone finish the slot machine
i’m stuck on that waypoint i dont seem to have a way to submit my code
figured it out
Tristanto
@rustyworks
Aug 18 2015 12:36
My progress is lost, I use email login before, not github. HALP!
Mohamed A. Farouk
@captainmoha
Aug 18 2015 12:43
@rustyworks Email login is not working right now. You can either wait for it to be fixed or signin with GitHub or google if you used the same e-mail when you signed up for freecodecamp.
Tristanto
@rustyworks
Aug 18 2015 12:44
@captainmoha I use the same email, but it seems my progress lost
Mohamed A. Farouk
@captainmoha
Aug 18 2015 12:45
@rustyworks There have been a lot of updates. So for example all jquery and javascript waypoints are new. and a lot of the HTML ones too.
@rustyworks If your profile is blank try signing in with something else other than github.
Tristanto
@rustyworks
Aug 18 2015 12:48
@captainmoha Oh, okay. Is my progress lost if I link my account to github ? In profile ?
eeseesee
@eeseesee
Aug 18 2015 12:51
@rustyworks I had the same problem yesterday. Try logging in with one of the other methods that uses the email you use to log in (i.e. google). Your progress should be current that way.
Tristanto
@rustyworks
Aug 18 2015 12:52
@eseesee If I link with github account, which progress are persist ? The github or the email ?
eeseesee
@eeseesee
Aug 18 2015 12:56
@rustyworks You logged in with github and you progress was lost right? All I am saying is try logging out of the account and then log in with another method that uses the same email you used for FCC. The progress you made before the overhaul should be there. At least, that's what worked for me.
Tristanto
@rustyworks
Aug 18 2015 12:58
thanks @eseesee
CamperBot
@camperbot
Aug 18 2015 12:58
rustyworks sends brownie points to @eseesee :sparkles: :thumbsup: :sparkles:
:star: 239 | @eseesee | http://www.freecodecamp.com/eseesee
Tristanto
@rustyworks
Aug 18 2015 12:59
thanks @captainmoha
CamperBot
@camperbot
Aug 18 2015 12:59
rustyworks sends brownie points to @captainmoha :sparkles: :thumbsup: :sparkles:
:star: 215 | @captainmoha | http://www.freecodecamp.com/captainmoha
Marcus Eisele
@eiselems
Aug 18 2015 13:08
Does anybody know a free and adequate Quote API? for the zipline?
Dan Stockham
@DanStockham
Aug 18 2015 13:19
Does anyone have any idea why this else if statement is breaking the add() function?
function add(arg1, arg2) {
    if(typeof arg1 ==='number' && typeof arg2 === 'number') {
        return arg1 + arg2;

    } else if(typeof arg1 !== 'number') {

        return undefined;

    } else if(typeof arg2 !== 'number') {

        return undefined;

    } else {

      return function(val) {
            return val + arg1;
        };
    }
}

add(2)(3);
Greg Noble
@gregnoble
Aug 18 2015 13:24
i think
its because you are returning undefined
so when you call add(2) it returns undefined, then you are calling undefined with (3)
if you call it like this add(2,3) it will work fine
@DanStockham
Dan Stockham
@DanStockham
Aug 18 2015 13:25
However I have to call add(2) then call it as a variable for () to run the returned anonymous function.
Greg Noble
@gregnoble
Aug 18 2015 13:26
then you need to code it in a way that having an undefined second argument is ok
or you need to restructure it
if arg1 is a number, then return your anonymous function
Dan Stockham
@DanStockham
Aug 18 2015 13:30
I'm going to to have to come back to this, need to leave for work soon.
Greg Noble
@gregnoble
Aug 18 2015 13:34
This message was deleted
This message was deleted
This message was deleted
This message was deleted
CamperBot
@camperbot
Aug 18 2015 13:35
:bulb: to format code use backticks! ``` more info
Greg Noble
@gregnoble
Aug 18 2015 13:35
function add(arg1, arg2) {
    if(typeof arg1 ==='number' && typeof arg2 === 'number') {
        return arg1 + arg2;
    }

    if(typeof arg1 == 'number') {
        return function(val) {
            if(typeof arg2 !== 'number') {
                return val + arg1;
            }            
        }
    }
}
well thank you camperbot
CamperBot
@camperbot
Aug 18 2015 13:35
if you want to thank someone, put an @ before their name!
Greg Noble
@gregnoble
Aug 18 2015 13:36
@DanStockham it might not do exactly what you want but just as an example. it returns the function if arg1 is a number and then the second (3) runs that function that is returned
Ozy Design & Software
@OzySky
Aug 18 2015 13:40
This message was deleted
This message was deleted
Vitalii Danylov
@vitaliidanylov
Aug 18 2015 14:28
Hi everyone! I've been trying for hours solve Bonfire: No repeats please task analitically! I'll be really preciate if somebody give usefull peace of adivce, here is my code, but it's not finished yet:
function permAlone(str) {
  var unique = str.split('').filter(function(item,pos,arr){
    return arr.indexOf(item) === pos;
  });

  var ul = unique.length,
      strlg = str.length,
      dif = strlg -ul;

  var factorial = function factorialis (m) {
    var n = parseInt(m);
    return (n < 0 || m != n) ? NaN : (n === 0 ? 1 : n * factorialis(n -     1));
};
  var num;
  if(ul === 1){
    num = 0;
  } else {
    num = factorial(ul);
  }
  return num;
}

permAlone('aab');
I'have to implement some formula with using (ul, strlg, diff) variables. Thank you!
CamperBot
@camperbot
Aug 18 2015 14:29
if you want to thank someone, put an @ before their name!
May Pagatpatan
@myflryuna
Aug 18 2015 14:34
Hi fellow campers!
Can you please find what is wrong with this?
blob
Coira Ellison
@Coira
Aug 18 2015 14:36
hi @myflryuna copy and paste your code in here between three backticks `
explain format
CamperBot
@camperbot
Aug 18 2015 14:36

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Coira Ellison
@Coira
Aug 18 2015 14:37
@vitaliidanylov I tried for three days, couldn't work out a formula! You'll need some knowledge of combinatorics to do it that way, I think
Hazri
@Pixelshot
Aug 18 2015 14:39
function myFunction(){
  var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
  // Create and if else statement here to return "heads" if flip is 0. Otherwise return "tails".

  // Only change code below this line.


}

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return(myFunction());})();
can anyone help with this section, i'm at complete lost with it right now
Vitalii Danylov
@vitaliidanylov
Aug 18 2015 14:40
@Coira yeap, I think so, but here we should modify formula, but I haven't found uot it yet...
May Pagatpatan
@myflryuna
Aug 18 2015 14:44
function factorialize(num) {
if (num === 0){
   return 1;
  }
  if (num < 0){
    return num;
  }

  var x = 1;

  for (var i=num; i>=1; i--){
    x = (x * i);
    return x;
  }
}

factorialize(5);
JackAcid
@jack-acid
Aug 18 2015 14:47
Hello. Is there an archive of asked and answered questions for a particular waypoint?
May Pagatpatan
@myflryuna
Aug 18 2015 14:47
Hi fellow campers, can anyone check my syntax? Thanks.
nice question @jack-acid
Lele QB
@lelecarabina
Aug 18 2015 14:48

Hey, guys. Doing it all over again. Just because. On "Waypoint: Target the same element with multiple jQuery Selectors" I wrote the code like this, but still can't get passed and the Help and Bug buttons are not working:

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

This message was deleted
JackAcid
@jack-acid
Aug 18 2015 14:50
@myflryuna You may want to move the "return x" line outside of the for loop.
Greg Noble
@gregnoble
Aug 18 2015 14:50
@myflryuna your for loop has a return in it
so its always going to return before looping
what @jack-acid said
lol
    for (var i=num; i>=1; i--){
        x = (x * i);        
    }

    return x;
May Pagatpatan
@myflryuna
Aug 18 2015 14:53
ok, got it i have to make a return statement outside for loop.
thanks @gregnoble
CamperBot
@camperbot
Aug 18 2015 14:53
myflryuna sends brownie points to @gregnoble :sparkles: :thumbsup: :sparkles:
:star: 225 | @gregnoble | http://www.freecodecamp.com/gregnoble
JackAcid
@jack-acid
Aug 18 2015 14:53
@lelecarabina check that you have .addClass and not add.Class. Also, try deleting one set of $(document).ready(function() { }): lines.
Greg Noble
@gregnoble
Aug 18 2015 14:53
@lelecarabina any reason you have the $(document).ready twice?
Lele QB
@lelecarabina
Aug 18 2015 14:54
Thanks @jack-acid and @gregnoble fixed :smile:
CamperBot
@camperbot
Aug 18 2015 14:54
lelecarabina sends brownie points to @jack-acid and @gregnoble :sparkles: :thumbsup: :sparkles:
:star: 226 | @gregnoble | http://www.freecodecamp.com/gregnoble
:star: 102 | @jack-acid | http://www.freecodecamp.com/jack-acid
Lele QB
@lelecarabina
Aug 18 2015 14:54
This message was deleted
Greg Noble
@gregnoble
Aug 18 2015 14:55
@lelecarabina yw
JackAcid
@jack-acid
Aug 18 2015 15:00
In Target a Specific Child of an Element Using jQuery
Target Even Numbered Elements Using jQuery
...the answer uses the .target class, but I do not see any elements that are declared to be class="target". is this a .fluid-container thing?
michaelmenace
@michaelmenace
Aug 18 2015 15:01
Bonfire find the longest word in a string
CamperBot
@camperbot
Aug 18 2015 15:01

:fire:Bonfire: Find the Longest Word in a String :link:

function findLongestWord(str) {
  return str.length;
}

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

Return the length of the longest word in the provided sentence.

more info:  bf details | bf links | hint

michaelmenace
@michaelmenace
Aug 18 2015 15:02

var currentLongestWord = 0;
function findLongestWord(str) {
var arrayOfString = str.split(/\s/);
for (var i = 0; i < arrayOfString.length; i++) {
if (arrayOfString[i].length > currentLongestWord) {
currentLongestWord = arrayOfString[i].length;
word = arrayOfString[i];
}
}
return currentLongestWord;
}

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

Ozy Design & Software
@OzySky
Aug 18 2015 15:02
@michaelmenace you need help?
help code format
CamperBot
@camperbot
Aug 18 2015 15:02

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Ozy Design & Software
@OzySky
Aug 18 2015 15:02
btw
Davis
@ajdavis56
Aug 18 2015 15:03
how does one return a function that is waiting for input?
do we prompt the user for input?
Ozy Design & Software
@OzySky
Aug 18 2015 15:04
@ajdavis56 nope
simply return a function that expects an input
michaelmenace
@michaelmenace
Aug 18 2015 15:04
@ozydesign yea, my code passes all tests except one
Ozy Design & Software
@OzySky
Aug 18 2015 15:04
@ajdavis56 I struggled with that concept as well
@michaelmenace which one?
Davis
@ajdavis56
Aug 18 2015 15:05
@ozydesign so just a regular function?
like so?
return new function(num) {return ..;}
Ozy Design & Software
@OzySky
Aug 18 2015 15:06
@ajdavis56 Yeah. Why new though?
Davis
@ajdavis56
Aug 18 2015 15:07
so just function(num) ...
Ozy Design & Software
@OzySky
Aug 18 2015 15:08
think so..
Davis
@ajdavis56
Aug 18 2015 15:08
keeps outputting illegal return statement
when I input
var sum2And = add(2);
return sum2And(3);
michaelmenace
@michaelmenace
Aug 18 2015 15:08
Bonfire: Find the Longest Word in a String
Any idea why this doesn't find the length of the longest word?
var currentLongestWord = 0;
function findLongestWord(str) {
  var arrayOfString = str.split(/\s/);
  for (var i = 0; i < arrayOfString.length; i++) {
    if (arrayOfString[i].length > currentLongestWord) {
      currentLongestWord = arrayOfString[i].length;
      word = arrayOfString[i];
    }
  }
  return currentLongestWord;
}

findLongestWord('The quick brown fox jumped over the lazy dog');
CamperBot
@camperbot
Aug 18 2015 15:08
Sorry, can't find a bonfire called find the longest word in a stringhttpwwwfreecodecampcomchallengesbonfire-find-the-longest-word-in-a-stringany idea why this doesnt find the length of the longest wordvar currentlongestword 0function findlongestwordstr var arrayofstring strsplits for var i 0 i arrayofstringlength i if arrayofstringilength currentlongestword currentlongestword arrayofstringilength word arrayofstringi return currentlongestwordfindlongestwordthe quick brown fox jumped over the lazy dog. [ Check the map? ]
Ozy Design & Software
@OzySky
Aug 18 2015 15:09
@ajdavis56 can you paste your whole code?
Davis
@ajdavis56
Aug 18 2015 15:09
okay it works now!
thanks!
CamperBot
@camperbot
Aug 18 2015 15:09
if you want to thank someone, put an @ before their name!
Davis
@ajdavis56
Aug 18 2015 15:10
@ozydesign thanks!
CamperBot
@camperbot
Aug 18 2015 15:10
ajdavis56 sends brownie points to @ozydesign :sparkles: :thumbsup: :sparkles:
:star: 166 | @ozydesign | http://www.freecodecamp.com/ozydesign
Ozy Design & Software
@OzySky
Aug 18 2015 15:10
@michaelmenace can you paste which test it doesn't pass(since it seems to work on repl.it)
@ajdavis56 no problems :smile:
michaelmenace
@michaelmenace
Aug 18 2015 15:12
@ozydesign expect(findLongestWord('May the force be with you')).to.equal(5);expected 6 to equal 5
Davis
@ajdavis56
Aug 18 2015 15:14
expect(add(2, '3')).to.be.undefined;expected '23' to be undefined
Ozy Design & Software
@OzySky
Aug 18 2015 15:15
@ajdavis56 three is not a number but a string...
@michaelmenace try putting the first line inside the function
Davis
@ajdavis56
Aug 18 2015 15:16
yes. but it fails the isNaN() test
@ozydesign yes. but it fails the isNaN() test
Ozy Design & Software
@OzySky
Aug 18 2015 15:16
run through typeof then
@ajdavis56
michaelmenace
@michaelmenace
Aug 18 2015 15:19
@ozydesign with the first line inside the function, it shows the error currentLongestWord used out of scope (I put it in the wrong line)
@ozydesign thanks
CamperBot
@camperbot
Aug 18 2015 15:20
michaelmenace sends brownie points to @ozydesign :sparkles: :thumbsup: :sparkles:
Ozy Design & Software
@OzySky
Aug 18 2015 15:20
This message was deleted
CamperBot
@camperbot
Aug 18 2015 15:20
:star: 167 | @ozydesign | http://www.freecodecamp.com/ozydesign
Ozy Design & Software
@OzySky
Aug 18 2015 15:20
@michaelmenace no probs
Hazri
@Pixelshot
Aug 18 2015 15:41
function myFunction(){
  var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
  // Create and if else statement here to return "heads" if flip is 0. Otherwise return "tails".

  // Only change code below this line.


}

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return(myFunction());})();
can anyone help me with this? still don't seem to get it
its in Waypoint: Use Conditional Logic with IfElse Statements in Javascript section
Coira Ellison
@Coira
Aug 18 2015 15:46
hi @Pixelshot do you understand what the Math.random line does?
Hazri
@Pixelshot
Aug 18 2015 15:47
to generate random numbers ?
Coira Ellison
@Coira
Aug 18 2015 15:48
yep, and in this case it generates either a 0 or a 1 randomly
jameswlytle
@jameswlytle
Aug 18 2015 15:48
bf Seek and Destroy am I missing something? The function as stated doesn't have enough arguments being allowed to complete what is being requested, right?
CamperBot
@camperbot
Aug 18 2015 15:48
Sorry, can't find a bonfire called seek and destroy am i missing something the function as stated doesnt have enough arguments being allowed to complete what is being requested right. [ Check the map? ]
Coira Ellison
@Coira
Aug 18 2015 15:49
you can check this by adding the line 'console.log(flip)', and looking in the console (press f12 in chrome or firefox)
jameswlytle
@jameswlytle
Aug 18 2015 15:49
bf see and destroy
CamperBot
@camperbot
Aug 18 2015 15:49
Sorry, can't find a bonfire called see and destroy. [ Check the map? ]
jameswlytle
@jameswlytle
Aug 18 2015 15:49
bf Seek and Destroy
CamperBot
@camperbot
Aug 18 2015 15:49

:fire:Bonfire: Seek and Destroy :link:

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

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

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

more info:  bf details | bf links | hint

Coira Ellison
@Coira
Aug 18 2015 15:49
@Pixelshot do you understand if else statements?
jameswlytle
@jameswlytle
Aug 18 2015 15:50
Am I missing something? The function destroyer isn't defined correctly, is it? It appears to me that the function call and the function declaration are 2 elements off.
Hazri
@Pixelshot
Aug 18 2015 15:50
i thought i did but i'm very much confused now @Coira
Coira Ellison
@Coira
Aug 18 2015 15:50
@Pixelshot have a go at writing it and post the code here and i'll have a look
Hazri
@Pixelshot
Aug 18 2015 15:51
if (flip) {
return(true);
}
else {
return(false);
}
Hazri
@Pixelshot
Aug 18 2015 15:52
flip == 0 sorry forgot to put that in
jameswlytle
@jameswlytle
Aug 18 2015 15:53
@Coira makes sense now. thanks!
CamperBot
@camperbot
Aug 18 2015 15:53
jameswlytle sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 160 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Aug 18 2015 15:54
@jameswlytle np :)
@Pixelshot yep that's right, but in this case, it's asking for you to return either "heads" or "tails"
@Pixelshot that is, you need to return a string
Dániel Erdős
@WebDevDani
Aug 18 2015 15:57
Hi guys! Having problem with a challenge, and couldn't find answer anywhere. How can I post the code so ithe chat show it nicely formatted?
Hazri
@Pixelshot
Aug 18 2015 15:58
@Coira how do i return the string?
Coira Ellison
@Coira
Aug 18 2015 16:04
@Pixelshot same way you return true, return("heads")
Dániel Erdős
@WebDevDani
Aug 18 2015 16:05
function mutation(arr) {
  var testString = arr[0].toLowerCase();
  var matchString = arr[1].toLowerCase();

  var testArray = new Array();
  testArray = testString.split('');

  var matchArray = new Array();
  matchArray = matchString.split('');


 if(testArray.indexOf(matchArray) != -1) {
    return true;
  } else {
    return false;
 };

}

mutation(['Hello', 'hello']);
What's the problem with this? It return false...but when I return matchArray and testArray it returns as the same array. I guess I messed up something with the indexOf, or not sure. If I didn't use new Arrays, and don't split the strings, the 'Hello' and 'hello' returns true, but then mutation(['Mary', 'Army']); didn't return true, and I need it to be true also :-/
Coira Ellison
@Coira
Aug 18 2015 16:05
@WebDevDani three backticks `
CamperBot
@camperbot
Aug 18 2015 16:05
:bulb: to format code use backticks! ``` more info
Coira Ellison
@Coira
Aug 18 2015 16:05
explain format
CamperBot
@camperbot
Aug 18 2015 16:05

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Dániel Erdős
@WebDevDani
Aug 18 2015 16:06
Thanks @Coira :)
CamperBot
@camperbot
Aug 18 2015 16:06
webdevdani sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 161 | @coira | http://www.freecodecamp.com/coira
Hazri
@Pixelshot
Aug 18 2015 16:06
thanks @Coira really appreciate it!
CamperBot
@camperbot
Aug 18 2015 16:06
pixelshot sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 162 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Aug 18 2015 16:07
@Pixelshot np :+1:
@WebDevDani you need to loop through your arrays, indexOf works on chars
@WebDevDani e.g array.indexOf("a") checks for the char a in array
Dániel Erdős
@WebDevDani
Aug 18 2015 16:13
thanks @Coira sit on that for almost 2 hrs and couldn't figure it out :)
CamperBot
@camperbot
Aug 18 2015 16:13
webdevdani sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:warning: webdevdani already gave coira points
Prashanth
@dgprashanth
Aug 18 2015 16:15
Guys, I been on the course the entire day now(12-13 hours today), and I basically kept eventually cracking the basic algorithmic scripting part.. After I reached Mutations, it seemed to be getting more and more intense. Almost feels like I just can't solve them anymore.. as in, I am starting to doubt my capability to solve it.. Anyone have suggestions? I really want to learn. I am done quitting!
Coira Ellison
@Coira
Aug 18 2015 16:16
@WebDevDani np, at least you won't forget what indexOf does now!
Prashanth
@dgprashanth
Aug 18 2015 16:17
The answers..well simple "for" loops don't seem to cut it anymore and hence, with each problem, I don't even know where to look for answers.. Any suggestions on perhaps what i can do to improve my situation? I really did enjoy the course until now!
Perhaps any advice from senior guys here, that can help me push onwards? :)
Anton Strömkvist
@ahstro
Aug 18 2015 16:18
I'm sure you'll figure stuff out, and if you can't do it on your own, pair program! Seriously, it's the best advice I can give you
Prashanth
@dgprashanth
Aug 18 2015 16:19
@ahstro Oh! That's just what I need! Thanks :clap:
CamperBot
@camperbot
Aug 18 2015 16:19
dgprashanth sends brownie points to @ahstro :sparkles: :thumbsup: :sparkles:
:star: 312 | @ahstro | http://www.freecodecamp.com/ahstro
dc
@dcsan
Aug 18 2015 16:19
there maybe some hints on the bonfires
Anton Strömkvist
@ahstro
Aug 18 2015 16:19
Not only will you learn to be a better programmer, you will learn to interact with other people and work as part of a team, which is great to know if you'll program in the future
Coira Ellison
@Coira
Aug 18 2015 16:19
have you been coding for 13 hours @dgprashanth ? take a break! sleep's often the best way of solving problems
i'd go crazy solving algorithms for that long straight :smile:
Anton Strömkvist
@ahstro
Aug 18 2015 16:21
Does anyone know how flex-grow works? I'm putting flex-grow: 1 on all flex items, and they are divided proportionally until I change the contents of one of them, then it gets more width.
Anton Strömkvist
@ahstro
Aug 18 2015 16:28
Whoo, figured it out! Needed flex-basis: 0
Coira Ellison
@Coira
Aug 18 2015 16:29
:thumbsup:
Christine
@orangelines
Aug 18 2015 16:36
This message was deleted
This message was deleted
Dániel Erdős
@WebDevDani
Aug 18 2015 16:38

I used this now:

  for (i = 0; i < matchArray.length; i++){
 if (testString.indexOf(matchString[i]) != -1) {
    return true;
  } else {
    return false;
 };
  }

And almost working perfect. It works with comparing:
(mutation(['Mary', 'Army']))
or
(mutation(['Mary', 'Aarmy']))
or
(mutation(['zyxwvutsrqponmlkjihgfedcba', 'qrstu']))

but fails when comparing
(mutation(['hello', 'hey']))
This shall came back as false, but came back true.
When I use testString[i].indexOf(matchString), it works well for the hello-hey comparison, but fails every other.
If i use testString[i].indexOf(matchString[i]) it fails for most of those (only works for (mutation(['hello', 'Hello'])) and (mutation(['floor', 'for']))...)

No idea where should I put the i variable for the array element number

Coira Ellison
@Coira
Aug 18 2015 16:42
@WebDevDani you're very close! right now, your for loop only does one comparison, then it returns
move one of the returns out of the loop
Aza Noriega
@MegaGM
Aug 18 2015 16:47
Could somebody help me a little please with M101JS - Week 2 ? ^_^
Anton Strömkvist
@ahstro
Aug 18 2015 16:48
@MegaGM I have no idea what that is, so maybe? :) Mind explaining?
@ahstro If you didn't registered on this course, you can't help unfortunately, I'm looking for someone who's completed it already
@ahstro Thanks anyway :3
CamperBot
@camperbot
Aug 18 2015 16:50
megagm sends brownie points to @ahstro :sparkles: :thumbsup: :sparkles:
:star: 313 | @ahstro | http://www.freecodecamp.com/ahstro
jsmmns
@jsmmns
Aug 18 2015 16:50
Hey! Im having a little trouble with the title case bonfire. Could anyone be so kind as to explain why my code is outputting a "T" in the middle of little instead of just changing the first letters of the sentence?
function titleCase(str) {
  for(i=0;i<str.length;i++){
    if(str.charAt(i) === " "){
        var temp = str.charAt(i+1).toUpperCase();
        str = str.replace(str.charAt(i+1), temp);
    }
    else{
        var temp = str.charAt(i+1).toLowerCase();
        str = str.replace(str.charAt(i+1), temp);
    }
  }  
  return str;
    }

titleCase("I\'m A LiTtle tea Pot");
Anton Strömkvist
@ahstro
Aug 18 2015 16:50
@MegaGM Oh, yeah, I regged for that one way back but realized that databases have to wait, sorry. Good luck :)
Christine
@orangelines
Aug 18 2015 16:51

Could someone please help me with this if/else statement?

Instructions: Write an if / else statement inside the isEven function. It should return true; if the number it receives is evenly divisible by 2. Otherwise (else), it should return false;.

Make sure to return - don't use console.log()!

My solution that's not working:

var x = Math.floor(Math.random() * 2);
var isEven = function(number) {
  if (x % 2 === 0) {
      return true;
  } else {
      return false;
  }
};

I can't figure out what I'm doing wrong ...and I also I don't know what to do about the function with 'number' in it :(

Anton Strömkvist
@ahstro
Aug 18 2015 16:54
@playdohscave That's because when you're using str.charAt(i+1) in str.replace(), it's not looking for the i-index, it's looking at the first occurence of the character found when using str.charAt(i+1). Since the character after the relevant space is t, str.replace() looks for the first t, replaces it with T and moves on.
Felipe Rodrigues
@feliperdius
Aug 18 2015 16:54
@orangelines you need to pass to isEven(x) where x is the number
Christine
@orangelines
Aug 18 2015 16:56
@feliperdius ah thanks! do you have some time to explain why that is? I don't understand what 'function(number)' means
CamperBot
@camperbot
Aug 18 2015 16:56
orangelines sends brownie points to @feliperdius :sparkles: :thumbsup: :sparkles:
:star: 34 | @feliperdius | http://www.freecodecamp.com/feliperdius
jsmmns
@jsmmns
Aug 18 2015 16:56
@ahstro Ah ok thanks alot, that makes sense!
This message was deleted
Ornel Garcia
@sinfulone
Aug 18 2015 16:57
stuck on the challenge 'Create a class called thick-green-border that puts a 10-pixel-wide green border with a style of solid '..can someone tell me what am I doing wrong --- p {border-width: thick; border-color: green; border-style: solid}
jsmmns
@jsmmns
Aug 18 2015 16:57
@ahstro Thanks!
CamperBot
@camperbot
Aug 18 2015 16:57
playdohscave sends brownie points to @ahstro :sparkles: :thumbsup: :sparkles:
:star: 314 | @ahstro | http://www.freecodecamp.com/ahstro
Anton Strömkvist
@ahstro
Aug 18 2015 16:57
@playdohscave Haha no problem :) Good luck!
@sinfulone Wrap your code in ``` and I'll try :)
Felipe Rodrigues
@feliperdius
Aug 18 2015 16:58
@orangelines yes one moment
Ornel Garcia
@sinfulone
Aug 18 2015 16:58
@ahstro 'p {border-width: thick; border-color: green; border-style: solid}'
@ahstro any help will be appreciated..am more of a technician than a programmer..so this is all hieroglyphics to me..haha
Felipe Rodrigues
@feliperdius
Aug 18 2015 17:01
@orangelines When you do this: var x = function(number) that means: "var x" is receiving a function/method who needs a parameter "number", this number could be array/object/integer/float... whatever you wants. To call this method declared as var x, you only need to do this: x(number)
@orangelines number is a argument for the method who needs a parameter
Christine
@orangelines
Aug 18 2015 17:03
@feliperdius thank you! that clears it up :)
CamperBot
@camperbot
Aug 18 2015 17:03
orangelines sends brownie points to @feliperdius :sparkles: :thumbsup: :sparkles:
:warning: orangelines already gave feliperdius points
Anton Strömkvist
@ahstro
Aug 18 2015 17:04
@sinfulone Looks very close to me :) I'm not sure there's a border-width value of thick; since you want it to be 10 pixels long, you're probably looking for 10px instead :)
Ornel Garcia
@sinfulone
Aug 18 2015 17:04
@ahstro ok, will try it! nuff thanks! :-)
CamperBot
@camperbot
Aug 18 2015 17:04
sinfulone sends brownie points to @ahstro :sparkles: :thumbsup: :sparkles:
:star: 315 | @ahstro | http://www.freecodecamp.com/ahstro
Dániel Erdős
@WebDevDani
Aug 18 2015 17:16
Couldn't figure it out where should I put the return, or which...tried to put out of the if-else statement, out of the for loop brackets, it doesn't return false :-/
function mutation(arr) {
  var testString = arr[0].toLowerCase();
  var matchString = arr[1].toLowerCase();

  var testArray = new Array();
  testArray = testString.split('');

  var matchArray = new Array();
  matchArray = matchString.split('');

  var i;

  for (i=0; i < matchArray.length; i++){
 if (testString.indexOf(matchString[i]) != -1) {

    return true;

 } else {

   return false;

        }

     }

}

mutation(['Hello', 'hey']);
Edward Barton
@Incredibl3dible
Aug 18 2015 17:24
How do I enter my code into the visually appealing chat window so it shows my code exactly?
Such as @WebDevDani just did
Gus Suarez
@aerze
Aug 18 2015 17:26
@Incredibl3dible ```js
Edward Barton
@Incredibl3dible
Aug 18 2015 17:27
@aerze So I just type " ```js " and then my code following it?
Gus Suarez
@aerze
Aug 18 2015 17:28
```js (shift + enter)
var code = 'goes here';
```
Edward Barton
@Incredibl3dible
Aug 18 2015 17:30
$($(".slot")[0]).html('<img src = "' + images[slotOne-1] + '">');
    $($(".slot")[1]).html('<img src = "' + images[slotTwo-1] + '">');
    $($(".slot")[2]).html('<img src = "' + images[slotThree-1] + '">');
That is my code for the slot machine game and I am getting the red X stating "Use the provided code three times. One for each slot"
despite it seeming to work perfectly
Greg Noble
@gregnoble
Aug 18 2015 17:35
does it let you complete the exercise?
DTing
@dting
Aug 18 2015 17:39
@Incredibl3dible make sure you copy paste and dont put any extra spaces in. They use regex to check.
@Incredibl3dible change the $($(".slot")'s to $($('.slot')'s
Greg Noble
@gregnoble
Aug 18 2015 17:48
for building a random quote generator - are people just copying the existing quotes, writing their own, or are people using an API... ?
Dayne Wright
@daynewright
Aug 18 2015 17:49
@gregnoble I used an API
Greg Noble
@gregnoble
Aug 18 2015 17:50
I was considering using a random api online: http://www.icndb.com/api/
this ones a chuck norris quote/joke generator
Edward Barton
@Incredibl3dible
Aug 18 2015 17:50
@dting Thank you, the ' apostrophes did the trick!
CamperBot
@camperbot
Aug 18 2015 17:50
incredibl3dible sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 297 | @dting | http://www.freecodecamp.com/dting
Greg Noble
@gregnoble
Aug 18 2015 17:51
or should we use the one they list?
i guess i read that a little fast - didnt realize they provide one
DTing
@dting
Aug 18 2015 17:54
@gregnoble you can use whatever you want.
@gregnoble i believe the one they provide is just a suggestion
Greg Noble
@gregnoble
Aug 18 2015 17:55
@dting thanks
CamperBot
@camperbot
Aug 18 2015 17:55
gregnoble sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 298 | @dting | http://www.freecodecamp.com/dting
Dayne Wright
@daynewright
Aug 18 2015 17:56
I am sure this is something simple, but I am not sure how to correct it. On my personal page zipline I want the project section to pull the box around the images closer, but it expands out on a larger screen. This is from bootstrap: http://codepen.io/daynewr/full/bdyaBw/
Anyone have an idea of what I am doing wrong?
DTing
@dting
Aug 18 2015 18:03

@Daynewr you could add something like

  max-width: 350px;
  margin: 0 auto;

to your a css selector

Dayne Wright
@daynewright
Aug 18 2015 18:04
I thought it was a max-width thing..just wasn’t sure where to add it. Thanks
CamperBot
@camperbot
Aug 18 2015 18:04
if you want to thank someone, put an @ before their name!
Dayne Wright
@daynewright
Aug 18 2015 18:04
thanks @dting
CamperBot
@camperbot
Aug 18 2015 18:04
daynewr sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 300 | @dting | http://www.freecodecamp.com/dting
Roger Nattkemper
@RogerNattkemper
Aug 18 2015 18:06
Hello all

I am working on: Bonfire: Seek and Destroy. I am used to C, so I might be missing something fundamental here. For some reason, the comparator here never works, so everything is true. I've searched online, but I've seen people doing pretty much the same thing I am doing:function destroyer(arr)
{
var TempArray = arr;
function DestroyNum (value)
{
var Pass = true;
for (var argnum = 1; argnum < arguments.length; argnum++)
{
if (arguments[argnum] == value) Pass = false;
}
return Pass;
}

arr = TempArray.filter(DestroyNum);

return arr;
}

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

(I should say, the filter(DestroyNum) never returns false;
DTing
@dting
Aug 18 2015 18:12
@RogerNattkemper your DestroyNum function always only has 1 value in it's arguments object.
Cordoba84
@fcordoba84
Aug 18 2015 18:14
thanks @codecampgirl
CamperBot
@camperbot
Aug 18 2015 18:14
fcordoba84 sends brownie points to @codecampgirl :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for codecampgirl
Cordoba84
@fcordoba84
Aug 18 2015 18:14
im lost with this
Take the myArray array and shift() the first value off of it.
i have done this
Roger Nattkemper
@RogerNattkemper
Aug 18 2015 18:14
I'm not sure I follow, under the arguments object docs, you access the different ones through arguments[0], arguments[1] etc
DTing
@dting
Aug 18 2015 18:14
@RogerNattkemper your code is the same as this
function destroyer(arr) {
  var TempArray = arr;

  arr = TempArray.filter(DestroyNum);
  return arr;
}

function DestroyNum (value) {
  var Pass = true;
  for (var argnum = 1; argnum < arguments.length; argnum++) {
    if (arguments[argnum] == value) Pass = false;
  }
  return Pass;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
@RogerNattkemper the DestroyNum has it's own arguments object
Cordoba84
@fcordoba84
Aug 18 2015 18:15
var ourArray = ["Stimpson", "J", ["cat"]];
ourRemoved = ourArray.shift();
// ourArray now equals ["J", ["cat"]]

var myArray = ["John", 23, ["dog", 3]];
// Only change code below this line.
ourremoved= myarray.shift(John);
var myRemoved = myArray; // This should be ["John"] and myArray should now be [23, ["dog", 3]]

// Only change code above this line.

// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
(function(y, z){return('myArray = ' + JSON.stringify(y) + ' & myRemoved = ' + JSON.stringify(z));})(myArray, myRemoved);
DTing
@dting
Aug 18 2015 18:16
@fcordoba84 dont set ourRemoved to the shifted value to set myRemoved to that value.
Roger Nattkemper
@RogerNattkemper
Aug 18 2015 18:16
Oh, got it. I think I need to create global array for the arguments then
Cordoba84
@fcordoba84
Aug 18 2015 18:20
got it thanks @dting
CamperBot
@camperbot
Aug 18 2015 18:20
fcordoba84 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 301 | @dting | http://www.freecodecamp.com/dting
Roger Nattkemper
@RogerNattkemper
Aug 18 2015 18:27
Thanks @dting , the global array worked, not sure what Closures do for me.
CamperBot
@camperbot
Aug 18 2015 18:27
rogernattkemper sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 303 | @dting | http://www.freecodecamp.com/dting
Donny van Walsem
@Donneh
Aug 18 2015 18:27
I can't seem to the Bonfure: Title Case a Sentence right, right now I get every first character of every word in uppercase but i lose the rest of the word, which i guess is obvious but i don't know how to fix it.
function titleCase(str) {
  var array = str.split(/\s/g);
  for(var i = 0; i < array.length; i++) {

    array[i] = array[i].charAt(0).toUpperCase();
  }
  console.log(array.join(' '));
  return array.join(' ');
}

titleCase("I'm a little tea pot");
Cordoba84
@fcordoba84
Aug 18 2015 18:29
var ourArray = ["Stimpson", "J", ["cat"]];
ourArray.shift();
ourArray.unshift(["happy", "joy"]);
// ourArray now equals [["happy", "joy"], "Stimpson", "J"]

var myArray = [["Paul"], "John", 23, ["dog", 3]];
myArray.shift();
myArray.unshift();
// Add "Paul" to the start of myArray
// Only change code below this line.


// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
(function(y, z){return('myArray = ' + JSON.stringify(y));})(myArray);
no idea what wrong here
this is what i must do Let's take the code we had last time and unshiftthis value to the end: "Paul"
Shane
@sigshane
Aug 18 2015 18:30
Hey all. I am having a problem with waypoint "Target a Specific Child of an Element Using jQuery". I try and try to make the second child bounce, but I just cannot get it. Here is my code:
$(".well:nth-child(2)").addClass("animated bounce");
Donny van Walsem
@Donneh
Aug 18 2015 18:31
@sigshane you need to use .target:nth-child(2) i believe
Cordoba84
@fcordoba84
Aug 18 2015 18:31
nm i got it
Shane
@sigshane
Aug 18 2015 18:32
ahh, okay!
DTing
@dting
Aug 18 2015 18:32
@sigshane add a space between the .well and the :nth-child
Shane
@sigshane
Aug 18 2015 18:33
@Donneh Still don't see how jQuery gets the right buttons to bounce when typing 'target:' though...
Donny van Walsem
@Donneh
Aug 18 2015 18:34
@sigshane You can read more about nth-child here https://css-tricks.com/almanac/selectors/n/nth-child/
Shane
@sigshane
Aug 18 2015 18:34
@Donneh Thanks again!
CamperBot
@camperbot
Aug 18 2015 18:34
sigshane sends brownie points to @donneh :sparkles: :thumbsup: :sparkles:
:star: 150 | @donneh | http://www.freecodecamp.com/donneh
Donny van Walsem
@Donneh
Aug 18 2015 18:35
@sigshane i find the name a bit confusing as well, but you don't select the parent, instead you use the element you want to find
Shane
@sigshane
Aug 18 2015 18:36
ok, back to camp!
DTing
@dting
Aug 18 2015 18:39
@sigshane you can use the parent selector if you put a space: https://jsfiddle.net/3cmdhoa1/
Donny van Walsem
@Donneh
Aug 18 2015 18:51
@dting Oh i've never heard of that, thank you!
CamperBot
@camperbot
Aug 18 2015 18:51
donneh sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 305 | @dting | http://www.freecodecamp.com/dting
ShafM
@ShafM
Aug 18 2015 19:00
Hi guys needs a bit of a hand to solve a issue

1

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

<style>
3
.red-text {
4
color: red;
5
}
6

7
h2 {
8
font-family: Lobster, Monospace;
9
}
10

11
<ul>
12
{
13
font-size: 16px;
14
font-family: Monospace;
15
}
16

17
.thick-green-border {
18
border-color: green;
19
border-width: 10px;
20
border-style: solid;
21
border-radius: 50%;
22
}
23

24
.smaller-image {
25
width: 100px;
26
}

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

<ul>
35
<li>milk</li>
36
<li>cheese</li>
37
<li></li>
38
</ul>

Am checking if my ul closing tag element is correct
amwakatsuki
@amwakatsuki
Aug 18 2015 19:07

Can someone point me in the right direction on the bonfire seek and destroy? This is what I have so far:

function destroyer(arr) {
  // Remove all the values
  for (var i=0;i<arguments.length;i++){
    for (var j=0; j<arr.length;j++){
      if (arr[j]!==arguments[i]){
        arr.filter(arr[j]);
      }
    }
  }

  return arr;
}

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

I get the error that 1 is not a function but I don't know what that means

DTing
@dting
Aug 18 2015 19:08
@amwakatsuki if you are going to iterate inside the outer loop dont use filter
amwakatsuki
@amwakatsuki
Aug 18 2015 19:09
@dting should i use .splice instead?
amwakatsuki
@amwakatsuki
Aug 18 2015 19:10
@joshghent I didn't have any problems with it. I did it just a couple of days ago.
Emil Aasa
@emilaasa
Aug 18 2015 19:12
@joshghent did it right now, works fine
DTing
@dting
Aug 18 2015 19:12
@amwakatsuki you dont want to alter the array you are iterating. I would suggest either creating a temp array and add non matching elements to that temp array, then setting arr to that temp array after the nested for loop or using arr = arr.filter(function(v) { return arguments[i] !== v; }); inside the for loop
Josh Ghent
@joshghent
Aug 18 2015 19:13
@emilaasa @amwakatsuki Guess I'm just being dumb haha
Emil Aasa
@emilaasa
Aug 18 2015 19:14
What is happening for you?
amwakatsuki
@amwakatsuki
Aug 18 2015 19:14
@dting Thanks. I'm still learning a lot so it'll probably take a little while for me to digest what you wrote.
CamperBot
@camperbot
Aug 18 2015 19:14
amwakatsuki sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 308 | @dting | http://www.freecodecamp.com/dting
ivanhnavi
@ivanhnavi
Aug 18 2015 19:16
OMG i finally got smallest common multiple, after over a week of being stuck
@ivanhnavi nice!
that ones tough.
ivanhnavi
@ivanhnavi
Aug 18 2015 19:17
i had skipped it and started the advanced ones, but i for the life of me could not figure that out
Seth
@itzsaga
Aug 18 2015 19:17
congrats @ivanhnavi. Feels good doesn't it!
ivanhnavi
@ivanhnavi
Aug 18 2015 19:17
i stopped trying to solve it mathematically and just used arrays and it became much easier
Josh Ghent
@joshghent
Aug 18 2015 19:17
@emilaasa I was reading it completely wrong. Thanks anyway!
CamperBot
@camperbot
Aug 18 2015 19:17
joshghent sends brownie points to @emilaasa :sparkles: :thumbsup: :sparkles:
:star: 155 | @emilaasa | http://www.freecodecamp.com/emilaasa
ivanhnavi
@ivanhnavi
Aug 18 2015 19:18
@itzsaga yes! now i can move on in peace
now time to solve symmetric difference --
anybody have any advice on how to approach the symmetric difference bonfire
DTing
@dting
Aug 18 2015 19:23
bf symmetric
CamperBot
@camperbot
Aug 18 2015 19:23

:fire:Bonfire: Symmetric Difference :link:

function sym(args) {
  return arguments;
}

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

Create a function that takes two or more arrays and returns an array of the symmetric difference of the provided arrays.

more info:  bf details | bf links | hint

DTing
@dting
Aug 18 2015 19:24
@ivanhnavi theres a video that people link all the time for that one.
I think it might be this one? https://www.youtube.com/watch?v=PxffSUQRkG4
Paul
@pauliwoggius
Aug 18 2015 19:31
Hey, I'm trying to get some practice in with jQuery and I wrote this up, yet I'm puzzled why my click isn't populating results like it should be (around line 30) http://codepen.io/pauliwoggius/pen/oXRMyy?editors=001 Not sure if I'm even going about implementing what I want in the right way - if that makes any sense.
DTing
@dting
Aug 18 2015 19:38
@pauliwoggius you are getting a ReferenceError because you are calling arrCounter instead of arrCount
ivanhnavi
@ivanhnavi
Aug 18 2015 19:38
awesome thanks @dting !
CamperBot
@camperbot
Aug 18 2015 19:38
ivanhnavi sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 310 | @dting | http://www.freecodecamp.com/dting
Paul
@pauliwoggius
Aug 18 2015 19:39
@dting I knew it was something simple, THANKS :)
CamperBot
@camperbot
Aug 18 2015 19:39
pauliwoggius sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 311 | @dting | http://www.freecodecamp.com/dting
Paul
@pauliwoggius
Aug 18 2015 19:44
Now I just need to figure out how to get the 'count' to update..
Augustas
@AugustasV
Aug 18 2015 19:45

After googling i didnt find solution for Waypoint: Give a Background Color to a Div Element
gray-background {
background-color: gray;
}

<div class="gray-background"></div>
what is wrong?

Tahmid Zahin
@Zahin-10
Aug 18 2015 19:45
$($(".slot")[0]).html(slotOne);
$($(".slot")[1]).html(slotTwo);
$($(".slot")[2]).html(slotThree);
can someone please explain me whats happening in the above code, most imortantly .htmL();
@Zahin-10
"When .html() is used to set an element's content, any content that was in that element is completely replaced by the new content. Additionally, jQuery removes other constructs such as data and event handlers from child elements before replacing those elements with the new content."
Paul
@pauliwoggius
Aug 18 2015 19:49
@Zahin-10 I think you are looking for .text..? https://api.jquery.com/text/
Tahmid Zahin
@Zahin-10
Aug 18 2015 19:49
I am still kinda confused :/ how is it targeting the div element
??
Paul
@pauliwoggius
Aug 18 2015 19:51
@Zahin-10 the target is $('<target>') so if it is '.slot' that means it's a class that is being selected/targeted
DTing
@dting
Aug 18 2015 19:51
the inner $() finds the elements with .slot class the outer $() uses that list and says I want the [#th] one for example $($(".slot")[0]) gives you the element that is the first found with the .slot class
Isaac Calvo
@Icalvo1
Aug 18 2015 19:52
hi everyone
http://www.freecodecamp.com/challenges/waypoint-create-a-javascript-slot-machine <-- for this one any reason why my code doesn't pass function slotMac(variable){ variable = Math.floor(Math.random() * (3 - 1 + 1)) + 1; return variable; } var slotOne = slotMac(slotOne); var slotTwo = slotMac(slotTwo); var slotThree =slotMac(slotThree);
Tahmid Zahin
@Zahin-10
Aug 18 2015 19:53
ohk got it thanks @dting @pauliwoggius
CamperBot
@camperbot
Aug 18 2015 19:53
zahin-10 sends brownie points to @dting and @pauliwoggius :sparkles: :thumbsup: :sparkles:
:star: 271 | @pauliwoggius | http://www.freecodecamp.com/pauliwoggius
:star: 313 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 18 2015 19:53
@Icalvo1 they use regex to check the answers
@Icalvo1 just use var slotOne = ... var slotTwo = ...
Math.floor(Math.random() * (3 - 1 + 1)) + 1;
Isaac Calvo
@Icalvo1
Aug 18 2015 19:54
ok... thanks @dting
CamperBot
@camperbot
Aug 18 2015 19:54
icalvo1 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 314 | @dting | http://www.freecodecamp.com/dting
Dániel Erdős
@WebDevDani
Aug 18 2015 19:55

Hey guys! Can someone help how to prevent the for loop to stop after checking the first letter of this?

function mutation(arr) {
  var testString = arr[0].toLowerCase();
  var matchString = arr[1].toLowerCase();

  var testArray = new Array();
  testArray = testString.split('');

  var matchArray = new Array();
  matchArray = matchString.split('');

  var i;

  for (i=0; i < matchArray.length; i++){
 if (testString.indexOf(matchString[i]) != -1) {


     return true;

 } else {

   return false;

        }

     }

}

mutation(['Hello', 'hey']);

It returns as true . I don't know if one of the returns should be out of the if or for loop, or need some additional code, or is the if (testString.indexOf(matchString[i]) != -1) part of the code is correct. Can someone please help me? :)

shadowprogram
@shadowprogram
Aug 18 2015 19:58
bootstrap #30 is bugged for me
DTing
@dting
Aug 18 2015 20:00
@WebDevDani just dont return on the cases you dont want to return. In this case you would have to switch your conditional to if (testString.indexOf(matchString[i]) === -1) { return false; } Then return true after the for loop
Dániel Erdős
@WebDevDani
Aug 18 2015 20:03
@dting THANKS! You're a lifesaver, tried to figure it out all day :) :)
CamperBot
@camperbot
Aug 18 2015 20:03
webdevdani sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 315 | @dting | http://www.freecodecamp.com/dting
Jesse Rafael Dizon
@jesserafael
Aug 18 2015 20:09

``function sym(args) {
return arguments;
}

sym([1, 2, 3], [5, 2, 1, 4])``

Ryan Malm
@Rybar
Aug 18 2015 20:14
This message was deleted
shadowprogram
@shadowprogram
Aug 18 2015 20:15
anyone here know anything about jquery
Josh Ghent
@joshghent
Aug 18 2015 20:20
@shadowprogram What do you need to know?
Asim Adnan Eijaz
@asimadnan
Aug 18 2015 20:23
Screen Shot 2015-08-19 at 1.22.23 am.png
how can i implement something like this?
any suggestion or hints are welcome
shadowprogram
@shadowprogram
Aug 18 2015 20:27
anyway**

like

$("#target3").removeClass("btn-default");
$("#target4").removeClass("btn-default");

can i do it once for several targets without a loop?

Jeff McCullough
@jmac412
Aug 18 2015 20:31

Waypoint: Give your JavaScript Slot Machine some stylish images

I'm not sure why the following code isn't accepting as being correct. The game plays and acts as it should but the item for "use each line of code provided 3 times. Which I did.

$($(".slot")[0]).html('<img src = "' + images[slotOne-1] + '">');
$($(".slot")[1]).html('<img src = "' + images[slotTwo-1] + '">');
$($(".slot")[2]).html('<img src = "' + images[slotThree-1] + '">');

Rasheed Bustamam
@abustamam
Aug 18 2015 20:34
@shadowprogram give them all a class
like .target
and then just do $(".target").removeClass('btn-default');
Isaac
@BenBagBag
Aug 18 2015 20:55
I'm doing the Find the Longest Word Bonfire and can't figure out what's up with my code:
function findLongestWord(str) {
str = str.split(' ');
longest_word = 0;
for (var word in str) {
if (word.length > longest_word) {
longest_word = word.length;
}
}
return longest_word;
}
It keeps returning 2. Can anyone help?
Coira Ellison
@Coira
Aug 18 2015 20:59
@BenBagBag I don't think you can use for x in array like that in javascript
Isaac
@BenBagBag
Aug 18 2015 21:01
@Coira thanks, changing it to for (x = 0; x < str.length; x ++) fixed it
CamperBot
@camperbot
Aug 18 2015 21:01
benbagbag sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 163 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Aug 18 2015 21:02
from what i can see, for-in is just for object iteration, not array-iteration
another one of those javascript quirks!
Paul
@pauliwoggius
Aug 18 2015 21:04
Argh, I can't figure out why line 54 in my jQuery thing isn't working.. Each click should be clearing the elements, then populating the new ones from the information in the array: http://codepen.io/pauliwoggius/pen/oXRMyy?editors=101
Ozy Design & Software
@OzySky
Aug 18 2015 21:12
@pauliwoggius if you try running it without any number, it shows NaN Count:0 as many times you press it, but if you input a number it stops showing...
John Nieves
@karn09
Aug 18 2015 21:13
@asimadnan is that one of the projects through FCC?
@asimadnan if you just want to do it quickly, there are libraries online that will let you do that.. just search for list filter search and examples will come up
Josh Ghent
@joshghent
Aug 18 2015 21:14
Can someone help me here?
Ozy Design & Software
@OzySky
Aug 18 2015 21:14
@joshghent yep
Josh Ghent
@joshghent
Aug 18 2015 21:14
function where(collection, source) {
  var arr = [];
  // What's in a name?
  var sourceItem = Object.keys(source)[0];
  for(i = 0; i < collection.length;i++){
    if(collection[i].hasOwnProperty(sourceItem) == source[sourceItem]){
      arr.push(collection[i]);
    }
  }
  return arr;
}
It passes 1 test but not the one provided in the code
Ozy Design & Software
@OzySky
Aug 18 2015 21:15
@joshghent paste the errors please...
Josh Ghent
@joshghent
Aug 18 2015 21:15
assert.deepEqual(where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }), [{ first: 'Tybalt', last: 'Capulet' }], 'should return an array of objects');should return an array of objects: expected [] to deeply equal [ Array(1) ]
thats the one that errors
I think my if statement is not right because it is comparing a boolean value to something. There might need to be another check I addon
Ozy Design & Software
@OzySky
Aug 18 2015 21:18
it means that your function returns an empty arr when it should have returned the object that matched inside an array
@joshghent collection[i].hasOwnProperty(sourceItem)
should suffice really
Josh Ghent
@joshghent
Aug 18 2015 21:19
@ozydesign Hmm so how does the other test pass, yet this one doesnt?
Coira Ellison
@Coira
Aug 18 2015 21:20
@joshghent no you're right, you need to tests in if
@joshghent *two
Josh Ghent
@joshghent
Aug 18 2015 21:21
@Coira @ozydesign I'm not 100% clear what I am doing wrong at the moment...
Coira Ellison
@Coira
Aug 18 2015 21:21
you're almost there, except you need one more check in your if statement
Josh Ghent
@joshghent
Aug 18 2015 21:21
@Coira For what?
Coira Ellison
@Coira
Aug 18 2015 21:22
you need to check whether collection has a property called sourceItem, and then you need to check whether collection's sourceItem is equal to source's sourceItem
Ozy Design & Software
@OzySky
Aug 18 2015 21:22
exactly
Lionel Croes
@lionelx1
Aug 18 2015 21:23
Hello i am new to this.
I am stuck at Waypoint: size your image.
html and css case 17
<img class="smaller-image"> < .smaller-image{ width: 100px; }>
I know i am doing something wrong :(
Could anyone help me?
Ozy Design & Software
@OzySky
Aug 18 2015 21:25
<style> .smaller-image { width: 100px; } </style>
Josh Ghent
@joshghent
Aug 18 2015 21:25
@Coira @ozydesign So I'm adding && collection[i].sourceItem to my if statement?
but how do I reference sourceItem of collection since it is not an object?
Vitalii Danylov
@vitaliidanylov
Aug 18 2015 21:25
Hi everyone! I'm trying to solve Bonfire: No repeats please analytically. Is there someone who already solved the task and could give some piece of advice? I also wondered why we have link to RegExpr there, how we can implement it here? Than you!
Matt Everson
@matteverson
Aug 18 2015 21:26
@joshghent You could use array index notation e.g. collection[i][sourceItem]
Coira Ellison
@Coira
Aug 18 2015 21:26
@joshghent console.log collection[i] to see what it is (in the browser console)
Steven Young
@ShelbyGT
Aug 18 2015 21:27
function myFunction(){
  // Make myFunction return a random number betweenzero and nine> instead of a decimal

  // Only change code below this line.
Math.floor(Math.random()*10);
  return(Math.random());

  // Only change code above this line.
}

// We use this function to show you the value of your variable in your output box.
(function(){return(myFunction());})();
i dont get it
Ozy Design & Software
@OzySky
Aug 18 2015 21:28
@vitaliidanylov I really had a hard time with it as well, so I had to use an implementation of Heap's algorithm (from mjkoita over at StackExchange) for permutations, then I used regex to check for any consecutive double letter :blush:
@ShelbyGT yes?
Coira Ellison
@Coira
Aug 18 2015 21:28
has anyone managed a formula for that yet? I've seen a lot of people try it
Josh Ghent
@joshghent
Aug 18 2015 21:28
@matteverson @Coira @ozydesign Thanks all!
CamperBot
@camperbot
Aug 18 2015 21:28
joshghent sends brownie points to @matteverson and @coira and @ozydesign :sparkles: :thumbsup: :sparkles:
:star: 228 | @matteverson | http://www.freecodecamp.com/matteverson
:star: 166 | @coira | http://www.freecodecamp.com/coira
:star: 168 | @ozydesign | http://www.freecodecamp.com/ozydesign
Steven Young
@ShelbyGT
Aug 18 2015 21:29
it doesnt work
Lionel Croes
@lionelx1
Aug 18 2015 21:29
@ozydesign i did put the <style> .smaller-image { width: 100px; } </style> before but it still isn't working.
Josh Ghent
@joshghent
Aug 18 2015 21:29
I got that it was undefined in console and all the frames are called _frame.html :p @Coira
Coira Ellison
@Coira
Aug 18 2015 21:29
@joshghent oh... weird, I don't know why that happened
I got Object {first: "Romeo", last: "Montague"} btw
Josh Ghent
@joshghent
Aug 18 2015 21:30
@Coira Yeah me either it didn't seem to be selecting the right frame at all
Huh ok, that is interesting
Jerry Robles
@jerryrobles
Aug 18 2015 21:30

@ShelbyGT Do you have any variables declared?

try

return Math.floor(Math.random() * 10)) + 1;
Ozy Design & Software
@OzySky
Aug 18 2015 21:30
@vitaliidanylov we can pair on it if you want..

@lionelx1

<style> .smaller-image { width: 100px; } </style>
<img class='smaller-image' src="https://bit.ly/fcc-relaxing-cat">

works fine for me

Steven Young
@ShelbyGT
Aug 18 2015 21:33
nope @jerryrobles
Ozy Design & Software
@OzySky
Aug 18 2015 21:34
@ShelbyGT maybe you're not calling the second function?
Vitalii Danylov
@vitaliidanylov
Aug 18 2015 21:34
@ozydesign let's try it tomorrow because it's quite late in my city now,
ok?
Ozy Design & Software
@OzySky
Aug 18 2015 21:34
@vitaliidanylov no probs mate, quite late here too actually :+1:
Jerry Robles
@jerryrobles
Aug 18 2015 21:34
@ShelbyGT can you post a link to the bonfire?
Steven Young
@ShelbyGT
Aug 18 2015 21:35
not a bonfire its Waypoint: Generate Random Whole Numbers with JavaScript @jerryrobles
Vitalii Danylov
@vitaliidanylov
Aug 18 2015 21:36
@ozydesign give me your email or some information, that I could add you
Jerry Robles
@jerryrobles
Aug 18 2015 21:38
@ShelbyGT use the two variables declared above, you pretty much just return what's written in the sample code on the left
@ShelbyGT the max and min
Ozy Design & Software
@OzySky
Aug 18 2015 21:38
@ShelbyGT return Math.floor(Math.random() * 10))
Jerry Robles
@jerryrobles
Aug 18 2015 21:40
return Math.floor(Math.random() * max - min + 1)) + 1;
Steven Young
@ShelbyGT
Aug 18 2015 21:42
still doesnt work
Jerry Robles
@jerryrobles
Aug 18 2015 21:42
@ShelbyGT check the fourth example Math.Random()
@ShelbyGT should look like this
function myFunction(){
   return Math.floor(Math.random() * max - min + 1)) + 1;
}
Steven Young
@ShelbyGT
Aug 18 2015 21:46
rotflmao,,it still doesnt work
Jerry Robles
@jerryrobles
Aug 18 2015 21:46
lol
is your computer plugged in?
jk
TC
@tcpecher
Aug 18 2015 21:47
I can't figure out how to use string.replace();
I'm trying to get rid of any non-letter characters in a string. I've been trying variations of /[^a-z]/ and /\W/
Steven Young
@ShelbyGT
Aug 18 2015 21:47
ummm,let me check real quick
function myFunction(){
  // Make myFunction return a random number betweenzero and nine> instead of a decimal

  // Only change code below this line.

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

  // Only change code above this line.
};

// We use this function to show you the value of your variable in your output box.
(function(){return(myFunction());})();
Jerry Robles
@jerryrobles
Aug 18 2015 21:48
@tcpecher hi, can you post your code?
Coira Ellison
@Coira
Aug 18 2015 21:48
@tcpecher if you want to check the whole string, add 'g' to the end of your regex, e.g. string.replace( /[^a-z]/g, ...)
it's a flag, global
Jerry Robles
@jerryrobles
Aug 18 2015 21:49
@ShelbyGT that looks right, unless I'm just blind and don't see it
This message was deleted
TC
@tcpecher
Aug 18 2015 21:49
@Coira Thank you! That's all it was.
CamperBot
@camperbot
Aug 18 2015 21:49
tcpecher sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
Steven Young
@ShelbyGT
Aug 18 2015 21:50
firefox says nope,,,let me try to refresh page
\
CamperBot
@camperbot
Aug 18 2015 21:50
:star: 167 | @coira | http://www.freecodecamp.com/coira
Young Lee
@young92117
Aug 18 2015 21:50
@tcpecher /\W/ should work… what are you trying to do with string.replace() and what did you get when you use /W/ ?
Steven Young
@ShelbyGT
Aug 18 2015 21:50
nope
Coira Ellison
@Coira
Aug 18 2015 21:50
@tcpecher :) everyone has that problem the first time with string.replace
Jerry Robles
@jerryrobles
Aug 18 2015 21:51
@ShelbyGT what error(s) is it giving you?
is it outputting anything?
Steven Young
@ShelbyGT
Aug 18 2015 21:52
missing ; before statement
in the console.log()
Young Lee
@young92117
Aug 18 2015 21:52
@ShelbyGT You need to define max and min in your program.. I don’t see they are defined
Emanuele Antonelli
@Em-Ant
Aug 18 2015 21:53
would you like to help me testing my simon game ?
Coira Ellison
@Coira
Aug 18 2015 21:55
yep go on, post the link
Lionel Croes
@lionelx1
Aug 18 2015 21:55
@ozydesign it is working now thanks allot.
CamperBot
@camperbot
Aug 18 2015 21:55
lionelx1 sends brownie points to @ozydesign :sparkles: :thumbsup: :sparkles:
:star: 169 | @ozydesign | http://www.freecodecamp.com/ozydesign
Ozy Design & Software
@OzySky
Aug 18 2015 21:55
@lionelx1 np
it uses AudiooContext, i dont know if it is too up-to-date ...
Coira Ellison
@Coira
Aug 18 2015 21:57
i went wrong and the error sound won't stop!
apart from that, working well so far
Emanuele Antonelli
@Em-Ant
Aug 18 2015 21:59
@Coira only one time ? or everytime you go wrong. I've played a bit and it seems to work well.
Coira Ellison
@Coira
Aug 18 2015 22:00
every time, have to close the page
Ozy Design & Software
@OzySky
Aug 18 2015 22:00
@Em-Ant nice bg btw
Coira Ellison
@Coira
Aug 18 2015 22:00
tested in chrome
yeah, it looks good
Emanuele Antonelli
@Em-Ant
Aug 18 2015 22:02
Coira Ellison
@Coira
Aug 18 2015 22:02
thanks @Em-Ant
CamperBot
@camperbot
Aug 18 2015 22:02
coira sends brownie points to @em-ant :sparkles: :thumbsup: :sparkles:
:star: 287 | @em-ant | http://www.freecodecamp.com/em-ant
Coira Ellison
@Coira
Aug 18 2015 22:03
i don't have the sound problem in firefox
Elliescode
@EllieAdam
Aug 18 2015 22:03
hello!
Emanuele Antonelli
@Em-Ant
Aug 18 2015 22:03
i have firefox and it works. Anyone else with chrome ?
Elliescode
@EllieAdam
Aug 18 2015 22:04
  body {
    background-color: black;
    font-family: Monospace;
    color: green;
  }
  .pink-text {
    color: pink;
  }
   .blue-text {
    color: blue;
  }

</style>
<h1 class="pink-text"
    class="blue-text">Hello World!</h1>
Coira Ellison
@Coira
Aug 18 2015 22:05
hi! @EllieAdam :thumbsup:
Elliescode
@EllieAdam
Aug 18 2015 22:06

What wrong with this basic css??

Your h1 element should have the class pink-text.
Your h1 element should have the class blue-text.
Your h1 element should be blue.

Ken
@Kparelius
Aug 18 2015 22:07
You can string your classes inside the <h1>
Coira Ellison
@Coira
Aug 18 2015 22:07
you can put both class names in one class, i.e. class="pink-text blue-text"
Ken
@Kparelius
Aug 18 2015 22:08
like ths: <h1 class="pink-text blue-text"
^^
Elliescode
@EllieAdam
Aug 18 2015 22:09
thanks! @Coira
CamperBot
@camperbot
Aug 18 2015 22:09
ellieadam sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 168 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Aug 18 2015 22:09
what @Kparelius said, my internet connection's dying right about now
Ken
@Kparelius
Aug 18 2015 22:09
@Coira you beat me to it. :D
Elliescode
@EllieAdam
Aug 18 2015 22:10
what is this brownie??
thanks @Kparelius
CamperBot
@camperbot
Aug 18 2015 22:10
ellieadam sends brownie points to @kparelius :sparkles: :thumbsup: :sparkles:
:star: 141 | @kparelius | http://www.freecodecamp.com/kparelius
Ken
@Kparelius
Aug 18 2015 22:12
@EllieAdam Magical internet points. I think they add to your number on your profile. The same one for the number of exercises you've completed. Some kind of kudos.
Coira Ellison
@Coira
Aug 18 2015 22:12
camperbot brownie points
camperbot :(
Ken
@Kparelius
Aug 18 2015 22:13
wiki brownie points
CamperBot
@camperbot
Aug 18 2015 22:13
no wiki entry for: brownie points
:pencil: click here to create one now!after creating your page type update to reload it here
Tod
@thermobee
Aug 18 2015 22:26
Can anyone help me with the palindrome bonfire?
CamperBot
@camperbot
Aug 18 2015 22:26
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Tod
@thermobee
Aug 18 2015 22:27
bonfire Check for Palindromes
CamperBot
@camperbot
Aug 18 2015 22:27

:fire:Bonfire: Check for Palindromes :link:

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



palindrome("eye");

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

more info:  bf details | bf links | hint

cooljoe21
@cooljoe21
Aug 18 2015 22:28
can i have some help with this http://www.freecodecamp.com/challenges/waypoint-add-font-awesome-icons-to-our-buttons
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  h2 {
    font-family: Lobster, Monospace;
  }

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

<div class="container-fluid">
  <div class="row">
    <div class="col-xs-8">
      <h2 class="text-primary text-center">CatPhotoApp</h2>
    </div>
    <div class="col-xs-4">
      <a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
    </div>
  </div>
  <img src="http://bit.ly/fcc-running-cats" class="img-responsive">
  <div class="row">
    <div class="col-xs-4">
      <button class="btn btn-block btn-primary"><i class= fa-thumbs-up>
      </i>Like</button>

    </div>
    <div class="col-xs-4">
      <button class="btn btn-block btn-info">Info</button>
    </div>
    <div class="col-xs-4">
      <button class="btn btn-block btn-danger">Delete</button>
    </div>
  </div>
  <p>Things cats <span class="text-danger">love:</span></p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>

  <form action="/submit-cat-photo">
    <label><input type="radio" name="indoor-outdoor"> Indoor</label>
    <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
    <label><input type="checkbox" name="personality"> Loving</label>
    <label><input type="checkbox" name="personality"> Lazy</label>
    <label><input type="checkbox" name="personality"> Crazy</label>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</div>
gravesr1993
@gravesr1993
Aug 18 2015 22:33
so i'm working on http://www.freecodecamp.com/challenges/zipline-build-a-random-quote-machine and I wanted to integrate the API they provided http://forismatic.com/en/api/ , but i'm not sure how I make API calls in JS? I've been reading about it but I can't seem to find anything that works, this is what my HTML/JS looks like currently
HTML:
<body>
  <div class="fluid-container">
    <h1><center>Quote Machine Zipline</center></h>
    <br>
    <center><button input-type="button" class="btn btn-default btn-lg quote-button">New Quote</button></center>
  </div>
  <div class="quote-block">
    <p class="quote"><center>Quote will appear here</center></p>
  </div>
</body>

JS:
$(document).ready(function(){
  $(".quote-button").click(function(){
    console.log("quote button clicked");
    console.log(jQuery.ajax("http://api.forismatic.com/api/1.0/"));
  });
});
Ken
@Kparelius
Aug 18 2015 22:38
@cooljoe21 what's your question?
cooljoe21
@cooljoe21
Aug 18 2015 22:39
i already got it answered, but thanks anyway @Kparelius !! :smile:
CamperBot
@camperbot
Aug 18 2015 22:39
cooljoe21 sends brownie points to @kparelius :sparkles: :thumbsup: :sparkles:
:star: 142 | @kparelius | http://www.freecodecamp.com/kparelius
Ken
@Kparelius
Aug 18 2015 22:42
@cooljoe21 Glad you got it worked out!
Isaac
@BenBagBag
Aug 18 2015 22:45
@cooljoe21 you need quotes around your 'fa fa-thumbs-up' class
cooljoe21
@cooljoe21
Aug 18 2015 22:48
thanks @BenBagBag
CamperBot
@camperbot
Aug 18 2015 22:48
cooljoe21 sends brownie points to @benbagbag :sparkles: :thumbsup: :sparkles:
:star: 94 | @benbagbag | http://www.freecodecamp.com/benbagbag
IllusionElements
@IllusionElements
Aug 18 2015 22:48
can anyone help me here? For some reason my site here: http://s.codepen.io/illusionelements/debug/ZGNvVM? keeps returning waypoints is not a function when I have the waypoints.js file in there and added?
Eric
@emaclean03
Aug 18 2015 22:49
wow @Em-Ant, i was having a blast with your game until it blew up my speakers hahaha
Alexandro Perez
@AlexandroPerez
Aug 18 2015 22:49

I'm having problems managing my account and syncing it to github. I think the problem might be because I synced my account to github in beta, and now that beta is merged with my original account, I'm locked out of my account settings.

problem snapshop

anyone else experiencing this problem?

Emanuele Antonelli
@Em-Ant
Aug 18 2015 22:50
@emaclean03 @Coira @ozydesign now it should be fixed, if you want to try again http://codepen.io/Em-Ant/full/QbRyqq/
@emaclean03 sorry :worried:
Eric
@emaclean03
Aug 18 2015 22:51
yeah, it still sounds really weird when its wrong - but doesnt hang
Ken
@Kparelius
Aug 18 2015 22:52
@AlexandroPerez when I had this problem it was because I had a separate account under my GitHub login. I had to delete the GitHub FCC account and then login to my email FCC account, and then I could sync the two.
Emanuele Antonelli
@Em-Ant
Aug 18 2015 22:53
@emaclean03 it's a just a square oscillator on 55Hz, i didn't use external sounds. maybe i can lower the volume. On chrome is louder than firefox.
@emaclean03 thanks (let's try the brownies ...)
CamperBot
@camperbot
Aug 18 2015 22:54
em-ant sends brownie points to @emaclean03 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for emaclean03
Eric
@emaclean03
Aug 18 2015 22:54
ahh makes sense. sounds like when you're about to plug in your speaker wire to the computer haha
Alexandro Perez
@AlexandroPerez
Aug 18 2015 22:54
@Kparelius I tried that already... with no luck. Before I deleted the account that was synced to github (by signing in with github to that account), the button that says Update my profile from Github right now, used to say something like Sync to Github to unlock this account (can't remember well, and now I can't get that button to show up)
@Kparelius So according to my FCC before it wasn't synced, and now it is, but I can't to anything...
Eric
@emaclean03
Aug 18 2015 22:55
@Em-Ant - on "count" 3 is also saying im wrong every time
Ken
@Kparelius
Aug 18 2015 22:56
@AlexandroPerez Yikes. I'm at a loss on that one.
Emanuele Antonelli
@Em-Ant
Aug 18 2015 23:00
@dting thanks, very interesting
CamperBot
@camperbot
Aug 18 2015 23:00
em-ant sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 319 | @dting | http://www.freecodecamp.com/dting
Alexandro Perez
@AlexandroPerez
Aug 18 2015 23:01
@Kparelius Ok, I singed out of my account, and tried sign in with Github again. It works, since I see my progress correctly. I guess I'm thinking that I can change my settings by clicking the Update my profile from Github button, but actually there are no settings at all this time around? By settings I mean stuff like managing facebook, codepen.io, linked in so that they show up in my FCC portfolio... But could it be that FCC removed that feature?
@Kparelius So that button is only used to get a picture and name from github, and nothing else perhaps?
Ken
@Kparelius
Aug 18 2015 23:02
@AlexandroPerez That's a good point. I didn't notice that. I can't manage anything either. It must be just GitHub creds now.
DTing
@dting
Aug 18 2015 23:03
@AlexandroPerez I'm pretty sure they are working on the portfolio page still. I wouldn't be surprised if some of those features came back
Maria Brito
@happycodecamper
Aug 18 2015 23:06
@camperbot Hi: I have a question regarding the latest changes in the FCC website. I noticed that a lot was added. I had >60% JavaScript completed in the Codecademy and looking back, it seems that my training on JQuery, etc was not completed at all. How is this going to work? Do I have to go back and redo all "missing" training, although I had completed it? Thanks
CamperBot
@camperbot
Aug 18 2015 23:06
happycodecamper sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
Alexandro Perez
@AlexandroPerez
Aug 18 2015 23:06
@dting I'm guessing that's the case.
CamperBot
@camperbot
Aug 18 2015 23:06
:star: 27 | @camperbot | http://www.freecodecamp.com/camperbot
Alexandro Perez
@AlexandroPerez
Aug 18 2015 23:06
thanks @dting
CamperBot
@camperbot
Aug 18 2015 23:06
alexandroperez sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 320 | @dting | http://www.freecodecamp.com/dting
Alexandro Perez
@AlexandroPerez
Aug 18 2015 23:06
thanks @Kparelius
CamperBot
@camperbot
Aug 18 2015 23:06
alexandroperez sends brownie points to @kparelius :sparkles: :thumbsup: :sparkles:
:star: 144 | @kparelius | http://www.freecodecamp.com/kparelius
Ayo
@ayondot
Aug 18 2015 23:17
does anyone know why i get a "console not defined" message when i run this code console.log('Hello world!'); on bonfire http://www.freecodecamp.com/challenges/-use-the-javascript-console
DTing
@dting
Aug 18 2015 23:18
@ayondot the code editor refreshes while you are typing. No worries.
Ayo
@ayondot
Aug 18 2015 23:19
@dting so its a bug?
Isaac Calvo
@Icalvo1
Aug 18 2015 23:19

I had a hard time with this one: http://www.freecodecamp.com/challenges/bonfire-find-the-longest-word-in-a-string
got it to pass but I feel like I did it wrong
`function findLongestWord(str) {
strArray = str.match(/\w*[a-z]/g);
strArray.sort(function(a,b) {
return b.length - a.length;
});
return strArray[0].length;
}

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

DTing
@dting
Aug 18 2015 23:20
@ayondot does the challenge pass when you press run?
Isaac Calvo
@Icalvo1
Aug 18 2015 23:20
obvious problems if 2 or more words and === to eachother and both the longes
*are
Ayo
@ayondot
Aug 18 2015 23:20
@dting no it doesn't. It just say "console not defined"
Isaac Calvo
@Icalvo1
Aug 18 2015 23:21
@ayondot it says that even when you type it in mdn's console right after your text
DTing
@dting
Aug 18 2015 23:21
@ayondot hmm strange I would try refreshing the page
Kern Elder
@Kelel1
Aug 18 2015 23:22
whats the update on the fix for the current day streak?
Isaac Calvo
@Icalvo1
Aug 18 2015 23:22
also in challenge above they suggested .split() but i didn't use it was I supposed to?
Ayo
@ayondot
Aug 18 2015 23:23
@dting @Icalvo1 i'lltry another browser
DTing
@dting
Aug 18 2015 23:24
@Icalvo1 that looks fine to me since you are just returning the length of the longest not the word.
@Icalvo1 you could change the way you create the array to something simple like
  return str.split(' ').sort(function(a,b) {return b.length - a.length;})[0].length;
Isaac Calvo
@Icalvo1
Aug 18 2015 23:28
thanks @dting just felt like i cheated the lesson I like the one like create and sort though
CamperBot
@camperbot
Aug 18 2015 23:28
icalvo1 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 323 | @dting | http://www.freecodecamp.com/dting
Isaac Calvo
@Icalvo1
Aug 18 2015 23:28
like -> line*
Isaac
@BenBagBag
Aug 18 2015 23:32
is anyone else having problems where if they try to put console.log($WHATEVER) into a bonfire challenge that doesn't ask for anything to print out, it says "can't find variable console"?
Ryan Malm
@Rybar
Aug 18 2015 23:34
```
Cristián Berríos
@crisberrios
Aug 18 2015 23:34
:satellite: