These are chat archives for FreeCodeCamp/Help

7th
Oct 2015
Herman Fassett
@HermanFassett
Oct 07 2015 00:00
It's easier if you say remove all non letter characters etc
Levyian
@levyian
Oct 07 2015 00:00
@JavascriptFTW try this instead str = str.replace(/\W/g, "")
Herman Fassett
@HermanFassett
Oct 07 2015 00:00
Ooh @MindfulBell still working on steamroller?
Blauelf
@Blauelf
Oct 07 2015 00:00
@JavascriptFTW Better filter anything that is not valuable content (valuable means alphanumeric)
Herman Fassett
@HermanFassett
Oct 07 2015 00:01
@JavascriptFTW try what @levyian but also add a test to remove _ as just \W doesn't work
Joshua Gammage
@MrMagma
Oct 07 2015 00:01
It's working now. Thanks
CamperBot
@camperbot
Oct 07 2015 00:01
if you want to thank someone, put an @ before their name!
Garrett Schultz
@garettschultz
Oct 07 2015 00:03
Need some help beginner javascript
Herman Fassett
@HermanFassett
Oct 07 2015 00:03
@gratschultz2013 ask away
Garrett Schultz
@garettschultz
Oct 07 2015 00:04
Im on Waypoint: Create a JavaScript Slot Machine where do I put slotOne, slotTwo, slotThree within Math.floor(Math.random() * (3 - 1 + 1)) + 1;
mnm135
@mnm135
Oct 07 2015 00:04
http://codepen.io/mnm135/pen/wKdGOK Zipline: Show the local weather. Any ideas why it doesn't work? I looked at other peoples' code and they call the api data in the same way(?). Here it seems that anything after getJSON doesn't work. The key is good for sure, I printed it out and pasted to browser.
Herman Fassett
@HermanFassett
Oct 07 2015 00:06
@gratschultz2013 you need to set slotOne, slotTwo, slotThree each individually equal to the random expression
Garrett Schultz
@garettschultz
Oct 07 2015 00:06
Basically, the challenge is telling me what to do but im having trouble undderstanding how to even do it
Herman Fassett
@HermanFassett
Oct 07 2015 00:07
Have you tried anything yet?
Garrett Schultz
@garettschultz
Oct 07 2015 00:07
ya, this is what i have: slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
Herman Fassett
@HermanFassett
Oct 07 2015 00:08
That looks good. Then you just do that for all the variables
Levyian
@levyian
Oct 07 2015 00:09
@mnm135 it would be best if you use the done/fail methods from the getJSON promise api. That way you can track if something goes wrong and print out the error to console (for dev purposes) in the fail method. See : http://api.jquery.com/jQuery.getJSON/ for info on how to use them
Garrett Schultz
@garettschultz
Oct 07 2015 00:09
its correct but I dont even understand why its done or what the math expression even means. For example why those numbers? Why 3-1+1+1?
Herman Fassett
@HermanFassett
Oct 07 2015 00:09
So, Math.random() alone returns a value from 0 to 1
Katie
@Katie-S
Oct 07 2015 00:10
Hi all, I have a question. When doing for loops, what is the difference/purpose of putting the ++ or -- in the function. What do each do?
Levyian
@levyian
Oct 07 2015 00:10
@mnm135 you would then move you code for the json object to the done method, which only gets called if the request completed properly
Garrett Schultz
@garettschultz
Oct 07 2015 00:10
I feel like im doing what i am supposed to but im not really learning anything from it. I mean over time, how am I going to know when to use that function?
James Smith
@matthew02
Oct 07 2015 00:11
@Katie-S ++ increments the variable (adds one to it) and -- decrements (subtracts one)
Garrett Schultz
@garettschultz
Oct 07 2015 00:11
html, css, and jQuery were a breeze and easy to understand but this javascript stuff just makes me want to look the other way
Blauelf
@Blauelf
Oct 07 2015 00:11
@MindfulBell I do not understand what the steamrolltwo(arr[j+1]) part is doing (deleted it and it works fine), but the problem with your code is that you forgot the var for your counter variable j.
James Smith
@matthew02
Oct 07 2015 00:11
@Katie-S Use ++ to loop forward one step at a time and -- would loop backward one step at a time.
Herman Fassett
@HermanFassett
Oct 07 2015 00:12
@gratschultz2013 it takes practice I guess. You can view the docs for random() function. Basically to get a number from 1-3 they need to use random() (from 0-1) then multiply it by the max - min + 1 (to make the range inclusive) and then add the min
Takes some mathy knowledge
Garrett Schultz
@garettschultz
Oct 07 2015 00:12
@HermanFassett is it normal to be as lost as I am when just starting it?
Katie
@Katie-S
Oct 07 2015 00:13
Like for(var = num; i > 0; i--) / why would minuses be used in factorializing a number then? Like, I know you have to multiply each number under whatever number you're trying to factorialize, but how would going backwards from -- oh, if I was trying to factorialize 10, it would go 10, 9, 8, 7, 6.... is that right?
Herman Fassett
@HermanFassett
Oct 07 2015 00:13
The javascript random function is a little confusing at first. Other languages have more straightforward ways of generating a random variable
mnm135
@mnm135
Oct 07 2015 00:13
@levyian if I use console.log it won't print me message anywhere on codepen? Sould I try to pass message to html?
Katie
@Katie-S
Oct 07 2015 00:14
thanks @matthew02
CamperBot
@camperbot
Oct 07 2015 00:14
katie-s sends brownie points to @matthew02 :sparkles: :thumbsup: :sparkles:
:star: 319 | @matthew02 | http://www.freecodecamp.com/matthew02
James Smith
@matthew02
Oct 07 2015 00:14
@Katie-S Your loop starts at num and then counts backward until it gets to 1.
Katie
@Katie-S
Oct 07 2015 00:14
okay that makes sense
Thank you so so much :)
CamperBot
@camperbot
Oct 07 2015 00:14
if you want to thank someone, put an @ before their name!
Levyian
@levyian
Oct 07 2015 00:14
@mnm135 yeah but you have to open you dev console. on firefox press F12
Herman Fassett
@HermanFassett
Oct 07 2015 00:14
@gratschultz2013 I wrote my first code at 12 in python and it took awhile for basics to sink in but I'm not sure how it is with everyone
Blauelf
@Blauelf
Oct 07 2015 00:15
@Katie-S This code is going down from num to 1, could also be written as for(var i=1; i<=num; i++), as the order of the iterations does not matter here.
Katie
@Katie-S
Oct 07 2015 00:15
Thanks @Blauelf That's how I was trying to write to begin with. Guess either way is acceptable then :)
CamperBot
@camperbot
Oct 07 2015 00:15
katie-s sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 341 | @blauelf | http://www.freecodecamp.com/blauelf
mnm135
@mnm135
Oct 07 2015 00:15
@levyian OK i'll try it
James Smith
@matthew02
Oct 07 2015 00:15
Yep, multiplication is commutative, so you could loop in either direction.
Herman Fassett
@HermanFassett
Oct 07 2015 00:16
Mmm yes the commutative
Garrett Schultz
@garettschultz
Oct 07 2015 00:16
Ive been working with html and css for the last 2 years and had no issues. just recently started learning javascript because it seems thats where all the good jobs are at but jees this stuff is extremely confusing.
Levyian
@levyian
Oct 07 2015 00:17
@mnm135 make sure you're on the console tab as there are a few others and it might not be the default
Herman Fassett
@HermanFassett
Oct 07 2015 00:17
@gratschultz2013 well I'm terrible at css and html design. I find it difficult to make anything look good.
Garrett Schultz
@garettschultz
Oct 07 2015 00:20
If i dont have a grasp on javascript by the end of FCC, ill continue my javascript learning at codeacademy and codeavengers i guess. My employer basically told me if i want a better position, Javascript is a MUST. They use AngularJS, Express.js, and Node.js on a regular basis which is why i am striving so hard to learn it all within the next couple years. Thank you @HermanFassett for the advice and helping me out.
CamperBot
@camperbot
Oct 07 2015 00:20
gratschultz2013 sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 316 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Oct 07 2015 00:21
@gratschultz2013 Yup. I think a lot of FCC is doing the struggling, Read Docs, Search Google, Ask Chat, to learn as much as possible through the camp.
supasheva
@supasheva
Oct 07 2015 00:25
hello
so Iam doing my web portfolio
wanted to move things around with my welcome page
so i did a dive
div
in the main page
i just have a simple img and a welcome
<div class="welcome">
  <h1><font size=20>Welcome</font></h1>
  <img  src="https://upload.wikimedia.org/wikipedia/en/thumb/e/ea/Superman_shield.svg/1280px-Superman_shield.svg.png">

</div>
mnm135
@mnm135
Oct 07 2015 00:28
@levyian I used console.log before and after $.getJSON and everything after getJSON doesnt work
supasheva
@supasheva
Oct 07 2015 00:28
so yeah.. the issue is centering the div. below is the CSS
blast it !
Herman Fassett
@HermanFassett
Oct 07 2015 00:28
Edit your message
supasheva
@supasheva
Oct 07 2015 00:28
welcome{

  text-align: center ;
  display: block;


}
img{
display:block;
height: 20;
max-width: 40%;
margin-left: auto;
margin-right: auto;

}
Herman Fassett
@HermanFassett
Oct 07 2015 00:29
Or whatever :smile_cat:
Garrett Schultz
@garettschultz
Oct 07 2015 00:29
blob
so basically this just means if slot one doesnt equal the same number as slot two and if slot two doesnt equal same number as slot three, than return nothing?
Herman Fassett
@HermanFassett
Oct 07 2015 00:31
Sort of though it's actually if slotOne isn't equal to slotTwo or slotTwo isn't equal to slotThree return nothing
Garrett Schultz
@garettschultz
Oct 07 2015 00:31
so the pipes mean "or"?
Herman Fassett
@HermanFassett
Oct 07 2015 00:32
Yeah, and would be &&
Those are logical operators
Garrett Schultz
@garettschultz
Oct 07 2015 00:33
okay thanks again @HermanFassett
CamperBot
@camperbot
Oct 07 2015 00:33
gratschultz2013 sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:warning: gratschultz2013 already gave hermanfassett points
Garrett Schultz
@garettschultz
Oct 07 2015 00:34
@supasheva try img { 0 auto; }
Levyian
@levyian
Oct 07 2015 00:34
@mnm135 add this to your JSON
  .fail(function(err) {
    console.log( "error", err );
  })
Garrett Schultz
@garettschultz
Oct 07 2015 00:34
sorry, {margin: 0 auto; }
supasheva
@supasheva
Oct 07 2015 00:35
its fine
figured it out
just made
position:relative;
top:100px;
Garrett Schultz
@garettschultz
Oct 07 2015 00:35
plus its gotta be .welcome since its a div class
supasheva
@supasheva
Oct 07 2015 00:36
what happens when it is like this? does that mean that the div is responsive?
Lanie Molinar
@LivingForGod1991
Oct 07 2015 00:37
Hi. Can someone please look at my code and see if there's anything wrong? I'm on Waypoint: Turn an Image into a Link and nothing is happening when I hit submit.
Herman Fassett
@HermanFassett
Oct 07 2015 00:37
@LivingForGod1991 sure post your code
Lanie Molinar
@LivingForGod1991
Oct 07 2015 00:38
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Herman Fassett
@HermanFassett
Oct 07 2015 00:38
@LivingForGod1991 check your a tag. It doesn't close on the first one and there's an unnecessary + sign
mnm135
@mnm135
Oct 07 2015 00:43
@levyian nothing. thanks for help but its too late and got to go :) Ill try tomorrow
CamperBot
@camperbot
Oct 07 2015 00:43
mnm135 sends brownie points to @levyian :sparkles: :thumbsup: :sparkles:
:star: 317 | @levyian | http://www.freecodecamp.com/levyian
Eric Turner
@ericturnerit
Oct 07 2015 00:48
Hi everyone. I'm trying to figure out how to display a joke on my website when a button is clicked. I'm using this site to provide the JSON information: http://api.icndb.com/jokes/random. I'm at a loss as to what to do next. My CodePen so far is: http://codepen.io/EricTurnerIT/pen/gaWwGv.
Herman Fassett
@HermanFassett
Oct 07 2015 00:48
Well read up on how to use getJSON
Eric Turner
@ericturnerit
Oct 07 2015 00:49
Is getJSON the best way to go about this?
Herman Fassett
@HermanFassett
Oct 07 2015 00:49
If the api uses it it's fine
Basic format I think is
$.getJSON(url, function(data) {
    var joke = data.joke;
});
Eric Turner
@ericturnerit
Oct 07 2015 00:50
Cool, I will keep trying on that route, then. Thanks dude.
CamperBot
@camperbot
Oct 07 2015 00:50
if you want to thank someone, put an @ before their name!
Levyian
@levyian
Oct 07 2015 00:51
@mnm135 no problem, if you still need help just ask :) good luck
Tim Bell
@MindfulBell
Oct 07 2015 01:10
@Blauelf it will not work in the FCC test. That is to account for empty arrays (which is one of the tests in FCC).
@Blauelf I just declared j with a var, and the [[[a]]] [[[b]]] test works but now the test with the empty array doesn't work! Try cutting and pasting into the actual bf steamroller.
@HermanFassett And yesh I am
@Blauelf got it. I took out the j+1 and declared j as a var in the for loop. Can you explain to me why that did it?
devinmaking
@devinmaking
Oct 07 2015 01:16
Good evening folks! I am having a strange issue with the bonfire: seek and destroy (http://freecodecamp.com/challenges/bonfire-seek-and-destroy)
Basically my code produces the result needed but those tests come up negative
For reference here is the code:
function destroyer(arr) {
  // Remove all the values
  var finalArr = arr;
  if (arguments.length>1){
    var filterArr = new Array(arguments.length-2);
    for (var i=0;i<arguments.length-2;i++){
      filterArr[i] = arguments[i+1];
    }
    finalArr = finalArr.filter(function(val){
      for (var i=0;i<filterArr.length;i++){
        if (val === filterArr[i]){
          return false;
        }
      }
      return true;
    });
  }
  return finalArr;
}

destroyer(["tree","hamburger",53], "tree", 53, "");
Will Sokolowski
@Sokos6
Oct 07 2015 01:22
Hello, having a terrible time with this... http://www.freecodecamp.com/challenges/bonfire-reverse-a-string ... can someone help me out please?
Chocobowings
@chocobowings
Oct 07 2015 01:22
@Sokos6 I can help you. What are you stuck with ?
devinmaking
@devinmaking
Oct 07 2015 01:23
@Sokos6 what is it you need help with?
Will Sokolowski
@Sokos6
Oct 07 2015 01:23
I've been good for the most part going through each lesson...but now with these exercises I'm just stuck. I probably just need to go back and review, or take a course elsewhere.
but it is giving me errors about howdy and greetings from earth....stuff I don't see anywhere on the screen, or referenced in the instructions
James Smith
@matthew02
Oct 07 2015 01:24
@devinmaking I don't think you are getting all of your arguments. Instead of arguments.length-2, try arguments.length-1.
devinmaking
@devinmaking
Oct 07 2015 01:25
@matthew02 thanks, that worked!
CamperBot
@camperbot
Oct 07 2015 01:25
devinmaking sends brownie points to @matthew02 :sparkles: :thumbsup: :sparkles:
:star: 320 | @matthew02 | http://www.freecodecamp.com/matthew02
James Smith
@matthew02
Oct 07 2015 01:25
Sure thing!
devinmaking
@devinmaking
Oct 07 2015 01:26
@matthew02 i didn't know i had to include the "" parameter too, i suppose i will need to research on whatever test script FCC uses
Chocobowings
@chocobowings
Oct 07 2015 01:26
@Sokos6 Can you post your code here ?
Will Sokolowski
@Sokos6
Oct 07 2015 01:28
Well, all i had was the code at the beginning. I did find this, but i'm a bit lost. Going to go back through and review.
function reverseString(str) {
return str.split('').reverse().join('');
}
reverseString('hello');
James Smith
@matthew02
Oct 07 2015 01:29
@devinmaking Yes, that's just another parameter like any of the others. Because it's an empty string, there's nothing to remove from the original string, but it could have just as easily been "something else" in which case you would have wanted to remove it.
Fausto Ramírez L.
@faustor21
Oct 07 2015 01:29
@Sokos6 it seems fine; this works return str.split("").reverse().join("");
@Sokos6 Basically what it does is that it split the string into an array or character and reverse the array order and then joins it.
James Smith
@matthew02
Oct 07 2015 01:30
It actually seems a little tricky. I'd say that should be changed. I don't think the point is to try and trip people up.
devinmaking
@devinmaking
Oct 07 2015 01:31
@matthew02 gotcha! thanks
CamperBot
@camperbot
Oct 07 2015 01:31
devinmaking sends brownie points to @matthew02 :sparkles: :thumbsup: :sparkles:
:warning: devinmaking already gave matthew02 points
Chocobowings
@chocobowings
Oct 07 2015 01:31
@Sokos6 The code that you just post is pretty much this.
function reverseString(str) {
  str = str.split("");
  str = str.reverse();

  return str.join("");
}

reverseString("hello", "");
@Sokos6 If you don't understand how it is that it works I can explain it for you
James Smith
@matthew02
Oct 07 2015 01:33
@devinmaking You could simplify your loop like this. That might make it a little easier to read and understand.
    for (var i=1;i<arguments.length;i++){
      filterArr[i] = arguments[i];
    }
Will Sokolowski
@Sokos6
Oct 07 2015 01:33
right on. if you could explain it I would appreciate it. A lot of what i'm doing is just repetition and doing exercises and stuff. I understand to an extent...but this is all new to me. I come from 10 years of WordPress.
Fausto Ramírez L.
@faustor21
Oct 07 2015 01:33
@Sokos6 Basically what it does is that it split the string into an array of characters, then reverse the array order and then joins it into a string.
Chocobowings
@chocobowings
Oct 07 2015 01:34
@Sokos6 no problem
str.plit("") will take your string and split it at "" (char by char) returning an array
devinmaking
@devinmaking
Oct 07 2015 01:34
@matthew02 shouldn't it be filterArr[i-1] though?
James Smith
@matthew02
Oct 07 2015 01:35
@devinmaking Nope. You want to skip the first argument and start at the second. With zero-based indexing, that means you start at index 1.
Chocobowings
@chocobowings
Oct 07 2015 01:35
@Sokos6 str.reverse() will take your new array and reverse it.
devinmaking
@devinmaking
Oct 07 2015 01:36
i mean filterArr is the array that contains the values from second index (index = 1) onwards
Will Sokolowski
@Sokos6
Oct 07 2015 01:36
gotcha. I'm going to go back through all this stuff a second time. Any other resources you'd recommend to really get a grasp on this stuff?
Chocobowings
@chocobowings
Oct 07 2015 01:36
@Sokos6 str.join("") will join your array char by char and return a string
James Smith
@matthew02
Oct 07 2015 01:36
@devinmaking Ahh, yes. Sorry... I read it too fast.
devinmaking
@devinmaking
Oct 07 2015 01:36
@Sokos6 i will say the documentation listed on the side of each challenege is not very thorough, but in some cases extremely helpful
where it says "some helpful links"
Chocobowings
@chocobowings
Oct 07 2015 01:37
@Sokos6 I recommend you to click on each suggested link like this one and read through https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join
Joshua Hudson
@jiduto
Oct 07 2015 01:38

Hello, I'm working on Return the Largest Numbers in Array: http://www.freecodecamp.com/challenges/bonfire-return-largest-numbers-in-arrays and I have the answer but I cant figure out why we use "result[n] = largestNumber;" --and why doesn't "result[0] = largestNumber;" work? Isnt result[ ] just an empty array?

Full code:
function largestOfFour(arr) {
var result = [ ];
for (var n = 0; n < arr.length; n++) {
var largestNumber = 0;
for (var sub = 0; sub < arr[n].length; sub++) {
if (arr[n][sub] > largestNumber) {
largestNumber = arr[n][sub];
}
}
result[n] = largestNumber;
}
return result;
}

Will Sokolowski
@Sokos6
Oct 07 2015 01:38
Awesome. I'll start digging in now. Thank you!
CamperBot
@camperbot
Oct 07 2015 01:38
if you want to thank someone, put an @ before their name!
Chocobowings
@chocobowings
Oct 07 2015 01:40
This message was deleted
@jiduto n is the value that it takes from your first for loop
devinmaking
@devinmaking
Oct 07 2015 01:42
@jiduto because every time you go though an iteration of the outer for loop, you need to update the results array
results[0] will keep overwriting the first value
Joshua Hudson
@jiduto
Oct 07 2015 01:48
Ok I understand where n comes from. I dont see where iterations are modifying the results array though.
Chocobowings
@chocobowings
Oct 07 2015 01:52
@jiduto
function largestOfFour(arr) {
var result = [ ];
for (var n = 0; n < arr.length; n++) {
 //creates n and gives n a value of 0 for the first pass
var largestNumber = 0;
for (var sub = 0; sub < arr[n].length; sub++) {
// in the first iteration arr[n] is equal to arr[0]
if (arr[n][sub] > largestNumber) {
largestNumber = arr[n][sub];
// so largest number is arr[0][0] during the first iteration
}
}
result[n] = largestNumber;
// result[n] is equal to result[0]  during the first iteration
// result[n] is equal to result[1]  during the second iteration
// result[n] is equal to result[2]  during the third iteration
// and so on
}
return result;
}
@jiduto
Since you have two loops an outer and an inner for loop
the first iteration of the outer loop
for (var n = 0; n < arr.length; n++)
//will assign n a value of 0
@jiduto Your inner loop on its first iteration
for (var sub = 0; sub < arr[n].length; sub++) {
//will assign sub a value of 0
Chocobowings
@chocobowings
Oct 07 2015 01:58
@jiduto
if (arr[n][sub] > largestNumber) {
largestNumber = arr[n][sub];
//  arr[n][sub] is arr[0][0] during the first iteration
mixa97
@mixa97
Oct 07 2015 02:02
hey someone can help me?
Chocobowings
@chocobowings
Oct 07 2015 02:04
@mixa97 What do you need help with ?
mixa97
@mixa97
Oct 07 2015 02:05
with a code
im begining to learn
Chocobowings
@chocobowings
Oct 07 2015 02:05
@mixa97 Ok what exaclty :)
Joshua Hudson
@jiduto
Oct 07 2015 02:05
@chocobowings I'm starting to get it. It wasnt clicking that result[ ] was changing, but now I see how it is. Thanks for your help!
CamperBot
@camperbot
Oct 07 2015 02:05
jiduto sends brownie points to @chocobowings :sparkles: :thumbsup: :sparkles:
:star: 296 | @chocobowings | http://www.freecodecamp.com/chocobowings
Chocobowings
@chocobowings
Oct 07 2015 02:06
@jiduto Np :)
mixa97
@mixa97
Oct 07 2015 02:07
i'm in level 78 html and css, but i don't understan this problem
Chocobowings
@chocobowings
Oct 07 2015 02:08
@mixa97 can you pass me the link to it
Chocobowings
@chocobowings
Oct 07 2015 02:12
@mixa97
Imagine each div as a box. So this problem is asking you to put all your buttons into a big box (div) and each button individually inside a small box (div)
<div class="row">
<div class="col-xs-4">
<button></button>
</div>
</div>
Lanie Molinar
@LivingForGod1991
Oct 07 2015 02:13
@HermanFassett Earlier, you told me there was a tag in my code that didn't close. I fixed the other problems, but I can't find that one. Can you look again and point it out to me?
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Herman Fassett
@HermanFassett
Oct 07 2015 02:14
@LivingForGod1991 could you repaste your code?
Chocobowings
@chocobowings
Oct 07 2015 02:15
@mixa97
So I created a div with the class "row " that is going to contain all your buttons elements and another div with the class "col-xs-4" that will enclose each button individually
DJ
@qualitymanifest
Oct 07 2015 02:16
@LivingForGod1991 you start an img tag inside your a tag. just get rid of <img
Herman Fassett
@HermanFassett
Oct 07 2015 02:17
@LivingForGod1991 <a href="#"<img> should be <a href="#"><img>
DJ
@qualitymanifest
Oct 07 2015 02:17
@HermanFassett err yeah, that
h4r1m4u
@h4r1m4u
Oct 07 2015 02:17
@qualitymanifest the img needs to be wrapped in a link. he just didn't close the opening <a> tag as @HermanFassett says
mixa97
@mixa97
Oct 07 2015 02:18
ok @chocobowings I try it
DJ
@qualitymanifest
Oct 07 2015 02:18
@h4r1m4u yeah i see that now
Chocobowings
@chocobowings
Oct 07 2015 02:18
@mixa97
<div class="row">   // big container starts//
    <div class="col-xs-4"> //small container start//
  <button class="btn btn-block btn-primary">Like</button>
    </div> //small container ends//
//other buttons here //
  </div>  // big container ends//
mixa97
@mixa97
Oct 07 2015 02:29
I don't undertand xc
Yosafat Ariel
@yoskakomba
Oct 07 2015 02:31
xs means xtra small for mobile grid view
correct me if I am wrong
Ryan C.
@marvroots
Oct 07 2015 02:32
blob
I'm totally lost. Not sure what they are asking me to do
h4r1m4u
@h4r1m4u
Oct 07 2015 02:35
@marvroots they're asking you to declare a javascript variable. which you do for example like so:
var myVariable = 'dog';
there are several examples in the exercise - both in the description on the left and commented out in the code pane
Brian van Vlymen
@arduino731
Oct 07 2015 02:36
@marvroots create the var for "my" to be the storage
@marvroots all you need is to remove the comments and they are looking for the agrument is myName
Ryan C.
@marvroots
Oct 07 2015 02:37
@h4r1m4u I thought I created a var myName = Bob Elliott
h4r1m4u
@h4r1m4u
Oct 07 2015 02:38
@marvroots a string variable needs to be put in between quotation marks:
var myName = "Bob Elliott"
Ryan C.
@marvroots
Oct 07 2015 02:39
I did. Sorry, you can see that in my screen shot.
h4r1m4u
@h4r1m4u
Oct 07 2015 02:39

if it's a number, you could do:

var myNumber = 100;

but a string needs to be wrapped in quotation marks

Chocobowings
@chocobowings
Oct 07 2015 02:39
@marvroots you are missing the double quotes ""
h4r1m4u
@h4r1m4u
Oct 07 2015 02:39
oh, i'm sorry. you just need to uncomment it then :)
at the moment you have it commented out, so the code doesn't actually execute
Chocobowings
@chocobowings
Oct 07 2015 02:39
@h4r1m4u second that
@marvroots Just remove the double //
Frank Cooke
@platypusrex
Oct 07 2015 02:40
Looking to verify a possible bug in the search and replace bonfire...anyone care to help confirm?
h4r1m4u
@h4r1m4u
Oct 07 2015 02:41
@platypusrex sure. got code?
Frank Cooke
@platypusrex
Oct 07 2015 02:41
yeah...how is every including those fancy screenshots?
Ryan C.
@marvroots
Oct 07 2015 02:41
@h4r1m4u Thanks. So simple. I hope I can do this.
CamperBot
@camperbot
Oct 07 2015 02:41
marvroots sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 193 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Chocobowings
@chocobowings
Oct 07 2015 02:41
This message was deleted
mixa97
@mixa97
Oct 07 2015 02:41
blob
blob
blob
Frank Cooke
@platypusrex
Oct 07 2015 02:42
otherwise I'll just copy/paste
h4r1m4u
@h4r1m4u
Oct 07 2015 02:42
@marvroots i'm sure you can. just hang in there and keep chipping at it. it'll all make sense. the learning curve can be steep.
Ryan C.
@marvroots
Oct 07 2015 02:42
@chocobowings Thanks for your help too.
CamperBot
@camperbot
Oct 07 2015 02:42
marvroots sends brownie points to @chocobowings :sparkles: :thumbsup: :sparkles:
:star: 297 | @chocobowings | http://www.freecodecamp.com/chocobowings
Chocobowings
@chocobowings
Oct 07 2015 02:42
@mixa97
each of your buttons needs a div
<div >
<button></button>
</div>
Frank Cooke
@platypusrex
Oct 07 2015 02:43
function myReplace(str, before, after) {
return str.replace(before, function(){
if(before[0] === before[0].toUpperCase()){
return after.charAt(0).toUpperCase() + after.slice(1);
}else {
return after;
}
});
}
returns the correct answer for each check in the bonfire...yet fails them all
h4r1m4u
@h4r1m4u
Oct 07 2015 02:44
@mixa97 what @chocobowings says. now you have 3 buttons inside the same 1 div. you need 3 x 1 button inside 3 different divs
Chocobowings
@chocobowings
Oct 07 2015 02:44
@mixa97 You have the div with class row for all your buttons and now you need a div per button with class col-xs-4
Frank Cooke
@platypusrex
Oct 07 2015 02:44
how are you guys getting the screen shots?
Chocobowings
@chocobowings
Oct 07 2015 02:45
wiki format
CamperBot
@camperbot
Oct 07 2015 02:45

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Chocobowings
@chocobowings
Oct 07 2015 02:46
@platypusrex It is explained above
Joshua Hudson
@jiduto
Oct 07 2015 02:46
Is String.prototype.length the same as String.length ?
Herman Fassett
@HermanFassett
Oct 07 2015 02:47
All String instances inherit from String.prototype
Frank Cooke
@platypusrex
Oct 07 2015 02:48
thanks @chocobowings
CamperBot
@camperbot
Oct 07 2015 02:48
platypusrex sends brownie points to @chocobowings :sparkles: :thumbsup: :sparkles:
:star: 298 | @chocobowings | http://www.freecodecamp.com/chocobowings
Charlotte
@Charzoe
Oct 07 2015 02:49

Can anyone tell me why my social media icons display as dots instead of images?

<p data-height="268" data-theme-id="0" data-slug-hash="GpmBrJ" data-default-tab="result" data-user="Charzoe" class='codepen'>See the Pen <a href='http://codepen.io/Charzoe/pen/GpmBrJ/'>Default</a> by Charlotte (<a href='http://codepen.io/Charzoe'>@Charzoe</a>) on <a href='http://codepen.io'>CodePen</a>.</p>

<script async src="//assets.codepen.io/assets/embed/ei.js"></script>

Frank Cooke
@platypusrex
Oct 07 2015 02:49
function myReplace(str, before, after) {  
  return str.replace(before, function(){
   if(before[0] === before[0].toUpperCase()){
     return after.charAt(0).toUpperCase() + after.slice(1);
   }else {
     return after;
   }
 });
}
Charlotte
@Charzoe
Oct 07 2015 02:49
<p data-height="268" data-theme-id="0" data-slug-hash="GpmBrJ" data-default-tab="result" data-user="Charzoe" class='codepen'>See the Pen <a href='http://codepen.io/Charzoe/pen/GpmBrJ/'>Default</a> by Charlotte (<a href='http://codepen.io/Charzoe'>@Charzoe</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
<script async src="//assets.codepen.io/assets/embed/ei.js"></script>
Huh, guess the embedding isn't working...
Frank Cooke
@platypusrex
Oct 07 2015 02:50
anyone see anything wrong with my code here...it returns the correct answer, but fails every test in the bonfire
h4r1m4u
@h4r1m4u
Oct 07 2015 02:50
@platypusrex i'm not sure but i think that might be a bug. in the code pane they ask you to work on the function myReplace, but in the tests they call the function replace. if you change your code to the following, it'll work:
function replace(str, before, after) {  
  return str.replace(before, function(){
   if(before[0] === before[0].toUpperCase()){
     return after.charAt(0).toUpperCase() + after.slice(1);
   }else {
     return after;
   }
 });
}
Charlotte
@Charzoe
Oct 07 2015 02:50
http://codepen.io/Charzoe/pen/GpmBrJ Anyway here's the link
mixa97
@mixa97
Oct 07 2015 02:51
blob
Joshua Hudson
@jiduto
Oct 07 2015 02:52
@mixa97 after each button you need to close it's div tag with </div>
Frank Cooke
@platypusrex
Oct 07 2015 02:52
thanks for that @h4r1m4u...I guess I should at least report the bug
CamperBot
@camperbot
Oct 07 2015 02:52
platypusrex sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 194 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 07 2015 02:53
@platypusrex you're welcome. yeah, looks like a bug to me. or at best it's confusing. might be worth for FCC to have a second look at the tests they run on the code in that exercise
mixa97
@mixa97
Oct 07 2015 02:56
where ?
Jon Martin
@Begbie2006
Oct 07 2015 02:56

Any help on this? <style>
.red-text {
color: red;
font-size: 16px;
}

p { font-size: 16px; }

</style>

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

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

<p class="red-text";>kitty ipsum text: Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

Trying to get all p fonts to be 16 px
Herman Fassett
@HermanFassett
Oct 07 2015 02:57
@platypusrex I think that bug's already been reported
You don't need semicolon's after the classes @Begbie2006
Jonathan Lee Slew
@jlslew
Oct 07 2015 02:57
@Charzoe click on settings > css > preprocessor > less
Herman Fassett
@HermanFassett
Oct 07 2015 02:58

@Begbie2006 for instance

<p class="red-text";>

Should be

<p class="red-text">

Not sure if that's the problem but it is a problem

Charlotte
@Charzoe
Oct 07 2015 02:59
Changed from none to less, did nothing
Jonathan Lee Slew
@jlslew
Oct 07 2015 03:00
@Charzoe you missing a } at the end of your less file
Jon Martin
@Begbie2006
Oct 07 2015 03:00
Ok. Tried that still have same issue. I wonder if up in the <style> and <style/> correct
mixa97
@mixa97
Oct 07 2015 03:00
blob
h4r1m4u
@h4r1m4u
Oct 07 2015 03:01

@Charzoe there's a number of issues:

1) the dots are displayed because you're using <ul> to wrap the icons list. ul stands for unordered (bulleted) list. this is where the bullets are from. to fix, add 'list-style: none;' to the ul CSS properties
2) in the definition of iconname you have 'opacity: 0' (this makes the content completely transparent; remove it or change it to 'opacity: 1').
3) in the definition of icon
name you have 'color: #fff'. this makes the icon text white and since your side has white background, you won't be able to see it. change it to a different color

@Begbie2006 other than what @jlslew says, it looks fine to me. can you paste the exact code you have now?
@mixa97 your div tags are not closed. for each <div> you have in the code, you need to have a corresponding </div>
Joshua Hudson
@jiduto
Oct 07 2015 03:04
@mixa97 after the close of each button, you also need to close the div that it is in: </button></div>
@mixa97 that pink highlighted part can be deleted - its on there twice in a row
Herman Fassett
@HermanFassett
Oct 07 2015 03:07
@Begbie2006 it all looks correct to me. Are you still having problems?
Joshua Hudson
@jiduto
Oct 07 2015 03:07
@mixa97
'''
<div class="col-xs-4"><button class="btn btn-block btn-primary">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>
'''
CamperBot
@camperbot
Oct 07 2015 03:07
:bulb: to format code use backticks! ``` more info
Herman Fassett
@HermanFassett
Oct 07 2015 03:08
Backtick is above your tab key and to the left of the 1 key
:)
Joshua Hudson
@jiduto
Oct 07 2015 03:09
yea i figured it out lol, thanks
CamperBot
@camperbot
Oct 07 2015 03:09
if you want to thank someone, put an @ before their name!
Joshua Hudson
@jiduto
Oct 07 2015 03:09
still learning
mixa97
@mixa97
Oct 07 2015 03:10
blob
h4r1m4u
@h4r1m4u
Oct 07 2015 03:11
@mixa97 you closed the <div>s but the <button>s are now outside it. you need to put them inside the div
mixa97
@mixa97
Oct 07 2015 03:12
oh well thaks
CamperBot
@camperbot
Oct 07 2015 03:12
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Oct 07 2015 03:12
@jiduto already showed you how above
Joshua Hudson
@jiduto
Oct 07 2015 03:13
@mixa97 you need to wrap the div around each button:
  <div class="row">
      <div class="col-xs-4"><button class="btn btn-block btn-primary">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>
mixa97
@mixa97
Oct 07 2015 03:13
tanks @jiduto @h4r1m4u
CamperBot
@camperbot
Oct 07 2015 03:13
mixa97 sends brownie points to @jiduto and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 216 | @jiduto | http://www.freecodecamp.com/jiduto
:star: 195 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 07 2015 03:13
:sparkles:
mixa97
@mixa97
Oct 07 2015 03:13
thanks*
CamperBot
@camperbot
Oct 07 2015 03:13
if you want to thank someone, put an @ before their name!
EngineeredEdge
@EngineeredEdge
Oct 07 2015 03:20
anyone need some help?
Jason Carpenter
@Jason9199
Oct 07 2015 03:54
Anyone available to help with the bootstrap section? I'm stuck on a lesson that all appears to be right, but it won't take it.
h4r1m4u
@h4r1m4u
Oct 07 2015 03:55
@Jason9199 what do you need?
Jason Carpenter
@Jason9199
Oct 07 2015 03:57
Hi @h4r1m4u thank you for your response. I'm trying to do this section. Do you remember it? '''<div class="row">
<div class="col-xs-4"><label><input type="checkbox" name="personality"> Loving</label></div>
<div class="col-xs-4"><label><input type="checkbox" name="personality"> Lazy</label></div>
<div class="col-xs-4"><label><input type="checkbox" name="personality"> Crazy</label></div>
</div>'''
whoops my markdown didn't work
h4r1m4u
@h4r1m4u
Oct 07 2015 03:58
could you remind me which waypoint it is, so that i can open it in my browser?
Jason Carpenter
@Jason9199
Oct 07 2015 03:58
<div class="row">
    <div class="col-xs-4"><label><input type="checkbox" name="personality"> Loving</label></div>
    <div class="col-xs-4"><label><input type="checkbox" name="personality"> Lazy</label></div>
    <div class="col-xs-4"><label><input type="checkbox" name="personality"> Crazy</label></div>
      </div>
Waypoint: Responsively Style Checkboxes
h4r1m4u
@h4r1m4u
Oct 07 2015 03:59
got it. what's the issue?
Jason Carpenter
@Jason9199
Oct 07 2015 03:59
the code I've pasted in should be correct, but it's not taking it
Nest all of your checkboxes inside one div with the class row.
Nest each of your checkboxes inside its own div with the class col-xs-4.
those both still have red X's
h4r1m4u
@h4r1m4u
Oct 07 2015 04:00
that's strange. it looks correct to me.
give me a second to have a look at it
it works for me. if i paste in your code, i pass the exercise
Jason Carpenter
@Jason9199
Oct 07 2015 04:02
Maybe it's a browser bug. I'm going to try to copy all the code and refresh the browser then paste it in.
Weird, I didn't even have to paste it in. When I refreshed the page it remembered what I had typed in and let me pass.
h4r1m4u
@h4r1m4u
Oct 07 2015 04:03
could you paste the entire code here? or perhaps in a PM? i can then have a look to see if you may have issues somewhere else
Jason Carpenter
@Jason9199
Oct 07 2015 04:03
Strange bug, thank you for checking though!
CamperBot
@camperbot
Oct 07 2015 04:03
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Oct 07 2015 04:03
lol ok :) great :)
Jason Carpenter
@Jason9199
Oct 07 2015 04:03
Thanks @h4r1m4u !
CamperBot
@camperbot
Oct 07 2015 04:03
jason9199 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 197 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 07 2015 04:03
no probs
Saad Mehmood
@saadmehmood233
Oct 07 2015 04:15
bf exact change
CamperBot
@camperbot
Oct 07 2015 04:15

:fire:Bonfire: Exact Change :link:

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

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

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

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

more info:  bf details | bf links | hint

Saad Mehmood
@saadmehmood233
Oct 07 2015 04:15
hint
CamperBot
@camperbot
Oct 07 2015 04:15
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
vere perrot
@perrot
Oct 07 2015 04:37
Hi
I can't start mongodb by command "mongod --port 27017 --dbpath=./data --nojournal".
What's the problem?
Here is the output:
2015-10-07T04:32:23.761+0000 [initandlisten] MongoDB starting : pid=1220 port=27017 dbpath=./data 64-bit host=perrot-learnyoumongo-1964488
2015-10-07T04:32:23.761+0000 [initandlisten] db version v2.6.9
2015-10-07T04:32:23.761+0000 [initandlisten] git version: df313bc75aa94d192330cb92756fc486ea604e64
2015-10-07T04:32:23.761+0000 [initandlisten] build info: Linux build20.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2015-10-07T04:32:23.761+0000 [initandlisten] allocator: tcmalloc
2015-10-07T04:32:23.761+0000 [initandlisten] options: { net: { port: 27017 }, storage: { dbPath: "./data", journal: { enabled: false } } }
************** 
Unclean shutdown detected.
Please visit http://dochub.mongodb.org/core/repair for recovery instructions.
*************
2015-10-07T04:32:23.761+0000 [initandlisten] exception in initAndListen: 12596 old lock file, terminating
2015-10-07T04:32:23.761+0000 [initandlisten] dbexit: 
2015-10-07T04:32:23.761+0000 [initandlisten] shutdown: going to close listening sockets...
2015-10-07T04:32:23.761+0000 [initandlisten] shutdown: going to flush diaglog...
2015-10-07T04:32:23.761+0000 [initandlisten] shutdown: going to close sockets...
2015-10-07T04:32:23.761+0000 [initandlisten] shutdown: waiting for fs preallocator...
2015-10-07T04:32:23.761+0000 [initandlisten] shutdown: closing all files...
2015-10-07T04:32:23.761+0000 [initandlisten] closeAllFiles() finished
2015-10-07T04:32:23.762+0000 [initandlisten] dbexit: really exiting now
Ling Li
@ling18
Oct 07 2015 04:38
hello, can anyone help me with the "Waypoint: Use Conditional Logic with If and Else Statements" section?
if flip === 0 {
return heads;
}
else {
return tails;
}
i am kinda stuck and couldn't figure out...thanks!
CamperBot
@camperbot
Oct 07 2015 04:39
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Oct 07 2015 04:40
@ling18 just wrap the if condition in brackets, like so:
if (flip === 0) {
  ...
} else {
 ...
}
Ling Li
@ling18
Oct 07 2015 04:42
@h4r1m4u thanks a lot for the quick response! but it is still not working even i put in like this
CamperBot
@camperbot
Oct 07 2015 04:42
ling18 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 200 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Ling Li
@ling18
Oct 07 2015 04:43
if (flip === 0) {
return heads;
} else {
return tails;
}
h4r1m4u
@h4r1m4u
Oct 07 2015 04:43
oh, i see

here's the issue: when you write

return heads;

it means to return variable called heads

if you want to return a string, you need to put in quoation marks:
return "heads";
Ling Li
@ling18
Oct 07 2015 04:45
@h4r1m4u oh yeahhh...got it! thank you so much!!
CamperBot
@camperbot
Oct 07 2015 04:45
ling18 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: ling18 already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 07 2015 04:45
:clap:
navicyclical
@navicyclical
Oct 07 2015 05:02

I'm working on the longest word in a string bonfire, and while this passes some of the tests, am I getting my for loop wrong?

```

function findLongestWord(str) {
  var stringOfWords = str.split(" ");
  for(var i=0; i<stringOfWords.length; i++){
    return stringOfWords[i].length;
  }
  return str.length;
}
JensGryspeert
@JensGryspeert
Oct 07 2015 05:04
Pur the stringofwords.length in a variable and do a check if your current length is higher then your highest length you had. Do this in the loop. If so returns the highest stringlength var
Dayne Wright
@daynewright
Oct 07 2015 05:06
@navicyclical which tests is it failing?
navicyclical
@navicyclical
Oct 07 2015 05:08
@Daynewr 2,3,5,6
@JensGryspeert I'm getting closer
I changed the return stringOfWords[i].length to console.log (stringOfWords[i].length) and I'm getting the letter count of each word in the array
so I'm doing something right
Dayne Wright
@daynewright
Oct 07 2015 05:09
@navicyclical You are on the right track…Your current loop is ending on the first run because of your return. And you aren’t comparing anything…You are just saying “Do this for loop and then return the length of the first word”.
navicyclical
@navicyclical
Oct 07 2015 05:10
so I'm tempted to add a second loop
JensGryspeert
@JensGryspeert
Oct 07 2015 05:10
No
Dayne Wright
@daynewright
Oct 07 2015 05:11
@navicyclical Maybe not a another loop…how else could you check?
or compare
navicyclical
@navicyclical
Oct 07 2015 05:11
I could do a if/else
JensGryspeert
@JensGryspeert
Oct 07 2015 05:11
you need to check if your current length is higher then your highest number at that time if so put it in that var of highestnumber
Dayne Wright
@daynewright
Oct 07 2015 05:13
@navicyclical…Yeah..I think that is the way to go...You need to nest your return to happen IF it is the longest word.
DTing
@dting
Oct 07 2015 05:15
You wouldnt want to return until after you've seen every element
Dayne Wright
@daynewright
Oct 07 2015 05:15
Well..actually you won’t need to return from it either…just assign the longest word to something.
DTing
@dting
Oct 07 2015 05:16
you can create a temporary variable to store the lenth of longest word you've seen so far. as you iterate over the words compare the current max length you've seen to the element you are on in your iteration. if the length of the current element is greater than that of the temporary variable then set the temporary variable to the current length. after you have iterated your entire array return that temporary variable
navicyclical
@navicyclical
Oct 07 2015 05:18
@dting I was thinking of that
DTing
@dting
Oct 07 2015 05:18
returning inside a function will exit from that function with the return value. since your return statement is not in a conditional the function just returns the length of the first word in "stringOfWords", (misnomer, probably arrayOfWords)
navicyclical
@navicyclical
Oct 07 2015 05:18
var longestWord=stringOfWords[i]>something
DTing
@dting
Oct 07 2015 05:19
comparisions return a boolean
you can use an if statement or Math.max
Dayne Wright
@daynewright
Oct 07 2015 05:20
So you could use the comparison you have to determine if you should assign it to your temporary var
if(yourComparison) { temp = newlongestword.length }
pranav93y
@pranav93y
Oct 07 2015 05:23
can anyone help me call the lobster font from google? It just says I need to copy a link in my code editor, which I tried, and is not working.
navicyclical
@navicyclical
Oct 07 2015 05:24
I'm moving somewhere else, I'll be back in an hour.
Dayne Wright
@daynewright
Oct 07 2015 05:25
@pranav93y this should get it loaded: <link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css’>
pranav93y
@pranav93y
Oct 07 2015 05:27
yeah, I got it. It was supposed to be for my h2 element, I forgot to add the 2. Stupid mistake. Thank you very much.
CamperBot
@camperbot
Oct 07 2015 05:27
if you want to thank someone, put an @ before their name!
pranav93y
@pranav93y
Oct 07 2015 05:27
Thank you @Daynewr
CamperBot
@camperbot
Oct 07 2015 05:27
pranav93y sends brownie points to @daynewr :sparkles: :thumbsup: :sparkles:
:star: 280 | @daynewr | http://www.freecodecamp.com/daynewr
Dayne Wright
@daynewright
Oct 07 2015 05:28
NP @pranav93y
Frank Cooke
@platypusrex
Oct 07 2015 05:50
hint bonfire pig latin
CamperBot
@camperbot
Oct 07 2015 05:50
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Frank Cooke
@platypusrex
Oct 07 2015 05:54
hint Bonfire: Pig Latin
CamperBot
@camperbot
Oct 07 2015 05:54
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Nick
@njvaldes
Oct 07 2015 06:43
good evening all
Blauelf
@Blauelf
Oct 07 2015 06:51
Good morning.
Chris
@ChrisG85
Oct 07 2015 06:56
hey everyone
pwdd
@pwdd
Oct 07 2015 06:57

Hi! Can anyone please help with the with the 'reset' button on my zipline: pomodoro clock? What I have right now it this:

var timer = function() {
    var min = $('#minutes').text();
    var sec = $('#seconds').text();
    sec -= 1;
    if (min < 0) {
      return clearInterval(timer);
    }
    min = min < 10 ? "0" + min : min;

    if (sec < 0 && min != 0) {
      min -= 1;
      sec = 59;
    }
    sec = sec < 10 ? "0" + sec : sec;
    $('#minutes').text(min);
    $('#seconds').text(sec);

    if (min == 0 && sec == 0) {
      clearInterval(timer);
    };
  };

  $('#play').click(function() {
    setInterval(timer, 1000);
  });

  $('#reset').click(function() {
    clearInterval(timer);
  });

'play' works fine, but 'reset' doesnt work and I dont know why.

DTing
@dting
Oct 07 2015 06:59
timer isnt the intervalCallback
the clearInterval takes the object that is returned from calling setInterval
pwdd
@pwdd
Oct 07 2015 07:01
@dting, I don't understand that. which would be this object?
DTing
@dting
Oct 07 2015 07:01
  var runningTimer;
  var timerFunction = function() {
    var min = $('#minutes').text();
    var sec = $('#seconds').text();
    sec -= 1;
    if (min < 0) {
      return clearInterval(runningTimer);
    }
    min = min < 10 ? "0" + min : min;

    if (sec < 0 && min != 0) {
      min -= 1;
      sec = 59;
    }
    sec = sec < 10 ? "0" + sec : sec;
    $('#minutes').text(min);
    $('#seconds').text(sec);

    if (min == 0 && sec == 0) {
      clearInterval(runningTimer);
    };
  };

  $('#play').click(function() {
   runningTimer = setInterval(timerFunction, 1000);
  });

  $('#reset').click(function() {
    clearInterval(runningTimer);
  });
You can do something like this
pwdd
@pwdd
Oct 07 2015 07:04
@dting. OK. I think I get it. runningTimer would kinda 'hold' the setInverval so I can call clearInterval on it. Is it?
anyway, it is working now. I was having a hard time with it since yesterday! Thanks for that, @dtng
CamperBot
@camperbot
Oct 07 2015 07:07
pwdd sends brownie points to @dtng :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for dtng
pwdd
@pwdd
Oct 07 2015 07:07
Oops. Thanks for that, @dting
CamperBot
@camperbot
Oct 07 2015 07:07
pwdd sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1328 | @dting | http://www.freecodecamp.com/dting
Nathan
@Nathandim
Oct 07 2015 07:08
I need to understand something: In the bonfire seek and destroy the following code works
function destroyer(arr) {
  // Remove all the values

  for (var i = 1; i < arguments.length; i++)
    {
      var lookFor = arguments[i];
      arr = arr.filter(function(val){
        return val !== lookFor;
      });
    }
  return arr;
}

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

but if I do from within the filter

return val !== arguments[i];

It doesn’t.

DTing
@dting
Oct 07 2015 07:09
the callback for the filter function has its own arguments object
Nathan
@Nathandim
Oct 07 2015 07:09
facepalm
silly me
thanks @dting
CamperBot
@camperbot
Oct 07 2015 07:09
nathandim sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1329 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Oct 07 2015 07:09
if you dont make another variable lookFor outside the callback function the arguments object inside shadows the destroyer's arguments object
np
Nathan
@Nathandim
Oct 07 2015 07:09
yeah it just occured to me
I need more coffee :D
Charlotte
@Charzoe
Oct 07 2015 07:14

http://codepen.io/Charzoe/pen/GpmBrJ

Any idea why I can't get the icons to center over the title?

Avishay
@avishayshushan
Oct 07 2015 07:24
hey @Charzoe
try add this to your css
.social-icons{
    position: absolute;
  left: 50%;
  margin-left: -100px;
}
navicyclical
@navicyclical
Oct 07 2015 07:32
I think I'm getting closer.
function findLongestWord(str) {
  var stringOfWords = str.split(" ");
  var numberOfWords = stringOfWords.length;
  for(var i=0; i<numberOfWords; i++){
    var maxNumber = Math.max(stringOfWords[i])
    if maxNumber > (stringOfWords[i].length){
      return maxNumber;
      }
  }
  return str.length;
}

findLongestWord("The quick brown fox jumped over the lazy dog");
Tejas Dhawade
@Slyrak-45
Oct 07 2015 07:39
This message was deleted
Avishay
@avishayshushan
Oct 07 2015 07:47
@navicyclical if you need to return the maximum length then you should initial it before the loop .
inside the loop you need to change it every time a word length is bigger the the current maximum.
consider using split again for getting each word length (use split('')) no space.
delete the replace str.length with maximum
and don't use the return inside the loop
you should go through the entire loop
Ankit Panwar
@coderNoob
Oct 07 2015 07:50
@dting I do not understand this line
min = min < 10 ? "0" + min : min;
I get that it is an "if" statement but what exactly are we checking using this line?
Avishay
@avishayshushan
Oct 07 2015 07:51
@coderNoob if min < 10 then we return "0" + min
else we return min
Ankit Panwar
@coderNoob
Oct 07 2015 07:52
@avishayshushan Why are we checking if it is less than 10? That's what I wanna know.
Avishay
@avishayshushan
Oct 07 2015 07:53
@coderNoob oh i didn't read the previous data
i guess it is a clock?
Ankit Panwar
@coderNoob
Oct 07 2015 07:53
@avishayshushan It's from the pomodoro clock zipline and I see a lot of people using this line and i got no idea why.
Avishay
@avishayshushan
Oct 07 2015 07:54
cause you do not want to display a single digit with nothing before
design consecrations
Ankit Panwar
@coderNoob
Oct 07 2015 07:54
@avishayshushan Got it! Thanks.
CamperBot
@camperbot
Oct 07 2015 07:54
codernoob sends brownie points to @avishayshushan :sparkles: :thumbsup: :sparkles:
:star: 265 | @avishayshushan | http://www.freecodecamp.com/avishayshushan
Avishay
@avishayshushan
Oct 07 2015 07:55
np
does any body know if i need to create the all permutations in No repeats please challenge?
bf No repeats please
CamperBot
@camperbot
Oct 07 2015 07:57

:fire:Bonfire: No repeats please :link:

function permAlone(str) {
  return str;
}

permAlone('aab');

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

more info:  bf details | bf links | hint

Vibol
@tvcam
Oct 07 2015 07:57
@navicyclical
function findLongestWord(str) {
  words = str.split(" ");
  lengths = [];

  for(var i=0; i<words.length; i++){
    lengths[i] = words[i].length;
  }

  maxLength = Math.max.apply(Math, lengths);
  return words[lengths.indexOf(maxLength)];
}

findLongestWord("The quick brown fox jumped over the lazy dog daDadDS");
Jason Yang
@zjasonyang
Oct 07 2015 09:32

Bonfire: Seek and Destroy
```function destroyer(arr) {
// Remove all the values

function deleteArgs(value,index,array){
console.log(array[index]);
console.log(arguments[0]);
// console.log("counts:"+counts++);
if(array[index] == arguments[]){
console.log("false");
return false;
}
else return true;

}
//console.log(arguments[2]+"-");
var result = arr.filter(deleteArgs);
//console.log(result);
return result;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3, "");
```
need some help with the arguments, [title] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments

CamperBot
@camperbot
Oct 07 2015 09:32
Sorry, can't find a bonfire called seek and destroy function destroyerarr remove all the values function deleteargsvalueindexarray consolelogarrayindex consolelogarguments0 consolelogcountscounts ifarrayindex arguments consolelogfalse return false else return true consolelogarguments2- var result arrfilterdeleteargs consolelogresult return resultdestroyer1 2 3 1 2 3 2 3 need some help with the arguments title httpsdevelopermozillaorgen-usdocswebjavascriptreferencefunctionsarguments . [ Check the map? ]
Oleg Avgustinov
@oleg-am
Oct 07 2015 09:36
Bonfire: Map the Debris
CamperBot
@camperbot
Oct 07 2015 09:36
Sorry, can't find a bonfire called map the debris please tell the formula. [ Check the map? ]
Oleg Avgustinov
@oleg-am
Oct 07 2015 09:37
Bonfire: Map the Debris
CamperBot
@camperbot
Oct 07 2015 09:37

:fire:Bonfire: Map the Debris :link:

function orbitalPeriod(arr) {
  var GM = 398600.4418;
  var earthRadius = 6367.4447;
  return arr;
}

orbitalPeriod([{name : "sputnik", avgAlt : 35873.5553}]);

Return a new array that transforms the element's average altitude into their orbital periods.

more info:  bf details | bf links | hint

Oleg Avgustinov
@oleg-am
Oct 07 2015 09:37
who knows the formula, help please
bf details
CamperBot
@camperbot
Oct 07 2015 09:38

:fire:Bonfire: Map the Debris :link:

function orbitalPeriod(arr) {
  var GM = 398600.4418;
  var earthRadius = 6367.4447;
  return arr;
}

orbitalPeriod([{name : "sputnik", avgAlt : 35873.5553}]);
Return a new array that transforms the element's average altitude into their orbital periods.
The array will contain objects in the format <code>{name: 'name', avgAlt: avgAlt}</code>.
You can read about orbital periods <a href="http://en.wikipedia.org/wiki/Orbital_period" target='_blank'>on wikipedia</a>.
The values should be rounded to the nearest whole number. The body being orbited is Earth.
The radius of the earth is 6367.4447 kilometers, and the GM value of earth is 398600.4418
Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>RSAP</a> if you get stuck. Try to pair program. Write your own code.
links:
Oleg Avgustinov
@oleg-am
Oct 07 2015 09:38
bf links
CamperBot
@camperbot
Oct 07 2015 09:38
links:
Oleg Avgustinov
@oleg-am
Oct 07 2015 09:38
hint
CamperBot
@camperbot
Oct 07 2015 09:38
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
vere perrot
@perrot
Oct 07 2015 11:05
bonfire No repeats please
CamperBot
@camperbot
Oct 07 2015 11:05

find no repeats please

:zero: bonfire no repeats please

vere perrot
@perrot
Oct 07 2015 11:06
bonfire No repeats please
CamperBot
@camperbot
Oct 07 2015 11:06

:fire:Bonfire: No repeats please :link:

function permAlone(str) {
  return str;
}

permAlone('aab');

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

more info:  bf details | bf links | hint

vere perrot
@perrot
Oct 07 2015 11:21
hint Wikipedia Viewer
CamperBot
@camperbot
Oct 07 2015 11:21
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
vere perrot
@perrot
Oct 07 2015 11:21
find Wikipedia Viewer
CamperBot
@camperbot
Oct 07 2015 11:21
find wikipedia viewer
nothing found
vere perrot
@perrot
Oct 07 2015 11:22
find Zipline: Build a Wikipedia Viewer
CamperBot
@camperbot
Oct 07 2015 11:22
find zipline build a wikipedia viewer
nothing found
vere perrot
@perrot
Oct 07 2015 11:22
wiki Zipline: Build a Wikipedia Viewer
CamperBot
@camperbot
Oct 07 2015 11:22
no wiki entry for: zipline build a wikipedia viewer
:pencil: click here to create one now!after creating your page type update to reload it here
Michael Bomholt
@bomholtm
Oct 07 2015 11:45
does anybody can help me doing a bug report correctly
its not about a waypoint
its about missing progress
supasheva
@supasheva
Oct 07 2015 11:48
hello
trying to do the weather app
for my location
Chris Webb
@chrisjwebb1978
Oct 07 2015 11:49
Hi all...anyone suggest a reason for the following...i have completed more content at home, yet at my work computer it freecodecamp suggests i have done less! I log in via my gmail account.
supasheva
@supasheva
Oct 07 2015 11:49
i've googled a bunch
can anyone help?
@chrisjwebb1978 That's odd. do you have more than one gmail accounts?
Chris Webb
@chrisjwebb1978
Oct 07 2015 11:50
@supasheva thanks for the reply...no, just the 1 account
CamperBot
@camperbot
Oct 07 2015 11:50
chrisjwebb1978 sends brownie points to @supasheva :sparkles: :thumbsup: :sparkles:
:star: 192 | @supasheva | http://www.freecodecamp.com/supasheva
Coira Ellison
@Coira
Oct 07 2015 11:51
@supasheva do you have any code?
supasheva
@supasheva
Oct 07 2015 11:52
Honestly I am not sure. The only explanation I can think is that you were doing some challenges whilst not signed in @chrisjwebb1978
@Coira yup i do ```

<div class="container">
<h1>Weather App</h1>


</div>
lol
I haven't found an API at the moment to use
Coira Ellison
@Coira
Oct 07 2015 11:53
@supasheva oh lol. i would suggest then, you look at openweather, and geolocation
and jquery's ajax calls (but you may know about that from the quote app)
that's all i used
supasheva
@supasheva
Oct 07 2015 11:54
hrm. with the quote app i used an array. cripes. thanks though @Coira
CamperBot
@camperbot
Oct 07 2015 11:54
supasheva sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 263 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Oct 07 2015 11:56
ah, well then, you will need either jquery's .ajax() or .get()
supasheva
@supasheva
Oct 07 2015 11:57
lol.. umm... do you know where i could read on that.. I am sorry. i find the resource material a tad confusing @Coira
Coira Ellison
@Coira
Oct 07 2015 12:00
@supasheva
$.ajax({
        url: your API url,
        jsonp: 'jsonp',
        success: function () { ... what to do when the api call is successful ... }
        error: function(data) { ... what to do when api call fails ... }
    });
it'll be something like that
supasheva
@supasheva
Oct 07 2015 12:01
oh ok
Coira Ellison
@Coira
Oct 07 2015 12:02
have a go with getting it working with the example in the openweather doc http://openweathermap.org/current
supasheva
@supasheva
Oct 07 2015 12:28
@Coira still there?
so from what i understand
i can use geolocation to get the appropriate coordinates
but to use openwathermap i have to use json?
i am not familiar with that to be honest
i guess my bad for not using the api in the quote generator
mohamedAli
@MooohamedAli
Oct 07 2015 12:30
function palindrome(str) {
// Good luck
var strLen = str.length;
for(var i = 0; i < strLen; i++){
if (str[i] == str[strLen -1- i]) {
return true;
}
else{
return false;
}
break;
}
}
palindrome("eye");
what is the prblem here !! :(
Coira Ellison
@Coira
Oct 07 2015 12:31
@supasheva yes that's correct, you use geoloc to get the latitude and longtitude, then .ajax call with openweather
which returns a json object (which is really a javascript object), with the weather details
@supasheva look at the example here http://openweathermap.org/current#geo
supasheva
@supasheva
Oct 07 2015 12:33
ok
KieronDowie
@KieronDowie
Oct 07 2015 12:33
Hey, does anyone here have experience with NodeJs? I need to ask a really basic question.
supasheva
@supasheva
Oct 07 2015 12:33
do i need to add ajax to my javascript?
@KieronDowie if it is really basic
sure
KieronDowie
@KieronDowie
Oct 07 2015 12:33
About socket.io
CamperBot
@camperbot
Oct 07 2015 12:33
you need to ask about @someone!
Diana Bacon
@dianabacon
Oct 07 2015 12:34
OK camperbot, what about @someone?
Coira Ellison
@Coira
Oct 07 2015 12:35
@supasheva you'll need to use some sort of way to call the api, .get() or .post() or .ajax()
KieronDowie
@KieronDowie
Oct 07 2015 12:35
I just want to know if, when using socket.emit(), the length of the first argument matters. As in, if it is better to use "chat" than "chat message" or just a number instead of either of them.
In terms of latency
supasheva
@supasheva
Oct 07 2015 12:35
oh ok
Coira Ellison
@Coira
Oct 07 2015 12:35
there are ways of doing it without jquery, but i have no idea about them
christache
@christache
Oct 07 2015 12:36
hello, does anyone know if seek and destroy is an incomplete problem?
KieronDowie
@KieronDowie
Oct 07 2015 12:36
Camperbot is really rude lately, always butting in like that. :P
christache
@christache
Oct 07 2015 12:37
i mean all i get is an array, but there is no way i can compare the values from the array to the arguments following it since the arguments aren't declared
Coira Ellison
@Coira
Oct 07 2015 12:37
camperbot has no manners!
supasheva
@supasheva
Oct 07 2015 12:38
oh thanks @Coira think i see what i need to do
CamperBot
@camperbot
Oct 07 2015 12:38
supasheva sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:warning: supasheva already gave coira points
Julián Aramburu
@julianaramburu
Oct 07 2015 12:39
@christache hi :) you should use the arguments object for that
KieronDowie
@KieronDowie
Oct 07 2015 12:39
My favourite part is where you say thanks and camper interrupts tell you how to use kudos. >:(
CamperBot
@camperbot
Oct 07 2015 12:39
if you want to thank someone, put an @ before their name!
KieronDowie
@KieronDowie
Oct 07 2015 12:39

christache
@christache
Oct 07 2015 12:39
supasheva
@supasheva
Oct 07 2015 12:39
on another note. i just want to say.. there wasn't really a JSON , AJAX tutorial... hm.. i guess i can always do a refresher. there are courses on Codecamp right?
Coira Ellison
@Coira
Oct 07 2015 12:40
i don't know, i just did a lot of googling and experimenting
Julián Aramburu
@julianaramburu
Oct 07 2015 12:40
@christache yeah I know... you should use the arguments object
christache
@christache
Oct 07 2015 12:40
@julianaramburu shouldnt those arguments declared?
be declared*
Coira Ellison
@Coira
Oct 07 2015 12:41
actually still on the weather one, just finishing it up
christache
@christache
Oct 07 2015 12:41
@julianaramburu well ok thanks for the help :)
CamperBot
@camperbot
Oct 07 2015 12:41
christache sends brownie points to @julianaramburu :sparkles: :thumbsup: :sparkles:
:star: 272 | @julianaramburu | http://www.freecodecamp.com/julianaramburu
Julián Aramburu
@julianaramburu
Oct 07 2015 12:42
not necessarily a function could take additional parameters/arguments
Julián Aramburu
@julianaramburu
Oct 07 2015 12:50
@christache you could have something like function something(arg1, arg2) { some code } and call it like something(arg1,arg2,arg3);
supasheva
@supasheva
Oct 07 2015 12:50
found a solution but still don't get it
i find JSON and AJAX cumbersome
Bill Zerega
@dedicatedfuture
Oct 07 2015 12:53
good morning
Julián Aramburu
@julianaramburu
Oct 07 2015 12:54
@dedicatedfuture morning :D
Bill Zerega
@dedicatedfuture
Oct 07 2015 12:54
im having a problem w the last test on the palidrome bonfire

my code js `function palindrome(str) {
// Good luck!
var strClean = str.toLowerCase().replace(/\W|\s/g, "");
var strReverse = strClean.split("").reverse().join("");

if(strClean == strReverse){
return true;
}else{
return false;
}

}`

blah how do you enter it into the chat all nice looking?
something w these ``
Jason Wood
@catapixel
Oct 07 2015 12:56
@dedicatedfuture You also have to replace the underscore "_" to pass the test
Bill Zerega
@dedicatedfuture
Oct 07 2015 12:56
oooo
thx
CamperBot
@camperbot
Oct 07 2015 12:56
if you want to thank someone, put an @ before their name!
Jason Wood
@catapixel
Oct 07 2015 12:56
wiki format
CamperBot
@camperbot
Oct 07 2015 12:56

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Bill Zerega
@dedicatedfuture
Oct 07 2015 12:56
function palindrome(str) {
  // Good luck!
 var strClean = str.toLowerCase().replace(/\W|\s/g, "");
  var strReverse = strClean.split("").reverse().join("");


  if(strClean == strReverse){
    return true;
  }else{
    return false;
  }


}
Jason Wood
@catapixel
Oct 07 2015 12:56
:+1:
Bill Zerega
@dedicatedfuture
Oct 07 2015 12:57
thanks @catapixel
CamperBot
@camperbot
Oct 07 2015 12:57
dedicatedfuture sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 420 | @catapixel | http://www.freecodecamp.com/catapixel
christache
@christache
Oct 07 2015 12:57
@julianaramburu ye but what do you do when you don't know how many arguments there are? :D
mohamedAli
@MooohamedAli
Oct 07 2015 13:00
@dedicatedfuture not valid with symbols like palindrome("0_0 (: /-\ :) 0-0")
Bill Zerega
@dedicatedfuture
Oct 07 2015 13:01
yea thats the part im stuck on
Julián Aramburu
@julianaramburu
Oct 07 2015 13:01
@christache you could use something to track the length of the arguments
Bill Zerega
@dedicatedfuture
Oct 07 2015 13:03
@MooohamedAli any suggestions?
Coira Ellison
@Coira
Oct 07 2015 13:05
@supasheva if you do a codepen, i can take a look if you like? i do find ajax etc pretty ugly tho
mohamedAli
@MooohamedAli
Oct 07 2015 13:06
no i have this symbol problem too
Bill Zerega
@dedicatedfuture
Oct 07 2015 13:06
lol ok
mohamedAli
@MooohamedAli
Oct 07 2015 13:07
tell me if you know the answer :smile:
Diana Bacon
@dianabacon
Oct 07 2015 13:08
@dedicatedfuture Think of it this way: You need to find a way to remove the characters that are not valid. The set of valid characters is a lot smaller than the set of invalid characters. So eliminate the characters that are NOT in the set of valid characters.
prateekpandey
@prateekpandey
Oct 07 2015 13:09
What is the fourth message for in the question Waypoint: Create a JavaScript Slot Machine ? Not mentioned in question plz help
This message was deleted
tva10
@tva10
Oct 07 2015 13:11
@prateekpandey
message: slotOne should be a random number.
 message: slotTwo should be a random number.
 message: slotThree should be a random number.
 message: You should have used Math.floor(Math.random( * (3 - 1 + 1)) + 1; three times to generate your random numbers.)
@prateekpandey hm test cases broken again(
@prateekpandey something cleared?
Jason Wood
@catapixel
Oct 07 2015 13:13
@dedicatedfuture did you figure it out yet?
prateekpandey
@prateekpandey
Oct 07 2015 13:14
@tva10 yeah thanks , working now
CamperBot
@camperbot
Oct 07 2015 13:14
prateekpandey sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 292 | @tva10 | http://www.freecodecamp.com/tva10
Jason Wood
@catapixel
Oct 07 2015 13:14
@MooohamedAli are you still having trouble with Palindrome?
Bill Zerega
@dedicatedfuture
Oct 07 2015 13:16
no not yet
i was just goin to move on
mohamedAli
@MooohamedAli
Oct 07 2015 13:17
yes the symbols is wrong
Bill Zerega
@dedicatedfuture
Oct 07 2015 13:19
i really dont get it, the \W should elimnate the non digits
the underscore and the dash should be picked up by this
0_0 (: /-\ :) 0-0
i mean thats not a palindrome right?
the symbols are different
Diana Bacon
@dianabacon
Oct 07 2015 13:21
@dedicatedfuture @MoohamedAli Google this: regex not letter or number
Bill Zerega
@dedicatedfuture
Oct 07 2015 13:22
lol ok that worked
i still dont really get it though
does that pick up emoticons?
Jason Wood
@catapixel
Oct 07 2015 13:23
@dedicatedfuture what was your final code? BTW that's not really an emoticon. It's just being converted because of the characters being common...
@dedicatedfuture and @MooohamedAli this is what the test is checking to see if it is a palindrome palindrome("0_0 (: /-\\ :) 0-0")
Herman Fassett
@HermanFassett
Oct 07 2015 13:25
@dedicatedfuture \W doesn't remove underscore
Diana Bacon
@dianabacon
Oct 07 2015 13:26
@dedicatedfuture you just have to remove the punctuation; the number part of the emoticons is OK
EngineeredEdge
@EngineeredEdge
Oct 07 2015 13:28
why does \W not remove underscore? because of how common it's used in variable names?
Pankaj Sharma
@Psaug29
Oct 07 2015 13:29

function where(collection, source) {
var arr = [];
// What's in a name?
for(var i=0;i<collection.length;i++)
{
if(collection[i[,1]==source])
{
console.log(collection[i]);
}
else
continue;
}
return arr;
}

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

hey guys i am doing where art thou problem
above is my code
EngineeredEdge
@EngineeredEdge
Oct 07 2015 13:29
how to paste code
wikibot pasting code
Aleksander Gębicki
@Takumar
Oct 07 2015 13:29
wiki format
CamperBot
@camperbot
Oct 07 2015 13:29

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Herman Fassett
@HermanFassett
Oct 07 2015 13:29
wiki code format
CamperBot
@camperbot
Oct 07 2015 13:29

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Pankaj Sharma
@Psaug29
Oct 07 2015 13:29
i know that i have not written it correct
Herman Fassett
@HermanFassett
Oct 07 2015 13:30
@EngineeredEdge yeah, because it's common in most language identifiers
Pankaj Sharma
@Psaug29
Oct 07 2015 13:30
can anyone tell me what can i write in place of if(collection[i[,1]==source])
EngineeredEdge
@EngineeredEdge
Oct 07 2015 13:30
please paste it according to the formatt so i can read it easily
Diana Bacon
@dianabacon
Oct 07 2015 13:32
@EngineeredEdge Exactly, because in C-based languages valid characters for variable names include underscore, leters and digits.
Herman Fassett
@HermanFassett
Oct 07 2015 13:33
Maybe something like @Psaug29
for (var i = 0; i < collection.length; i++) {
    for (var prop in source)
      if (collection[i][prop] == source[prop]) {
          // do something
      }
    }    
}
Might want to include the hasOwnProperty()
Kyle Chesmore
@Kyleches
Oct 07 2015 13:33
I am stuck on Manipulate Arrays With pop, I have followed the instructions but am still getting the error removed should only contain ["cat"], 2.
Is there anyone that would be able to help?
mohamedAli
@MooohamedAli
Oct 07 2015 13:34
yes @catapixel
Pankaj Sharma
@Psaug29
Oct 07 2015 13:34
ohh okk thanks @HermanFassett
CamperBot
@camperbot
Oct 07 2015 13:34
psaug29 sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 327 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Oct 07 2015 13:34
Post your code @Kyleches
Aleksander Gębicki
@Takumar
Oct 07 2015 13:34
@Kyleches show your code and for sure someone will help you. Use instructions about pasting code with three backticks. "```" before and after your code.
Jason Wood
@catapixel
Oct 07 2015 13:35
@MooohamedAli can you paste your code in so I can see what you have so far?
mohamedAli
@MooohamedAli
Oct 07 2015 13:35

function palindrome(str) {
// Good luck
var strClean = str.toLowerCase().replace(/\W|\s/g, " ");
var strReverse = strClean.split("").reverse().join("");
if(strClean == strReverse){
return true;
}else{
return false;
}

}

palindrome("eye");

EngineeredEdge
@EngineeredEdge
Oct 07 2015 13:35
wiki code format
CamperBot
@camperbot
Oct 07 2015 13:35

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Herman Fassett
@HermanFassett
Oct 07 2015 13:36
@MooohamedAli check your regex
EngineeredEdge
@EngineeredEdge
Oct 07 2015 13:36
@MooohamedAli regex101.com is a good sandbox for playing with regex
Herman Fassett
@HermanFassett
Oct 07 2015 13:36
\s is unnecessary and underscore is still getting through
Jason Wood
@catapixel
Oct 07 2015 13:37
@MooohamedAli The problem is with your regex. You want to define a group that represents all "non-word characters" (there is regex specifically for this) and underscores "_" and then replace them globally (regex again) with nothing. Does that make sense?
EngineeredEdge
@EngineeredEdge
Oct 07 2015 13:37
@MooohamedAli also, when you are returning a boolean, you can simply return the test: return forward === backward
Krista Prenesti
@kprenesti
Oct 07 2015 13:40
Hello all. Eager to finally get started! Woo hoo!
Herman Fassett
@HermanFassett
Oct 07 2015 13:40
@kprenesti hello
Arun Shah
@ameeno
Oct 07 2015 13:42
Wazzzzzuppppp
Is london UK active?
Bill Zerega
@dedicatedfuture
Oct 07 2015 13:46
@catpixel my final code was
var strClean = str.toLowerCase().replace(/\W|\s|[^a-zA-Z0-9]/g, "");
  strClean = strClean.replace(/-/g, "");
  var strReverse = strClean.split("").reverse().join("");




  if(strClean == strReverse){
    return true;
  }else{
    return false;
  }


}
Kyle Chesmore
@Kyleches
Oct 07 2015 13:47
'''
CamperBot
@camperbot
Oct 07 2015 13:47
:bulb: to format code use backticks! ``` more info
Kyle Chesmore
@Kyleches
Oct 07 2015 13:47

'''
// var numbers = [1,2,3];
// console.log(numbers); // logs [1,2,3]
// var removed = numbers.pop();
// console.log(numbers); // logs [1,2]
// console.log(removed); // logs 3

var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
myArray.pop(3);
var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23]

// 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) + ' & removed = ' + JSON.stringify(z);})(myArray, removed);
'''

CamperBot
@camperbot
Oct 07 2015 13:47
:bulb: to format code use backticks! ``` more info
Kyle Chesmore
@Kyleches
Oct 07 2015 13:47
```
// var numbers = [1,2,3];
// console.log(numbers); // logs [1,2,3]
// var removed = numbers.pop();
// console.log(numbers); // logs [1,2]
// console.log(removed); // logs 3

var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
myArray.pop(3);
var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23]

// 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) + ' & removed = ' + JSON.stringify(z);})(myArray, removed);
EngineeredEdge
@EngineeredEdge
Oct 07 2015 13:49
@Kyleches you need to do var removed = myArray.pop()
Jason Wood
@catapixel
Oct 07 2015 13:50
@dedicatedfuture That works but this would be simpler: var strClean = str.replace(/[\W_]/g,'').toLowerCase();
EngineeredEdge
@EngineeredEdge
Oct 07 2015 13:50
@Kyleches , also I'm not sure what the index (3) does in pop....
@catapixel @dedicatedfuture , I prefer str.toLowerCase().replace(/[^a-z0-9]/g,'')
Pankaj Sharma
@Psaug29
Oct 07 2015 14:00

function where(collection, source) {
var arr = [];
// What's in a name?
var key=Object.keys(source);

for(var i=0;i<collection.length;i++)
  {
    if(collection[i][key]===source[key])
      {
        arr.push(collection[i]);
      }
    else
      continue;
  }

return arr;
}

where([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
where([{ "a": 1, "b": 2 }, { "a": 1 }, { "a": 1, "b": 2, "c": 2 }], { "a": 1, "b": 2 })

EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:00
@Psaug29 please format correctly, wiki code format
Pankaj Sharma
@Psaug29
Oct 07 2015 14:00
its giving wrong answer for the second where object
@EngineeredEdge How to do it?
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:01
wiki code format
CamperBot
@camperbot
Oct 07 2015 14:01

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Bill Zerega
@dedicatedfuture
Oct 07 2015 14:01
did anyone else have a lot of thier waypoints wiped out?
i went back to work through some basic algorithms as a review and when i looked at my map much of it is now unchecked
stuff i know i did
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:02
'wiped out'?
hmmm
nay
how long ago did you do the waypoints?
Jason Wood
@catapixel
Oct 07 2015 14:03
@EngineeredEdge @dedicatedfuture nothing is lost. Everything is backed up. They are working on restoring it. Don't panic :wink:
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:04
@Psaug29 , do you see the wikibot post that reads "code formatting [wiki] How to post code:" about three comments above this one?
Bill Zerega
@dedicatedfuture
Oct 07 2015 14:05
i did panic a little lol
Pankaj Sharma
@Psaug29
Oct 07 2015 14:06
yeah but when i press enter at the end instead of posting it i just goes below
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:06
try 'ctrl+enter'
Pankaj Sharma
@Psaug29
Oct 07 2015 14:06
function where(collection, source) {
  var arr = [];
  // What's in a name?
  var key=Object.keys(source);

    for(var i=0;i<collection.length;i++)
      {
        if(collection[i][key]===source[key])
          {
            arr.push(collection[i]);
          }
        else
          continue;
      }
  return arr;
}

where([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
where([{ "a": 1, "b": 2 }, { "a": 1 }, { "a": 1, "b": 2, "c": 2 }], { "a": 1, "b": 2 })
okk so my code is giving wrong answer for the second where object
Jason Wood
@catapixel
Oct 07 2015 14:08
@Psaug29 on the far right of where you're typing your text there is a toggle between chat mode (word bubbles) and compose mode (keyboard). When enter goes to next line and doesn't submit/post your text you are in compose mode
Pankaj Sharma
@Psaug29
Oct 07 2015 14:08
@catapixel yeah i saw that
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:09
@Psaug29 , I suggest you go to repl.it and do this
source = {'a': 1, 'b': 2};
var key = Object.keys(source)
source[key]
the output of source[key] is NOT what you are expecting in your above code
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:15
do you see what I mean, @Psaug29 ?
Pankaj Sharma
@Psaug29
Oct 07 2015 14:16
i am not sure i think on repl.it its returning an empty string?
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:17
:) it's not returning anything. because you can't simultaneously access multiple properties of a javascript object, i believe
Jason Wood
@catapixel
Oct 07 2015 14:18
@Psaug29 The problem is that the last test uses a source that has multiple key value pairs but you're not accommodating for that in your code. You have to make sure that all key value pairs in source are present before you push to arr
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:22
@catapixel did you know you can 'name' loops in javascript, so you can specify which loop to break / continue
last exampleo n the page here: http://www.w3schools.com/jsref/jsref_continue.asp
@Psaug29 , how're you doing?
Pankaj Sharma
@Psaug29
Oct 07 2015 14:27
@catapixel even when i use for...in its the same thing as a iterating loop isn't it?
@EngineeredEdge not getting the use of hasownproperty
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:29

@Psaug29 what do you expect this to output:

source[ ['a', 'b'] ]

Pankaj Sharma
@Psaug29
Oct 07 2015 14:30
u are asking Object.Keys(source) right
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:31
?
Jason Wood
@catapixel
Oct 07 2015 14:32
@Psaug29 for...in is a loop for iterating over objects
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:32
var source = {'a': 1, 'b': 2};
source[ ['a', 'b' ] ]
Pankaj Sharma
@Psaug29
Oct 07 2015 14:32
i am expecting 1,2
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:33
but when you go to repl.it, do you get that?
Pankaj Sharma
@Psaug29
Oct 07 2015 14:33
@catapixel isnt that the same as for(var i=0;i<collection.length;i++)?
No @EngineeredEdge
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:34
@Psaug29 that is because you can not access multiple properties of an object at once like that
Jason Wood
@catapixel
Oct 07 2015 14:34
@Psaug29 this line var key=Object.keys(source); is not going to help you where it is written or at all. It is attempting to assign a value as if there is only one key value pair. It won't work. You need to eliminate it and then place a for in loop inside your for(var i=0;i<collection.length;i++) This loop is for looping over the objects in collection not the objects in source
that is why you need to for...in loop. To loop over the objects in source
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:35
@catapixel , actually it could work just like that. his problem is thinking you can access multiple properties at once with object[ [property1, property2] ]
Jason Wood
@catapixel
Oct 07 2015 14:36
@EngineeredEdge It's true but conceptually I don't think that is how he is looking at his code. I figured it was easier to think about a loop inside a loop since previous exercises would have already demonstrated how to make that work.
Pankaj Sharma
@Psaug29
Oct 07 2015 14:38
I understand what @catapixel is trying to say and i kind of get what @EngineeredEdge is trying to say but for..in loop i know how to do it however i am still going through the stackoverflow link you sent to understand this multiple properties issue
Jason Wood
@catapixel
Oct 07 2015 14:40
@Psaug29 either will work. It's great to understand both. Once you work out how to access/test for all of the key value pairs inside the source object being present inside the collection object you will have solved the exercise. You are very close.
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:40
@Psaug29, the problem is that you think
object1[ [property1, property2] ] === object2[ [property1, property2] ]
checks to see if both object1 and object2 have the same value for property1 and property2. That is not what it does because both will return undefined / nothing. What you need to do is go through each property individually to check if both have the same value
btw, @catapixel did you accomplish this bonfire with nested loops? that's a good first way to do it, but we also learned about array.filter()- which is the most elegant way to do it
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:51
  var x = {'a': 1, 'b': 2};
   var y = {'c': 3, 'd': 4};
   x[ ['a','b'] ] === y[ ['a','b'] ]
@Psaug29 , what do you expect that to output?
Pankaj Sharma
@Psaug29
Oct 07 2015 14:55
I thought that maybe x[ ['a','b'] ] will output 1,2 but its not doing so because it will not access both properties simultaneously right?
EngineeredEdge
@EngineeredEdge
Oct 07 2015 14:55
correct.
To go a little deeper:
"Property names must be strings. This means that non-string objects cannot be used as keys in the object. Any non-string object, including a number, is typecasted into a string via the toString method."
SO if you do
var z = { 'a,b': 6 };
var z = { 'a,b': 6 };
z[ ['a','b'] ]
>>> 6
That is because
['a','b'].toString() === 'a,b'
>>> true

But i guess, don't worry about that for now.

Right now, just notice that you need to check each property individually, you can't do it all at once

Jason Wood
@catapixel
Oct 07 2015 14:58
@EngineeredEdge yes, I did it originally that way and then they changed it so that the last test was introduced so even my original code failed then I didn't go back and correct again. Yes, I agree that once you learn functional programming and filter you should/could use it here as a preferable method.
Pankaj Sharma
@Psaug29
Oct 07 2015 14:59
kk thanks first i will try nested loops then i will look into this deeply
CamperBot
@camperbot
Oct 07 2015 14:59
if you want to thank someone, put an @ before their name!
Jason Wood
@catapixel
Oct 07 2015 14:59
@EngineeredEdge as things continue to evolve and tests change I do see that previous "correct" solutions no longer pass lol
Pankaj Sharma
@Psaug29
Oct 07 2015 14:59
thanks @catapixel @EngineeredEdge
CamperBot
@camperbot
Oct 07 2015 14:59
psaug29 sends brownie points to @catapixel and @engineerededge :sparkles: :thumbsup: :sparkles:
:star: 349 | @engineerededge | http://www.freecodecamp.com/engineerededge
:star: 423 | @catapixel | http://www.freecodecamp.com/catapixel
EngineeredEdge
@EngineeredEdge
Oct 07 2015 15:00
wiki beta curriculum
CamperBot
@camperbot
Oct 07 2015 15:00
no wiki entry for: beta curriculum
:pencil: click here to create one now!after creating your page type update to reload it here
JensGryspeert
@JensGryspeert
Oct 07 2015 15:03
what's wrong with this (it's just a snippet of code)
var arrWords = [];
  arrWords = str.split[''];

  return arrWords[0];
it's returns array is not defined
EngineeredEdge
@EngineeredEdge
Oct 07 2015 15:04
? hard to tell from just that snippet
Coira Ellison
@Coira
Oct 07 2015 15:04
@JensGryspeert arrWords = str.split['']; should be arrWords = str.split('');
JensGryspeert
@JensGryspeert
Oct 07 2015 15:05
oh yea damn me. Thanks @coira to see it ;:p
CamperBot
@camperbot
Oct 07 2015 15:05
jensgryspeert sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 264 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Oct 07 2015 15:05
just a little thing :)
EngineeredEdge
@EngineeredEdge
Oct 07 2015 15:05
lol ohhhh
that took me a second even after you pointed it out
chelsea47
@chelsea47
Oct 07 2015 15:07
Your p element should have the text "View more " (with a space after it). can anyone with this?
EngineeredEdge
@EngineeredEdge
Oct 07 2015 15:08
yes
what waypoint
vere perrot
@perrot
Oct 07 2015 15:08

Hi my friend,
I am work in zipline: build a tic tac toe game.
I don't understand this sentence.

As a user, I can never actually win against the computer - at best I can tie

The sentence means I always lose against the computer. Right?

chelsea47
@chelsea47
Oct 07 2015 15:08
nest an anchor element within a paragraph
May Pagatpatan
@myflryuna
Oct 07 2015 15:09

Hello fellow campers:
I dont understand what is wrong with this nesting text into form with action

Waypoint: Create a Form Element

<form action="/submit-cat-photo"><input type="text" placeholder="cat photo URL"></form>

EngineeredEdge
@EngineeredEdge
Oct 07 2015 15:09
@perrot yes. Optimal tic-tac-toe play makes one never lose
so what hte sentence is saying is make the 'computer' play optimally.
@perrot check out this link
vere perrot
@perrot
Oct 07 2015 15:11
@EngineeredEdge I got it. Thank you for your explain. :+1:
CamperBot
@camperbot
Oct 07 2015 15:11
perrot sends brownie points to @engineerededge :sparkles: :thumbsup: :sparkles:
:star: 350 | @engineerededge | http://www.freecodecamp.com/engineerededge
@chelsea47 can you show me what you have?
May Pagatpatan
@myflryuna
Oct 07 2015 15:11
@chelsea47 it means that your element p need to have a text "View more "
EngineeredEdge
@EngineeredEdge
Oct 07 2015 15:11
@myflryuna what does it say is wrong with it?
May Pagatpatan
@myflryuna
Oct 07 2015 15:12

@EngineeredEdge I can't pass the waypoint.

Make sure your form has an action attribute which is set to /submit-cat-photo.

EngineeredEdge
@EngineeredEdge
Oct 07 2015 15:13
<form action="/submit-cat-photo">
  <input type="text" placeholder="cat photo URL">
</form>
@myflryuna when I paste your exact code into mine, it passes
Avil
@Avil172
Oct 07 2015 15:14
@myflryuna your code is right, click reset code and retry it.
May Pagatpatan
@myflryuna
Oct 07 2015 15:15
i can
EngineeredEdge
@EngineeredEdge
Oct 07 2015 15:16
hmMM ?
May Pagatpatan
@myflryuna
Oct 07 2015 15:16
sorry*
still i can't pass the waypoint: Create a Form Element
shall i raise a bug?
EngineeredEdge
@EngineeredEdge
Oct 07 2015 15:16
I say, move on and come back to it tomorrow to try. They made some changes last night so it might just be buggy today
Mateja Trifunovski
@Matko95
Oct 07 2015 15:18
@myflryuna You could try another browser
Wiki storage
CamperBot
@camperbot
Oct 07 2015 15:18

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

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

In Chrome:

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

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

May Pagatpatan
@myflryuna
Oct 07 2015 15:18
ok, thanks guys @Avil172 @EngineeredEdge
CamperBot
@camperbot
Oct 07 2015 15:18
myflryuna sends brownie points to @avil172 and @engineerededge :sparkles: :thumbsup: :sparkles:
:star: 351 | @engineerededge | http://www.freecodecamp.com/engineerededge
:star: 167 | @avil172 | http://www.freecodecamp.com/avil172
Mateja Trifunovski
@Matko95
Oct 07 2015 15:18
Or this
Avil
@Avil172
Oct 07 2015 15:19
@myflryuna looks like its bugged indeed..
but the code is right.
mohamedAli
@MooohamedAli
Oct 07 2015 15:24

what is the wrong function titleCase(str) {
var newstr = str.split(" ");
for(i=0;i<newstr.length;i++){
var word = newstr[i].charAt(0).toUpperCase();

}
return word;
}

Herman Fassett
@HermanFassett
Oct 07 2015 15:27
@MooohamedAli declare word outside of the for loop, change code so it's adding to word and also so it's not just adding first character but the whole word
mohamedAli
@MooohamedAli
Oct 07 2015 15:28
@HermanFassett i want to make only the first character in whole words is upper
Herman Fassett
@HermanFassett
Oct 07 2015 15:32

Yes @MooohamedAli here is a sample that returns only first character

function titleCase(str) {
    var newstr = str.split(" ");
    var word = "";
    for(i=0; i < newstr.length; i++){
        word += newstr[i].charAt(0).toUpperCase() + " ";
    }
    return word;
}
titleCase("Here is a sentence");

But that outputs H I A S. You need to also add the rest of the word on there somehow.

mohamedAli
@MooohamedAli
Oct 07 2015 15:39
@HermanFassett i want to write all the sentence
Peter Pei
@peihongda
Oct 07 2015 15:40
Any one can help? Why always "$ is not defined", and can not "Go to my next challenge"
Brian van Vlymen
@arduino731
Oct 07 2015 15:41
@HermanFassett why you put
newstr[i]
mohamedAli
@MooohamedAli
Oct 07 2015 15:43
@ironheartbj18 to indicate the word which he'd like
Brian van Vlymen
@arduino731
Oct 07 2015 15:43
newstr[i < 1]
?
May Pagatpatan
@myflryuna
Oct 07 2015 15:43
@camperbot i did try clear my browser's local storage [wiki] as per your instruction but still i can't pass that waypoint
mohamedAli
@MooohamedAli
Oct 07 2015 15:43
in loop i = 0 >>>>>>>>> it means newstr[i] = Here
Brian van Vlymen
@arduino731
Oct 07 2015 15:44
i dont think it would not work in the array in the if condition statement
mohamedAli
@MooohamedAli
Oct 07 2015 15:44
and i = 1 >>>>>>> it means newstr[i] = is
Brian van Vlymen
@arduino731
Oct 07 2015 15:47
for(i=0; i < newstr.length; i++){
        word += newstr(function(){
if(i< 1}newstr[0]
.charAt(0).toUpperCase() + " ";
    }
Muhammed Gamal
@JimyAllam
Oct 07 2015 15:56
hey i am new here
can any one help
Aleksander Gębicki
@Takumar
Oct 07 2015 15:57
@JimyAllam new and fresh so welcome and start learning.
What's your problem?
Muhammed Gamal
@JimyAllam
Oct 07 2015 15:58
starting with the map and it is maybe difficult
Aleksander Gębicki
@Takumar
Oct 07 2015 15:59
@JimyAllam first exercises shouldn't be difficult, which waypoint are your working now?
Julián Aramburu
@julianaramburu
Oct 07 2015 16:00
@JimyAllam Welcome :D!
Muhammed Gamal
@JimyAllam
Oct 07 2015 16:00
Use CSS Selectors to Style Elements
@Takumar Use CSS Selectors to Style Elements
Aleksander Gębicki
@Takumar
Oct 07 2015 16:00
Ok. And you've tried to write and you got an error?
Muhammed Gamal
@JimyAllam
Oct 07 2015 16:01
yes
Aleksander Gębicki
@Takumar
Oct 07 2015 16:02
I see in your exercise that you start from CSS styling placed inside HTML tags.
Muhammed Gamal
@JimyAllam
Oct 07 2015 16:02
aha
chstone
@chstone
Oct 07 2015 16:03
Hello, I, too, have a question re Waypoint: Create a Form Element (#30, I think).
Aleksander Gębicki
@Takumar
Oct 07 2015 16:03
That's called inline CSS style.
So you should now remove CSS style to external section. You have to create <style> ... </style> section at the top of the code.
@chstone please wait a minute.
chstone
@chstone
Oct 07 2015 16:04
No worries. Thank you.
CamperBot
@camperbot
Oct 07 2015 16:04
if you want to thank someone, put an @ before their name!
Muhammed Gamal
@JimyAllam
Oct 07 2015 16:04
@Takumar are you senior developer??
Aleksander Gębicki
@Takumar
Oct 07 2015 16:05
@JimyAllam You have such section? Maybe you try to paste in code here. Use three backtics before and after your code like in instruction.
wiki format
CamperBot
@camperbot
Oct 07 2015 16:05

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Muhammed Gamal
@JimyAllam
Oct 07 2015 16:05
i did it at last
thanks @Takumar
CamperBot
@camperbot
Oct 07 2015 16:05
jimyallam sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 409 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Oct 07 2015 16:06
@JimyAllam no, I am not a senior developer, I am learning JavaScript now. My problem is that I tried to learn PHP, Ruby, Perl, JavaScript and all I know is their simple constructions :-) I'm not an expert in any.
So where you had problem? You didn't remove style from <h2>?
Muhammed Gamal
@JimyAllam
Oct 07 2015 16:07
aha .. i changed it and all have done .. if i had a prob. i will tell you :smile:
Aleksander Gębicki
@Takumar
Oct 07 2015 16:07
Ok.
@chstone so we can talk now.
chstone
@chstone
Oct 07 2015 16:09
Thanks, @Takumar .
I seem to be stuck on #30, but I think it is correct.
Here is the code I have.
CamperBot
@camperbot
Oct 07 2015 16:09
chstone sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 410 | @takumar | http://www.freecodecamp.com/takumar
chstone
@chstone
Oct 07 2015 16:09

'''

<form action="/submit-cat-photo">
<input type="text" placeholder="cat photo URL">
</form>
'''

CamperBot
@camperbot
Oct 07 2015 16:09
:bulb: to format code use backticks! ``` more info
zhangs
@zhangtreefish
Oct 07 2015 16:10
Has anyone noticed that fa-trash does not work at the section "Waypoint: Add Font Awesome Icons to all of our Buttons"?
Aleksander Gębicki
@Takumar
Oct 07 2015 16:12
@chstone hmm, strange. I opened this waypoint and added identical code to the end of the code and it works for me.
chstone
@chstone
Oct 07 2015 16:13
I thought so. Maybe I should try to reset that lesson. Restart my browser, perhaps?
Aleksander Gębicki
@Takumar
Oct 07 2015 16:13
Your code is good. Reset exercise and paste your code. It have to work.
chstone
@chstone
Oct 07 2015 16:13
At least that's right. I thought I was crazy.
Aleksander Gębicki
@Takumar
Oct 07 2015 16:18
@chstone Have you reset the code? Does it work now?
Brian van Vlymen
@arduino731
Oct 07 2015 16:18
anyone willing to help out how to do wikipedia zipline I m having problem with ui.bootstrap module on angular js
Julián Aramburu
@julianaramburu
Oct 07 2015 16:19
im not using angular yet, sorry :(
Aleksander Gębicki
@Takumar
Oct 07 2015 16:25

@zhangtreefish I have just checked and I can add fa-trash icon to my button.

<button class="btn btn-block btn-danger"><i class="fa fa-trash"></i>Delete</button>

trash.jpg
@ironheartbj18 I'm sorry I also cannot help you.
Brian van Vlymen
@arduino731
Oct 07 2015 16:28
@Takumar np
@julianaramburu np
chstone
@chstone
Oct 07 2015 16:30
@takumar, I changed browsers from Chrome to IE for that waypoint and it worked.
Aleksander Gębicki
@Takumar
Oct 07 2015 16:31
@ironheartbj18 wait a few weeks so I'll learn Angular :-)
Bill Zerega
@dedicatedfuture
Oct 07 2015 16:31
hey guys im having problems with bonfire mutations
function mutation(arr) {
  var temp1 = arr[0].toLowerCase();
  var temp2 = arr[1].toLowerCase();


  for(var i = 0; i<temp1.length; i++){
    var check = temp1.indexOf(temp2[i]);
    if(check === -1){
      return false;
    }
  }
  return true;
}
not sure why it isnt working
chstone
@chstone
Oct 07 2015 16:31
Thank you, @Takumar , for helping verify the code is correct!
CamperBot
@camperbot
Oct 07 2015 16:31
chstone sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: chstone already gave takumar points
Brian van Vlymen
@arduino731
Oct 07 2015 16:32
@Takumar its awesome features modules over there!
Matt Anderson
@MDAWebDev
Oct 07 2015 16:33
Is anyone else having issues claiming their front-end dev certificate? It's not registering that I've completed all the requirements when I have.
Bill Zerega
@dedicatedfuture
Oct 07 2015 16:34
cany anyone help me out w mutations
EngineeredEdge
@EngineeredEdge
Oct 07 2015 16:36
@dedicatedfuture sure
Bill Zerega
@dedicatedfuture
Oct 07 2015 16:38
function mutation(arr) {
  var temp1 = arr[0].toLowerCase();
  var temp2 = arr[1].toLowerCase();


  for(var i = 0; i<temp1.length; i++){
    var check = temp1.indexOf(temp2[i]);
    if(check === -1){
      return false;
    }
  }
  return true;
}
im not passing all of the tests
im not really sure why
EngineeredEdge
@EngineeredEdge
Oct 07 2015 16:39
1 sec
@dedicatedfuture it's very close to being correct, check your loop conditions
it's literally a 1 character change.
Bill Zerega
@dedicatedfuture
Oct 07 2015 16:42
start at 1?
EngineeredEdge
@EngineeredEdge
Oct 07 2015 16:42
Nay. Type to me in words what you want your loop to accomplish
Bill Zerega
@dedicatedfuture
Oct 07 2015 16:43
oooo
temp2
thank you
CamperBot
@camperbot
Oct 07 2015 16:43
if you want to thank someone, put an @ before their name!
EngineeredEdge
@EngineeredEdge
Oct 07 2015 16:43
si
Bill Zerega
@dedicatedfuture
Oct 07 2015 16:43
thank you @EngineeredEdge
CamperBot
@camperbot
Oct 07 2015 16:43
dedicatedfuture sends brownie points to @engineerededge :sparkles: :thumbsup: :sparkles:
:star: 353 | @engineerededge | http://www.freecodecamp.com/engineerededge
EngineeredEdge
@EngineeredEdge
Oct 07 2015 16:43
welcome @dedicatedfuture
also note, I believe it's convention to not call 'var' inside a for loop
function mutation(arr) { 
  var temp1 = arr[0].toLowerCase(),
      temp2 = arr[1].toLowerCase(),
      check;
  for(var i = 0; i<temp2.length; i++) { 
    check = temp1.indexOf(temp2[i]); 
    if (check === -1) { 
      return false; } 
  } 

  return true; }

mutation(['hello', 'hey']);
Avishay
@avishayshushan
Oct 07 2015 16:45
function mutation(arr) { 
  var temp1 = arr[0].toLowerCase(),
      temp2 = arr[1].toLowerCase(),
      check;
  for(var i = 0; i<temp2.length; i++) {  
    if (temp1.indexOf(temp2[i])=== -1)return false; 
  } 

  return true; }

mutation(['hello', 'hey']);
sorry
without the check
Bill Zerega
@dedicatedfuture
Oct 07 2015 16:46
really? i always declare teh var in the loop
should i declare it outside or do i just not need the var?
Avishay
@avishayshushan
Oct 07 2015 16:46
function mutation(arr) { 
  var temp1 = arr[0].toLowerCase(),
      temp2 = arr[1].toLowerCase();
  for(var i = 0; i<temp2.length; i++) {  
    if (temp1.indexOf(temp2[i])=== -1)return false; 
  } 

  return true; }

mutation(['hello', 'hey']);
h4r1m4u
@h4r1m4u
Oct 07 2015 16:46
@dedicatedfuture i second what @EngineeredEdge said. if you define var inside the for loop, it'll be created anew on each of the loop runs, creating unnecessary overhead
Avishay
@avishayshushan
Oct 07 2015 16:47
@h4r1m4u :+1:
EngineeredEdge
@EngineeredEdge
Oct 07 2015 16:47
well, i doubted myself, apparently it's simply a convention: http://stackoverflow.com/questions/3684923/javascript-variables-declare-outside-or-inside-loop
@dedicatedfuture @avishayshushan , can you solve the mutation without using a for loop? [hint: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every]
Charlotte
@Charzoe
Oct 07 2015 16:50

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

Anyone know how I can center the social media icons and move them lower down closer to the title? Nothing I try seems to be working...

Sarah Martinelli Benedetti
@smb26
Oct 07 2015 16:51
Hello, I'm doing the "Nest an Anchor Element within a Paragraph" and I've got stuck because it doesn't validate when I put: <p>View more <a href="http://freecatphotoapp.com"> cat photos </a></p>. Does anybody have any clue what I'm doing wrong?
EngineeredEdge
@EngineeredEdge
Oct 07 2015 16:52
is there a bootstrap for 'centered'
Avishay
@avishayshushan
Oct 07 2015 16:52
@EngineeredEdge seems like a nice challenge but is it better than a loop?
hey @Charzoe my previous answer did not help?
EngineeredEdge
@EngineeredEdge
Oct 07 2015 16:54
@avishayshushan for something like this, i believe it's more personal preference
but I think it looks 'cleaner'
Bill Zerega
@dedicatedfuture
Oct 07 2015 16:54
@engineeredEdge i am not really understanding this every command you showed me
Pankaj Sharma
@Psaug29
Oct 07 2015 16:54
@Charzoe I think you have not added any css for your fluid container class which is the class of your division containing the icons
if you do the commands on the fluid container class i think it will work
JensGryspeert
@JensGryspeert
Oct 07 2015 16:56
alt
var icon = response.list[8].weather[0].id;
that's the same right? I need to have the ID out of the json
EngineeredEdge
@EngineeredEdge
Oct 07 2015 16:56
@avishayshushan @dedicatedfuture
function allEven(arr) {
    function isEven(x) {
        return x % 2 === 0;
    }
    return arr.every(isEven);
}

allEven([2,4,6,8])
>>> true
allEven([2,5,7,8])
>>> false
Avishay
@avishayshushan
Oct 07 2015 16:57
@avishayshushan
hey @Charzoe
try add this to your css
.social-icons{
    position: absolute;
  left: 50%;
  margin-left: -100px;
}
EngineeredEdge
@EngineeredEdge
Oct 07 2015 16:57
i think you can see how similar that problem is to the 'mutation' problem, correct?
Tyler Moeller
@TylerMoeller
Oct 07 2015 16:57
@Charzoe You want "container-fluid" not "fluid-container", your .social-icons CSS has everything aligned left, and you'll want to offset your col-xs-8 to center that column. Also a good idea to put it all in a row.
Bill Zerega
@dedicatedfuture
Oct 07 2015 16:59
is the every like forEach?
EngineeredEdge
@EngineeredEdge
Oct 07 2015 16:59
@TylerMoeller isn't that necessary? i thought the structure was
<div class='fluid-continaer'>
  <div class='row'>
     <div class='col-**-*'>
    </div>
  </div>
</div>
Bill Zerega
@dedicatedfuture
Oct 07 2015 16:59
just runs through each element in the array?
EngineeredEdge
@EngineeredEdge
Oct 07 2015 17:00
similar yes
except it doesn't go all the way through if it hits a falsey. if it hits a falsey it just returns false
Tyler Moeller
@TylerMoeller
Oct 07 2015 17:00
@EngineeredEdge This is what I was trying to say:
<div class='continaer-fluid'>
  <div class='row'>
     <div class='col-**-* col-**-offset-*'>
    </div>
  </div>
</div>
You can adjust offset to center the col
EngineeredEdge
@EngineeredEdge
Oct 07 2015 17:00

"Also a good idea to put it all in a row."

I was asking, I thought it wasn't just a good idea but required

Tyler Moeller
@TylerMoeller
Oct 07 2015 17:01
Yeah, just being nice - should have been more direct. Must have.
EngineeredEdge
@EngineeredEdge
Oct 07 2015 17:01
gracias @TylerMoeller
Tyler Moeller
@TylerMoeller
Oct 07 2015 17:01
denada
EngineeredEdge
@EngineeredEdge
Oct 07 2015 17:02
@camperbot should add 'gracias' to collection of 'thank-you equivalents'
CamperBot
@camperbot
Oct 07 2015 17:02
engineerededge sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 303 | @camperbot | http://www.freecodecamp.com/camperbot
Charlotte
@Charzoe
Oct 07 2015 17:02
It was in a row, accidentally removed that. Fixed container, col-offset still isn't working
Tyler Moeller
@TylerMoeller
Oct 07 2015 17:04
@Charzoe Any reason why you have it as a list rather than just <img> next to each other?
Andrea Ardenti
@andreaardenti
Oct 07 2015 17:04
hello everybody, i need some help with a lesson of javascript.... is there any one available?
Tyler Moeller
@TylerMoeller
Oct 07 2015 17:05
@Charzoe I think the float: left CSS you have to make the list horizontal may be causing some conflicts
Avishay
@avishayshushan
Oct 07 2015 17:05
@andreaardenti sure
only if i know it :smile:
CamperBot
@camperbot
Oct 07 2015 17:06
andreaardenti sends brownie points to @avishayshushan :sparkles: :thumbsup: :sparkles:
:star: 296 | @avishayshushan | http://www.freecodecamp.com/avishayshushan
Akash Chavan
@CruiseDevice
Oct 07 2015 17:07

Bonfire: Diff Two Arrays

function diff(arr1,arr2){
    var index;
    for(var i = 0; i < arr1.length; i++){
        index = arr2.indexOf(arr1[i]);
        if(index > -1){
            arr2.splice(index,1);
        }
    }
  return arr2;
}
diff([1,2,3,5],[1,2,3,4,5]);

What i'm I doing wrong?

CamperBot
@camperbot
Oct 07 2015 17:07
Sorry, can't find a bonfire called diff two arraysfunction diffarr1arr2 var index forvar i 0 i arr1length i index arr2indexofarr1i ifindex -1 arr2spliceindex1 return arr2diff123512345what im i doing wrong. [ Check the map? ]
Avishay
@avishayshushan
Oct 07 2015 17:07
@andreaardenti inside an if statement use ===
Andrea Ardenti
@andreaardenti
Oct 07 2015 17:08
@avishayshushan ok
Tyler Moeller
@TylerMoeller
Oct 07 2015 17:08
@Charzoe This is what we were recommending with Rows and Offsets:
<div class="container-fluid">
    <div class="row">
      <div class="col-xs-8 col-xs-offset-2">
        <ul class="social-icons">
        ...
        </ul>
      </div>
    </div>
  </div>
Avishay
@avishayshushan
Oct 07 2015 17:08
you should use at least ==
for false/0/NaN etc you should use ===
@andreaardenti
mjeff7
@mjeff7
Oct 07 2015 17:10
@CruiseDevice What about the elements only in the other array?
Avishay
@avishayshushan
Oct 07 2015 17:10
you should also put quotes on the heads/tails
Akash Chavan
@CruiseDevice
Oct 07 2015 17:10
it is showing 4 from the other array.
Avishay
@avishayshushan
Oct 07 2015 17:10
@andreaardenti
Andrea Ardenti
@andreaardenti
Oct 07 2015 17:11
@avishayshushan DONE! you were precioous! thank you
CamperBot
@camperbot
Oct 07 2015 17:11
andreaardenti sends brownie points to @avishayshushan :sparkles: :thumbsup: :sparkles:
:warning: andreaardenti already gave avishayshushan points
mjeff7
@mjeff7
Oct 07 2015 17:12
@CruiseDevice It looks like it works fine for the one example you gave, but won't work for other examples. Try switching the two inputs.
Akash Chavan
@CruiseDevice
Oct 07 2015 17:13
@mjeff7 yes won't work for other testcases.
mjeff7
@mjeff7
Oct 07 2015 17:14
For a test case that doesn't work, what output are you expecting and what output are you getting?
Avishay
@avishayshushan
Oct 07 2015 17:17
@CruiseDevice i think that you should consider to check which array is the larger
it seems that this info does matter
Akash Chavan
@CruiseDevice
Oct 07 2015 17:18
@mjeff7 I think my code gives difference from only one array. Means if array1 contains[1,2,3] and other contains [1,2,3,4,5] the it gives 4,5. If it is other way i.e array1 contains[1,2,3,4,5] and other as [1,2,3] my code won't work.
Avishay
@avishayshushan
Oct 07 2015 17:18
does the 2nd Array is bigger in the failing testcases?
Akash Chavan
@CruiseDevice
Oct 07 2015 17:18
@avishayshushan yes. Need to think of other logic
I'am having difficulty in learning Javascript.
mjeff7
@mjeff7
Oct 07 2015 17:18
@CruiseDevice Can you see why? In your code, are you treating array1 differently that array2?
Akash Chavan
@CruiseDevice
Oct 07 2015 17:19
@mjeff7 yes.
mjeff7
@mjeff7
Oct 07 2015 17:21
@CruiseDevice Do you think treating them the same would get you closer to what you want?
Bill Zerega
@dedicatedfuture
Oct 07 2015 17:21
hey everyone, can someone help me with bonfire where do i belong?
CamperBot
@camperbot
Oct 07 2015 17:21
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Bill Zerega
@dedicatedfuture
Oct 07 2015 17:21
```
```
function where(arr, num) {
  // Find my place in this sorted array.
  arr.sort(function(a, b){
    return a - b;
  });

  var whereBelong = 0;
  for(var i = 0; i<arr.length; i++){
    if(arr[i]<num){
      whereBelong = i +1;
    }else{
      return whereBelong;
    }
  }

}
Akash Chavan
@CruiseDevice
Oct 07 2015 17:21
I think i should apply the same login to both the arrays.
I think this will work.
mjeff7
@mjeff7
Oct 07 2015 17:22
@CruiseDevice Great.
Akash Chavan
@CruiseDevice
Oct 07 2015 17:22
Do you think this will work?
mjeff7
@mjeff7
Oct 07 2015 17:24
@dedicatedfuture What happens if num is bigger than everything in arr?
Bill Zerega
@dedicatedfuture
Oct 07 2015 17:24
it doesnt pass that test
thats where i am going wrong
mjeff7
@mjeff7
Oct 07 2015 17:25
@dedicatedfuture What result are you getting, and what result are you expecting?
Bill Zerega
@dedicatedfuture
Oct 07 2015 17:26
well i expect it to run through the array comparing each element to the second argument
when it hits an argument that is bigger than it it it stops
and inserts the wherebelong var
mjeff7
@mjeff7
Oct 07 2015 17:28
@dedicatedfuture And what result are you getting?
Bill Zerega
@dedicatedfuture
Oct 07 2015 17:29
its working for finding where to slip in the num argument on all of them except when it is more than everything in the array
mjeff7
@mjeff7
Oct 07 2015 17:30
@dedicatedfuture Do you see why?
Bill Zerega
@dedicatedfuture
Oct 07 2015 17:30
i never really address that
mjeff7
@mjeff7
Oct 07 2015 17:31
@dedicatedfuture Sounds like you know what you need to do. :)
@dedicatedfuture BTW, do you know about using "break"? You might find that useful (though it's not necessary by any means).
Bill Zerega
@dedicatedfuture
Oct 07 2015 17:35
boom got it
thanks @mjeff7
CamperBot
@camperbot
Oct 07 2015 17:35
dedicatedfuture sends brownie points to @mjeff7 :sparkles: :thumbsup: :sparkles:
:star: 189 | @mjeff7 | http://www.freecodecamp.com/mjeff7
mjeff7
@mjeff7
Oct 07 2015 17:37
@dedicatedfuture Awesome! Glad to help.
Jed
@codingjv
Oct 07 2015 17:38
Hello fellow campers, just getting back to working sequentially through the curriculum and seem to be hung up on a Waypoint (google search hasn't resolved), specifically:..

..on the 'Waypoint: Create a Form Element', I'm getting the red X circle (no pass)..
"Make sure your form has an action attribute which is set to /submit-cat-photo."
..for this part of my code:

<form action="/submit-cat-photo">
<input type='text' placeholder='cat photo URL'>
</form>
?

Elizabeth Hatleli
@TheHighPriestess
Oct 07 2015 17:38
What is the best way to create an image map?
Rita M
@lizette112162
Oct 07 2015 17:40
I am also hung up on the Waypoint: Create a Form Element". This is my code:
jimmy sunny
@jimmythattilsunny
Oct 07 2015 17:40
can any one help on this
Make sure your form has an action attribute which is set to /submit-cat-photo.
Rita M
@lizette112162
Oct 07 2015 17:40
<form action="/submit-cat-photo">
<input type="text" placeholder="cat photo URL"/>
</form>
jimmy sunny
@jimmythattilsunny
Oct 07 2015 17:40
not working lizette
Jed
@codingjv
Oct 07 2015 17:41
(Hi Lizette, thanks for adding another voice :smile: )
Corey Murray
@muzzaaa
Oct 07 2015 17:44
Quick question, has anyone found use of using both FreeCodeCamp and Codecademy at the same time? Or is FreeCodeCamp enough by itself?
Pablo Regen
@PabloRegen
Oct 07 2015 17:44
Hi there. I can’t make the palindrome bonfire work.
Avil
@Avil172
Oct 07 2015 17:44
@lizette112162 @codingjv @jimmythattilsunny there seem to be a bug in that waypoint..
Elizabeth Hatleli
@TheHighPriestess
Oct 07 2015 17:44
Did they change this bonfire since I did it? I don't see that I included anything with "submit-cat-photo"
@muzza96 I would do both.
for the javascript anyway
Jed
@codingjv
Oct 07 2015 17:45
Thanks @Avil172 ..has anyone reported the bug? And how do we move forward beyond it?
CamperBot
@camperbot
Oct 07 2015 17:45
codingjv sends brownie points to @avil172 :sparkles: :thumbsup: :sparkles:
:star: 177 | @avil172 | http://www.freecodecamp.com/avil172
h4r1m4u
@h4r1m4u
Oct 07 2015 17:45
@jimmythattilsunny i also think that's a bug. i passed the waypoint with your exact same code before, but now it's not passing
Corey Murray
@muzzaaa
Oct 07 2015 17:45
@TheHighPriestess Why for just JavaScript?
h4r1m4u
@h4r1m4u
Oct 07 2015 17:45
@jimmythattilsunny report it as a bug
Avil
@Avil172
Oct 07 2015 17:45
@muzza96 i used FCC and CA for JS only.
Jed
@codingjv
Oct 07 2015 17:46
@camperbot Thank you for the points :)
CamperBot
@camperbot
Oct 07 2015 17:46
codingjv sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 304 | @camperbot | http://www.freecodecamp.com/camperbot
Elizabeth Hatleli
@TheHighPriestess
Oct 07 2015 17:46
@muzza96 You can do their jQuery as well..can't hurt
Corey Murray
@muzzaaa
Oct 07 2015 17:46
@Avil172 did you find HTML/CSS enough on FCC
Avil
@Avil172
Oct 07 2015 17:46
@codingjv just go to the map in and do the next waypoint. hopefully it will be fixed soon
Elizabeth Hatleli
@TheHighPriestess
Oct 07 2015 17:46
@muzza96 ...and do Codeacademy for html/css as well.
Jed
@codingjv
Oct 07 2015 17:46
@Avil172 Thank you! :)
CamperBot
@camperbot
Oct 07 2015 17:46
codingjv sends brownie points to @avil172 :sparkles: :thumbsup: :sparkles:
:warning: codingjv already gave avil172 points
Aleksander Gębicki
@Takumar
Oct 07 2015 17:47
@lizette112162 @Avil172 I tried to help half an hour about that waypoint: "Create a Form Element". User changed his web browser from Chrome to IE and it worked for him. I work on Firefox and it also work for me.
Elizabeth Hatleli
@TheHighPriestess
Oct 07 2015 17:47
Their tutorials don't take long..and they do help/
Avil
@Avil172
Oct 07 2015 17:47
@muzza96 HTML/CSS course on FCC was amazing, but i will do codeacademy one too(haven't done yet)
Jed
@codingjv
Oct 07 2015 17:48
@Takumar Thanks for mentioning Waypoint browser workaround (may give that a try).
CamperBot
@camperbot
Oct 07 2015 17:48
codingjv sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 411 | @takumar | http://www.freecodecamp.com/takumar
Corey Murray
@muzzaaa
Oct 07 2015 17:48
@TheHighPriestess awesome, I didn't want to miss out on anything but at the same time I want to feel like I'm progressing and not being bogged down by doing overkill on it
mjeff7
@mjeff7
Oct 07 2015 17:48
Does anyone have any offline dev environments to recommend more than just reloading in a browser to test repeatedly?
Aleksander Gębicki
@Takumar
Oct 07 2015 17:49

@lizette112162 your code:

<form action="/submit-cat-photo">
<input type="text" placeholder="cat photo URL">
</form>

works good.

Elizabeth Hatleli
@TheHighPriestess
Oct 07 2015 17:49
@muzza96 It would be helpful...and like I said...their tutorials don't take very long.
Avil
@Avil172
Oct 07 2015 17:49
@Takumar about 2 hours ago i also saw someone having the same issue
by the way, previously when i was doing the htm/css challenge myself, it passed in chrome, but now its not passing in chrome
Rita M
@lizette112162
Oct 07 2015 17:49
Thanks @Takumar
CamperBot
@camperbot
Oct 07 2015 17:49
lizette112162 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 412 | @takumar | http://www.freecodecamp.com/takumar
Pablo Regen
@PabloRegen
Oct 07 2015 17:49

Hi there. I can’t make the palindrome bonfire work. I believe my issue is with reverse() but can’t figure out how to make this work. Any help?

function palindrome(str) {
var x = str.replace(/[^\w]/g, "").toLowerCase(); // this seems to work

    return x.split('') === x.split('').reverse(); // this doersn’t work

   // this doesn’t work either
    var y = x.split('');
var z = y.reverse();
    return x  === z 

 // this doesn’t work either
  var z = x.split('').reverse();
Jed
@codingjv
Oct 07 2015 17:50
@Avil172 @Takumar Fwiw, I've been using Chrome and had that Waypoint issue.
Corey Murray
@muzzaaa
Oct 07 2015 17:51
@Avil172 I agree it was good but I noticed on youtube videos there were a few basic stuff not included in FCC
Jed
@codingjv
Oct 07 2015 17:51
@Takumar How did you get that cool code snapshot (black backround) to appear?
Avil
@Avil172
Oct 07 2015 17:52
@muzza96 i always refer to multiple sources. have some books/tutorial. it helps
@muzza96 by the way, which stuff you were talking about?
This message was deleted
Corey Murray
@muzzaaa
Oct 07 2015 17:54
@Avil172 which books do you recommend? for both HTML/CSS and JavaScript(including any specific frameworks)
@Avil172 Just setting up the code in the first place, adding breaks in code, splitting it up with horizontal lines etc
mjeff7
@mjeff7
Oct 07 2015 17:54
@PabloRegen You may be surprised at how test for array equality works. Try [] === []
Aleksander Gębicki
@Takumar
Oct 07 2015 17:55
@codingjv you have to use three backticks before and after the code. But before you do that, switch editor to "Compose mode" not "Chat" it will be easier to correct text for you.
wiki format
CamperBot
@camperbot
Oct 07 2015 17:55

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Avil
@Avil172
Oct 07 2015 17:56
@muzza96 "php, mysql, javascript and html 5 all in one for dummies"
mjeff7
@mjeff7
Oct 07 2015 17:56
Well thank you @camperbot . With that, I'll rephrase: Try [] === [] (or [1] === [1] if the empty arrays looks confusingly like boxes).
CamperBot
@camperbot
Oct 07 2015 17:56
mjeff7 sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 305 | @camperbot | http://www.freecodecamp.com/camperbot
Jed
@codingjv
Oct 07 2015 17:56
@Takumar Neat, thank you for posting. Also neat that you somehow got the camper to post the how-to.
CamperBot
@camperbot
Oct 07 2015 17:56
codingjv sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: codingjv already gave takumar points
Aleksander Gębicki
@Takumar
Oct 07 2015 17:58
@codingjv I wrote the command: wiki format. I don't want to call it again because it takes much place in the chat window.
Pablo Regen
@PabloRegen
Oct 07 2015 18:01
@mjeff7 I thought this is what I did since I split() the string. If y & z are now arrays, aren't I testing for array equality?
Aleksander Gębicki
@Takumar
Oct 07 2015 18:01
@codingjv I looked at your webpage: http://www.codingjv.com/ but it is not working - you haven't extended your domain?
Jed
@codingjv
Oct 07 2015 18:01
@Takumar Thank you for sharing 'wiki form..', I'll be sure to pass along if occasion arises.
CamperBot
@camperbot
Oct 07 2015 18:01
codingjv sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: codingjv already gave takumar points
mjeff7
@mjeff7
Oct 07 2015 18:03
@PabloRegen Try typing in what I posted and see what you get. It may surprise you.
Jed
@codingjv
Oct 07 2015 18:03
@Takumar Hm, should be ok on domain, just haven't had a chance to build it out with anything substantive. Perhaps as I'm able to put together a few neat apps for demo sake.
..thank you for taking a moment to view however :)
CamperBot
@camperbot
Oct 07 2015 18:04
if you want to thank someone, put an @ before their name!
Aleksander Gębicki
@Takumar
Oct 07 2015 18:04
@codingjv Ok. My first thought was that someone hacked your site.
Nicholas
@nick88p
Oct 07 2015 18:08
hey guys. Which tool do you use to share your screen?
What is recommended by freecodecamp and what is secure?
Aleksander Gębicki
@Takumar
Oct 07 2015 18:09
@nick88p Hi, recommended here is ScreenHero for pair programming.
Rex Schrader
@SaintPeter
Oct 07 2015 18:14
@nick88p Teamviewer is a cross platform alternative to Screenhero. You can also use colaborative sites like jsbin or Cloud 9
Pablo Regen
@PabloRegen
Oct 07 2015 18:14
@mjeff7 I tried but not getting the results. I’m not sure how to apply it to my case. [y] === [z] still doesn’t work. I believe the reverse() is screwing me
mjeff7
@mjeff7
Oct 07 2015 18:15
@PabloRegen What do you get when you do [1] === [1]? It should be true or false.
Pablo Regen
@PabloRegen
Oct 07 2015 18:15
Yes. But gets me false to “eye”.
@mjeff7 Yes. But gets me false to “eye”.
Bill
@kirah1314
Oct 07 2015 18:16
help screenhero
CamperBot
@camperbot
Oct 07 2015 18:16

:point_right: how to