These are chat archives for FreeCodeCamp/Help

18th
Sep 2015
efkar
@efkar
Sep 18 2015 00:17
Hello , im trying to add a property to object by myCar.engines=5 , which gets 5 is not a function error. am i doing it wrong?
Angel3115
@Angel3115
Sep 18 2015 00:22
Just getting started. How do you add two CSS classes to one element?
Omar
@oab00
Sep 18 2015 00:23
add space between classes
example: <div class="container primary"></div>
ninjatron
@ninjatron
Sep 18 2015 00:44
does anyone know C# or Angular
Robert Richey
@0x0936
Sep 18 2015 00:46
@efkar copy paste all of your code
@efkar actually, I was able to reproduce your error. You're missing a semi-colon after 5.
Greg
@theMugician
Sep 18 2015 00:50
This message was deleted
I am trying to add a switch statement that will change a background image according to the weather. Its from Zipline: Show the Local weather. Here is a link to my codepen as well.
http://codepen.io/theMugician/pen/ZbQaKK
`function background(image){
var bgImage = $('body').css('background', image);
return bgImage;
};
switch (main){
 case "Clear": background('url("https://static.pexels.com/photos/5645/sky-clouds-blue.jpg") no-repeat center;');
 break;

 case "Cloudy": background('url("https://static.pexels.com/photos/1679/sea-nature-beach-clouds.jpg") no-repeat center;');
 break;

  case "Mist": background('url("https://static.pexels.com/photos/1780/landscape-nature-clouds-cloudy.jpg") no-repeat center;');
 break;

 default: background('url("https://static.pexels.com/photos/5645/sky-clouds-blue.jpg") no-repeat center;');
}  ;`
IgnisCerebrum
@IgnisCerebrum
Sep 18 2015 01:16
Why isn't this right?
<h3  class="text-primary" class="text-center">jQuery Playground</h3>
Ansuke
@Ansuke
Sep 18 2015 01:36
This message was deleted
DJ
@qualitymanifest
Sep 18 2015 01:36
@IgnisCerebrum you declare multiple classes like this class="firstClass secondClass thirdClass"
Ansuke
@Ansuke
Sep 18 2015 01:37
Could someone explain to me what I am doing wrong here?
function titleCase(str) {

  var strArray = str.split(' ');

  for (i = 0; i < strArray.length; i++) {
    strArray[i].toLowerCase();
    strArray[i].charAt(0).toUpperCase();
  }

  str = strArray.join(' ');

  return str;
}

titleCase("I'm a little tea pot", "");
The above code is trying to solve Bonfire: Title Case a Sentence
Moisés Man
@moigithub
Sep 18 2015 01:39
help immutable
CamperBot
@camperbot
Sep 18 2015 01:39

:point_right: js immutable [wiki]

Immutable means unchangeable i.e. you can't change.

Javascript has lots of immutable types e.g. string primitive type. Try this in your console.

s = "red";
console.log(s[1]); //→ "e"
s[1] = "x";
console.log(s) //→ "red"

the s didn't change! WAT!

:pencil: read more about js immutable on the FCC Wiki

Moisés Man
@moigithub
Sep 18 2015 01:39
@Ansuke
DJ
@qualitymanifest
Sep 18 2015 01:39
@Ansuke well for one, you need to set everything to lower case in the beginning
Ansuke
@Ansuke
Sep 18 2015 01:40
@qualitymanifest Thats what I am doing here
strArray[i].toLowerCase();
@moigithub If an Array is immutable then how do I get a mutable Array?
DJ
@qualitymanifest
Sep 18 2015 01:43
oh yeah derp. missed that
BorneoBuzz
@BorneoBuzz
Sep 18 2015 01:46
Hello everyone!
Moisés Man
@moigithub
Sep 18 2015 01:47
array is not immutable.. string is... but u accessing array elements.. which ARE strings
u need to create a new string, and store that on the array
BorneoBuzz
@BorneoBuzz
Sep 18 2015 01:48
I'm having a bit of a difficulty with use an ID attribute to style an element
the first instruction says to give the form element the id of cat-photo-form..which I got this this right
however, the second instruction says "Your form element should have the background-color of green."
Since I can only have one ID in an element (in which this case is cat-photo-form), how do I set the form element to green background?
Ken Doman
@raykendo
Sep 18 2015 01:52
@BorneoBuzz How do you note an ID in CSS?
BorneoBuzz
@BorneoBuzz
Sep 18 2015 01:52
I have declared under <style> #cat-photo-element{background-color: green;}
Bill
@kirah1314
Sep 18 2015 01:52
@BorneoBuzz do you have the waypoint link? And what have you tried?
BorneoBuzz
@BorneoBuzz
Sep 18 2015 01:52
hey @raykendo id=""
It seems that I can't have 2 IDs in one single element
Ken Doman
@raykendo
Sep 18 2015 01:55

@BorneoBuzz yeah, I'd make your
'''

cat-photo-form { }

'''

CamperBot
@camperbot
Sep 18 2015 01:55
:bulb: to format code use backticks! ``` more info
Ken Doman
@raykendo
Sep 18 2015 01:56
#cat-photo-form
Bill
@kirah1314
Sep 18 2015 01:56
@BorneoBuzz you already have the correct codes, just press run test
BorneoBuzz
@BorneoBuzz
Sep 18 2015 01:57
Hah...that works! My brain is fried..Thanks alot @raykendo
CamperBot
@camperbot
Sep 18 2015 01:57
borneobuzz sends brownie points to @raykendo :sparkles: :thumbsup: :sparkles:
:star: 166 | @raykendo | http://www.freecodecamp.com/raykendo
Bill
@kirah1314
Sep 18 2015 01:57
the last check will turn green
#cat-photo-form { background-color: green; }
oh you have to change element to form :)
BorneoBuzz
@BorneoBuzz
Sep 18 2015 01:58
apparently, i just need to change the last word. Thanks alot @kirah1314 @raykendo
CamperBot
@camperbot
Sep 18 2015 01:58
borneobuzz sends brownie points to @kirah1314 and @raykendo :sparkles: :thumbsup: :sparkles:
:warning: borneobuzz already gave raykendo points
:star: 243 | @kirah1314 | http://www.freecodecamp.com/kirah1314
BorneoBuzz
@BorneoBuzz
Sep 18 2015 01:58
REally appreciate it!
Ansuke
@Ansuke
Sep 18 2015 02:01
I don't understand why this line of code doesn't work, I can modify a string but it is not uppercasing the first letter.
function titleCase(str) {

  var strArray = str.split(' ');
  var newStrArray = [];

  for (i = 0; i < strArray.length; i++) {
    var newString
    newString = strArray[i].toLowerCase();
    newString.charAt(0).toUpperCase();         // This line
    newStrArray.push(newString);
  }

  str = newStrArray.join(' ');

  return str;
}

titleCase("I'm a little tea pot", "");
Bill
@kirah1314
Sep 18 2015 02:03
@Ansuke strings are immutable, just declare a new variable
@Ansuke newString = newString.charAt(0).toUpperCase();
Ansuke
@Ansuke
Sep 18 2015 02:06
@kirah1314 If I do that then it will set the string to be the first letter of newString, I want to capitalize the first letter of newStri
ng
Bill
@kirah1314
Sep 18 2015 02:07
This message was deleted
@Ansuke i used replace() method actually
Ansuke
@Ansuke
Sep 18 2015 02:13
@kirah1314 Okay, I'll try that. Its just going to be hard writing a RegEx.
Bill
@kirah1314
Sep 18 2015 02:15
@Ansuke don't have to use regex for this. I used a new variable to store the first letter then used replace() to change first letter to uppercase
Rob
@BobsHub
Sep 18 2015 02:22
@ansuke you need to split the word into 2 separate substrings. try
var capital = newString.charAt(0).toUpperCase();
newStrArray.push(capital + newString.slice(1));
Bill
@kirah1314
Sep 18 2015 02:23
@Ansuke also the thing is you're trying to uppercase charAt(0) but the bonfire asks to uppercase every letter of each word
so you may want to check the for loop
Ansuke
@Ansuke
Sep 18 2015 02:27
I did as you said @BobsHub and it worked thank you but I don't understand how I would use .replace() to solve this bonfire @kirah1314. I lower case every word and try to uppercase only the first letter afterwards, this would work if strings were mutable so I am not sure where I am going wrong there. Could you show me the line in your solution where you use replace()?
CamperBot
@camperbot
Sep 18 2015 02:27
ansuke sends brownie points to @bobshub and @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 244 | @kirah1314 | http://www.freecodecamp.com/kirah1314
:star: 274 | @bobshub | http://www.freecodecamp.com/bobshub
Ansuke
@Ansuke
Sep 18 2015 02:28
Thank you @moigithub and @qualitymanifest for responding to me earlier as well
CamperBot
@camperbot
Sep 18 2015 02:28
ansuke sends brownie points to @moigithub and @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 217 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
:star: 354 | @moigithub | http://www.freecodecamp.com/moigithub
Bill
@kirah1314
Sep 18 2015 02:28
@Ansuke sure, this is what I used:
words[n] = words[n].replace(firstLetter, firstLetter.toUpperCase());
@Ansuke you're on the right track, just have to loop through the string and uppercase the first letter of each word
Ansuke
@Ansuke
Sep 18 2015 02:34
Yes, I got it now both solutions worked! Thank you for your help @kirah1314 !
CamperBot
@camperbot
Sep 18 2015 02:34
ansuke sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: ansuke already gave kirah1314 points
Bill
@kirah1314
Sep 18 2015 02:35
@Ansuke glad I can help!
Anthony DeGregorio
@ADG88
Sep 18 2015 03:04
hello all. if anyone is watching I have a noob question for you
DJ
@qualitymanifest
Sep 18 2015 03:05
bust it out
Michael Krebs
@michael-krebs
Sep 18 2015 03:07
I'm having trouble thinking asynchronously here
Anthony DeGregorio
@ADG88
Sep 18 2015 03:07

so I'm trying to get this function to reverse a given string, but I'm not sure how to make the commands address the string directly. here's my code: function reverseString(str) {
string.split("");
array.reverse();
array.join("");
return str;
}

reverseString("hello");
reverseString("Howdy");
reverseString("Greetings from Earth");

Haremantra
@haremantra
Sep 18 2015 03:07
Hi, I am on lesson 106 related to jQuery. In this lesson, you learn to use multiple jQuery selectors to target the same element. I do not understand how two selectors are taking unique actions, they appear duplicative. The selectors $(".btn") and $( "button"). Why are we doing this?

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

<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<h4>#left-well</h4>
<div class="well" id="left-well">
<button class="btn btn-default target" id="target1">#target1</button>
<button class="btn btn-default target" id="target2">#target2</button>
<button class="btn btn-default target" id="target3">#target3</button>
</div>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn btn-default target" id="target4">#target4</button>
<button class="btn btn-default target" id="target5">#target5</button>
<button class="btn btn-default target" id="target6">#target6</button>
</div>
</div>
</div>
</div>

DJ
@qualitymanifest
Sep 18 2015 03:09
@ADG88 use str instead of string/array
since str is what you're splitting/reversing/joining
Anthony DeGregorio
@ADG88
Sep 18 2015 03:11
@qualitymanifest wow, coding is an excellent way to humble yourself. it seems so obvious now. though I am now getting a message "str.reverse is not a function"
OverTheNeptune
@OverTheNeptune
Sep 18 2015 03:14
@adg88 reverse() is an array function if I recall, not a string function. you should be able to convert your string into an array using string.split()
DJ
@qualitymanifest
Sep 18 2015 03:15
so you can't just say str.split(""); you have to assign it to str like str = str.split("")
same with reverse and join
Heather Akers-Healy
@abbynormative
Sep 18 2015 03:16
evening all. anyone up to help on bonfire: inventory update? please private message
CamperBot
@camperbot
Sep 18 2015 03:16
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Anthony DeGregorio
@ADG88
Sep 18 2015 03:16
:smile: @qualitymanifest thanks!
CamperBot
@camperbot
Sep 18 2015 03:16
adg88 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 218 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Anthony DeGregorio
@ADG88
Sep 18 2015 03:16
@qualitymanifest I was running down that train of thought but couldn't quite get there. thanks for the push
CamperBot
@camperbot
Sep 18 2015 03:16
adg88 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: adg88 already gave qualitymanifest points
Heather Akers-Healy
@abbynormative
Sep 18 2015 03:16
bonfire inventory update
CamperBot
@camperbot
Sep 18 2015 03:16

:fire:Bonfire: Inventory Update :link:

function inventory(arr1, arr2) {
    // All inventory must be accounted for or you're fired!
    return arr1;
}

// Example inventory lists
var curInv = [
    [21, 'Bowling Ball'],
    [2, 'Dirty Sock'],
    [1, 'Hair Pin'],
    [5, 'Microphone']
];

var newInv = [
    [2, 'Hair Pin'],
    [3, 'Half-Eaten Apple'],
    [67, 'Bowling Ball'],
    [7, 'Toothpaste']
];

inventory(curInv, newInv);

Compare and update inventory stored in a 2d array against a second 2d array of a fresh delivery. Update current inventory item quantity, and if an item cannot be found, add the new item and quantity into the inventory array in alphabetical order.

more info:  bf details | bf links | hint

DJ
@qualitymanifest
Sep 18 2015 03:17
@ADG88 no problem. just so you know you can do it even cleaner: str = str.split("").reverse().join("");
Anthony DeGregorio
@ADG88
Sep 18 2015 03:17
@qualitymanifest cool! good to know
Rob
@BobsHub
Sep 18 2015 03:27
// lol at unclean way
var str = "abcde";
var reversed = '';
for(var i = str.length-1; i > -1; --i)
    reversed += str[i];
DJ
@qualitymanifest
Sep 18 2015 03:33
haha i like it. not too heinous anyway. i'd love to see someone solve all these with super obfuscated code
Luis Felipe López G.
@luishendrix92
Sep 18 2015 03:34
That's what reverse does to arrays anyway, lol.
but instead, it uses pushing
DJ
@qualitymanifest
Sep 18 2015 03:42
looks like someone actually made a JS code obfuscator
http://www.colddata.com/developers/online_tools/obfuscator.shtml
oh nevermind i guess it takes HTML and obfuscates it as JS
Rob
@BobsHub
Sep 18 2015 03:44
wow that looks wacky haha. So how would one re-fuse is :D
DJ
@qualitymanifest
Sep 18 2015 03:45
oh and it turns out there's actually a lot of services out there like that. here's one for JS:
http://www.danstools.com/javascript-obfuscate/index.php
@BobsHub how to de-obfuscate?? i can't imagine that's even possible, but you never know...
oh god! there are de-obfuscators!! just google javascript de-obfuscator
Camper1111
@Camper1111
Sep 18 2015 03:50
Hi campers I am stuck at creating a form element. Can someone help?
Ken Doman
@raykendo
Sep 18 2015 03:51
Hi @Camper1111 ! How can we help?
Camper1111
@Camper1111
Sep 18 2015 03:54
Nest your text input element within a form element. I am stuck at project 30. Thanks a lot dude.
CamperBot
@camperbot
Sep 18 2015 03:54
if you want to thank someone, put an @ before their name!
DJ
@qualitymanifest
Sep 18 2015 03:55
@Camper1111 can you post your code where you're trying to do that?
Camper1111
@Camper1111
Sep 18 2015 03:55
<input type= <form action="/sumbit-cat-photo"> </form> placeholder="cat photo URL">

Nest your text input element within a form element.

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

Make sure your form element has a closing tag.

Ken Doman
@raykendo
Sep 18 2015 03:58
@Camper1111 try to reverse that:
<form action="/sumbit-cat-photo"> 
  <input type="text"  placeholder="cat photo URL" />
</form>
You want to put your text input between the opening and closing form tags.
Camper1111
@Camper1111
Sep 18 2015 04:00
Thanks so much, so helpful.
CamperBot
@camperbot
Sep 18 2015 04:00
if you want to thank someone, put an @ before their name!
Camper1111
@Camper1111
Sep 18 2015 04:01
You are the man @raykendo
DJ
@qualitymanifest
Sep 18 2015 04:01
yeah, that. also you always have to do a closing angle bracket before you include another element
Jose E. Pimentel
@jedpimentel
Sep 18 2015 04:01
@qualitymanifest this site is pretty interesting http://www.jsfuck.com/
DJ
@qualitymanifest
Sep 18 2015 04:04
@jedpimentel hahaha! that's incredible
tva10
@tva10
Sep 18 2015 04:09
@jedpimentel heh, that works
John Oksasoglu
@oksas
Sep 18 2015 05:01
anyone with knowledge of jsonp willing to look at something and tell me what I'm doing wrong? D:
I'm pretty new to using APIs and am trying to use typeform's api to do some stuff on a web page. I used jsonp when I made my quote generator for fcc but I obviously don't understand it well enough haha since it's not working in this case and I don't really understand why
Sairina
@sairina
Sep 18 2015 05:03
Bonfire: Reverse a String - two questions: 1. Why do you not need to set str as a variable (e.g. var str = … instead of str = ) for the code to work? 2. Why does split and join need ‘’ ( e.g. .split('')) instead of just empty brackets? Thanks!
CamperBot
@camperbot
Sep 18 2015 05:03
Sorry, can't find a bonfire called reverse a string - two questions 1 why do you not need to set str as a variable eg var str instead of str for the code to work 2 why does split and join need eg split instead of just empty brackets thanks. [ Check the map? ]
Isaac
@BenBagBag
Sep 18 2015 05:11
@sairina: 1. By putting "str =", you are setting str as a variable. You're setting it as a global variable instead of a local variable, so it'll be accessible outside of your function (http://www.w3schools.com/js/js_scope.asp). 2. The value you're passing to the split/join functions is the delimeter that separates the things you're splitting/joining. Because you're working with a string, you need to give it a string, so you pass it empty quotation marks, which means you're giving it an empty string. Otherwise you're not passing it anything at all.
Sairina
@sairina
Sep 18 2015 05:14
@BenBagBag - thank you so much! Definitely feel like I'm challenged by some basics that I'm missing. Appreciate you helping to fill in some of those gaps in knowledge!
CamperBot
@camperbot
Sep 18 2015 05:14
sairina sends brownie points to @benbagbag :sparkles: :thumbsup: :sparkles:
:star: 210 | @benbagbag | http://www.freecodecamp.com/benbagbag
DJ
@qualitymanifest
Sep 18 2015 05:20
@BenBagBag that cat-sized macbook in your image is awesome! is that your picture?
Isaac
@BenBagBag
Sep 18 2015 05:48
@qualitymanifest Sadly, no, I sort of got it off of Google and then somehow everything autofilled across a bunch of different platforms.
DJ
@qualitymanifest
Sep 18 2015 05:52
@BenBagBag bummer, my cats need laptops. great icon though
Ali-Haider5
@Ali-Haider5
Sep 18 2015 06:09
This message was deleted
Nick Hu
@nicholashu
Sep 18 2015 06:10
This message was deleted
Jeremy "Ibi-Wan" Kent "...obi"
@ibiwan
Sep 18 2015 06:56
how do I update my portfolio with a new solution to an item?
Aleksandar B.
@aleksandar-b
Sep 18 2015 07:24
@ibiwan just put a new url
Jeremy "Ibi-Wan" Kent "...obi"
@ibiwan
Sep 18 2015 07:24
bonfire, not zipline
CamperBot
@camperbot
Sep 18 2015 07:24
Sorry, can't find a bonfire called not zipline. [ Check the map? ]
Aleksandar B.
@aleksandar-b
Sep 18 2015 07:27
@ibiwan I think you can't do it. You can only make another solution, but old solution will stay
Jeremy "Ibi-Wan" Kent "...obi"
@ibiwan
Sep 18 2015 07:27
dang.
Aleksandar B.
@aleksandar-b
Sep 18 2015 07:28
@ibiwan It is not so bad. After all only you can see your solutions
Jeremy "Ibi-Wan" Kent "...obi"
@ibiwan
Sep 18 2015 07:28
well a) my portfolio isn't public?
and b) but I want to go back and see my good solutions to things for reference later if I'm doing something similar
Aleksandar B.
@aleksandar-b
Sep 18 2015 07:30
@ibiwan b) I thought that you are talking about bonfires
b)save it in another place
Jeremy "Ibi-Wan" Kent "...obi"
@ibiwan
Sep 18 2015 07:30
q) ok
sorry I'm calling this my portfolio. perhaps chose the wrong word
Aleksandar B.
@aleksandar-b
Sep 18 2015 07:32
@ibiwan I can not see your bonfire solutions, neither you can see my solutions. It is a recent change..
Jeremy "Ibi-Wan" Kent "...obi"
@ibiwan
Sep 18 2015 07:32
kk
Prashanth
@dgprashanth
Sep 18 2015 08:01
Guys, I need some help with the pomodoro timer. Will post the link here. I have got the session duration to change by pressing buttons, but I am unable to edit the starting value of the timer which I can set. I think it has something to do with the scope! Help PLease :)
Dealga McArdle
@zeffii
Sep 18 2015 08:26
@dgprashanth great to see someone using canvas for the pomodoro!
Prashanth
@dgprashanth
Sep 18 2015 08:27
@zeffii Thanks :smile:
CamperBot
@camperbot
Sep 18 2015 08:27
dgprashanth sends brownie points to @zeffii :sparkles: :thumbsup: :sparkles:
:star: 366 | @zeffii | http://www.freecodecamp.com/zeffii
Dealga McArdle
@zeffii
Sep 18 2015 08:27
I don't understand your question.
Prashanth
@dgprashanth
Sep 18 2015 08:32
@zeffii Okay, I will try to explain it a bit better! I have 2 functions that change the session duration and break duration when clicking on the '+
and the "-" buttons
I need to assign whatever value is being shown after a click onto the countTo variable, which is inside another function, after the button functions(which i mentioned above)
If session duration shows 26 after I press "+", then I want the countTo variable(which is in the canvas function to show the same variable as well
Soumya Rauth
@soumyaRauth
Sep 18 2015 08:42

Whats wrong with this code

```
var lis="<li>"+"<img src=\"json.logo\">"+"</li>"
   $(".all_channels").append(lis);

```

.all_channels is within <ul>
Aleksandar B.
@aleksandar-b
Sep 18 2015 08:49
src=\"json.logo\" this is not good
is first backslash necessary?
also, try using single quotes for src, like src='json.logo'
Dealga McArdle
@zeffii
Sep 18 2015 09:02
@dgprashanth i think that if you managed to code the canvas stuff yourself, that the timer logic is pretty trivial!
so unless you've struggled with it for a day.. i'm inclined not to rob you of the pleasure of figuring it out..
azaleas
@azaleas
Sep 18 2015 09:11
This message was deleted
Corbin Brill
@Corbin-B
Sep 18 2015 09:16
Hi can anyone help me with Use a CSS Class to Style an Element

<style>
h2 {
color: blue;
}
</style>

<h2>CatPhotoApp</h2>

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

azaleas
@azaleas
Sep 18 2015 09:19

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

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

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

Corbin Brill
@Corbin-B
Sep 18 2015 09:19
Thank you sio much
CamperBot
@camperbot
Sep 18 2015 09:19
if you want to thank someone, put an @ before their name!
Corbin Brill
@Corbin-B
Sep 18 2015 09:20
@azaleas Thank you
CamperBot
@camperbot
Sep 18 2015 09:20
corbin-b sends brownie points to @azaleas :sparkles: :thumbsup: :sparkles:
:star: 188 | @azaleas | http://www.freecodecamp.com/azaleas
Dealga McArdle
@zeffii
Sep 18 2015 09:29
This message was deleted
Binny Kim
@removed~BinnyK
Sep 18 2015 10:02
Has anyone fully completed Waypoint: Manage Packages with NPM?
Rolands Jegorovs
@Rolandisimo
Sep 18 2015 10:17
@BinnyK I just wanted to ask that. Have an error at step "Publish Again"
node-js-tutorial - Cloud9 - Mozilla Firefox 2015-09-18 13.15.56.png
Binny Kim
@removed~BinnyK
Sep 18 2015 10:18
@Rolandisimo Same... really annoying. I've searched the chat and it looks like the 3-4 other people who've asked didn't get a reply... I'm just moving onto the node tutorial now...
Rolands Jegorovs
@Rolandisimo
Sep 18 2015 10:19
Could someone please help with the NPM challenges.
20Martin15
@20Martin15
Sep 18 2015 10:20
Rolands Jegorovs
@Rolandisimo
Sep 18 2015 10:20
@BinnyK Sad, that the challenge does not include a Plan B, you know? For stuff like these. Because as experience shows, some errors are just out-of-the-persons-league
@20Martin15 What's the problem?
Binny Kim
@removed~BinnyK
Sep 18 2015 10:46
@Rolandisimo Yeah I couldn't find much help on google. Only did a quick look though.
Fahad Uddin
@FahadUddin92
Sep 18 2015 10:50
I am stuck with Angular JS
Rustam Turaev
@rustamturaev
Sep 18 2015 10:58
I need help with Waypoint: Make Object Properties Private
It says: See if you can keep myBike.speed and myBike.addUnit private, while making myBike.getSpeed publicly accessible.
Rustam Turaev
@rustamturaev
Sep 18 2015 11:16

I completed the assignment but it is not clear to me how myBike.addUnit is private? Here is the code var Bike = function() {
speed = 100;
function addUnit(value) {
return value + "KM/H";
}

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

};

// Only change code above this line.
var myCar = new Car();
var myBike = new Bike();

And how is myBike.getSpeed is publicly accessible if we attach "this." before it?
Rustam Turaev
@rustamturaev
Sep 18 2015 11:21
I guess I just need a breakdown if this assighment.
Coira Ellison
@Coira
Sep 18 2015 11:25
@rustamturaev i think this is one of those things that are "just is". If you have an object (e.g. Car) and it has a method (e.g. addUnit() ), then that method is public if it has this. before it, otherwise it's private
Yashaswi Yogeshwara
@yashaswiyogeshwara
Sep 18 2015 11:41

Bonfire : Return largest numbers in arrays
Please let me know where did i go wrong in the program

`function largestOfFour(arr) {
// You can do this!
var max =[];
var val=0;
for(var i=0;i<arr.length;i++)
{
max[i]=(function(arr){
return Math.max.apply(null,arr)
})(arr[i]);
if(val<max[i])
{
console.log(val);
val = max[i]

  }
}
var index = max.indexOf(val);
console.log(arr[index]);

return arr[index];
}
`

Ali-Haider5
@Ali-Haider5
Sep 18 2015 12:14
Bonfire: Confirm the Ending
CamperBot
@camperbot
Sep 18 2015 12:14

:fire:Bonfire: Confirm the Ending :link:

function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  return str;
}

end('Bastian', 'n');

Check if a string (first argument) ends with the given target string (second argument).

more info:  bf details | bf links | hint

Ali-Haider5
@Ali-Haider5
Sep 18 2015 12:14
hint
CamperBot
@camperbot
Sep 18 2015 12:14
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Alex Z
@bookw0rm
Sep 18 2015 12:50
<label>
<input type="radio" name="indoor-outdoor" />
</label>
<label>
<input type="radio" name="indoor-outdoor" />
</label>
the following code doesn't work and I don't know why
One of your radio buttons should have the label indoor.
One of your radio buttons should have the label outdoor.
how do I set the label name on radio buttons ? I've tried everything with no luck
nevermind I'm stupid :))) figured it out myself
:))))
Odysseas Samaras
@odysseas
Sep 18 2015 12:57
Guys I need some help with bootstrap. I'm doing the pomodoro zipline here http://codepen.io/odysseas/pen/zvqZva . How would I make the div with the border containing the timer not be so wide, but only be as wide as the clock? Do I need to use absolute values?
Rory Smith
@alanbuchanan
Sep 18 2015 13:39
can anyone good with yeoman/bower/grunt please help me with this infuriating mess i've got myself into
phoosiangchuen
@phoosiangchuen
Sep 18 2015 13:42
Hi, I am working on palidrome. Is there a way to output function result? It's challenging to debug the code just looking at the assert results.
Coira Ellison
@Coira
Sep 18 2015 13:44
@phoosiangchuen have a look at this waypoint first http://www.freecodecamp.com/challenges/waypoint-use-the-javascript-console
Jason Wood
@catapixel
Sep 18 2015 13:45
@phoosiangchuen or just use the return to get whatever you're interested in. You can always put the code back later.
phoosiangchuen
@phoosiangchuen
Sep 18 2015 14:05
@catapixel Thanks, I am able to proceed to next challenge now. :)
CamperBot
@camperbot
Sep 18 2015 14:05
phoosiangchuen sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 376 | @catapixel | http://www.freecodecamp.com/catapixel
Jason Wood
@catapixel
Sep 18 2015 14:07
@phoosiangchuen :thumbsup:
Christoffer92
@Christoffer92
Sep 18 2015 14:12
//Bonfire: Sum All Odd Fibonacci Numbers
function sumFibs(num) {

  var firstNum = 0;
  var secoundNum = 0;
  var fibNum = 0;
  var sum = 0;

  while (num < fibNum){

    fibNum = firstNum + secoundNum;
    //console.log(fibNum);

    if (fibNum % 2 != 0){
      sum += fibNum;
      //console.log(sum);
    }

    firstNum = secoundNum;
    //console.log(firstNum);
    secoundNum = fibNum;
    //console.log(secoundNum);
  }

  console.log(sum);

  return sum;
}

sumFibs(5);
//Tested with: 5, did not work.
//Made by: Christoffer92
Cant seem to get it to work, it just returns 0 :s
sum all odd fibonacci numbers
CamperBot
@camperbot
Sep 18 2015 14:12
Sorry, can't find a bonfire called sum all odd fibonacci numbersfunction sumfibsnum var firstnum 0 var secoundnum 0 var fibnum 0 var sum 0 while num fibnum fibnum firstnum secoundnum consolelogfibnum if fibnum 2 0 sum fibnum consolelogsum firstnum secoundnum consolelogfirstnum secoundnum fibnum consolelogsecoundnum consolelogsum return sumsumfibs5tested with 5 did not workmade by christoffer92cant seem to get it to work it just returns 0 s. [ Check the map? ]
Prashanth
@dgprashanth
Sep 18 2015 14:17
@odysseas Yeah, I would use Absolute values for the width of the div
Coira Ellison
@Coira
Sep 18 2015 14:17
@Christoffer92 it's not going through your while loop
console.log(num, fibNum); \\ ---> 4 0
Christoffer92
@Christoffer92
Sep 18 2015 14:27
@Coira thanks changed the program in some areas, though there are still 2 tests failing:
//Bonfire: Sum All Odd Fibonacci Numbers
function sumFibs(num) {

  var firstNum = 1;      //changed to 1;
  var secoundNum = 0;
  var fibNum = 0;
  var sum = 0;

  while (num-1 > fibNum){      //changed to num-1 > fibNum

    fibNum = firstNum + secoundNum;
    //console.log(fibNum);

    if (fibNum % 2 != 0){
      sum += fibNum;
      //console.log(sum);
    }

    firstNum = secoundNum;
    //console.log(firstNum);
    secoundNum = fibNum;
    //console.log(secoundNum);
  }

  console.log(sum);

  return sum;
}

sumFibs(1785);
//Tests succeded: 75025, 4
//Tests failed: 1785, 75024
//Made by: Christoffer92
CamperBot
@camperbot
Sep 18 2015 14:27
christoffer92 sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 219 | @coira | http://www.freecodecamp.com/coira
APM
@APMerchant
Sep 18 2015 14:34
hey, i am stuck on finding a string in another string....a bonfire. can anyone help?
does IndexOf function only find another string which is in order or scrambled up?
Coira Ellison
@Coira
Sep 18 2015 14:41
@APMerchant I'm not sure what you mean by scrambled up, but this might help https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf
APM
@APMerchant
Sep 18 2015 14:50
I am reading that page...my question is that it works for things like hel...in hello, but does it work for ehl in hello?
@Coira
Coira Ellison
@Coira
Sep 18 2015 14:50
no, just 'hel'
APM
@APMerchant
Sep 18 2015 14:51
thanks @Coira thats my question
CamperBot
@camperbot
Sep 18 2015 14:51
apmerchant sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 220 | @coira | http://www.freecodecamp.com/coira
APM
@APMerchant
Sep 18 2015 14:52
did you complete the bonfires as yer?
Coira Ellison
@Coira
Sep 18 2015 14:54
yep, on ziplines now, taking a bit longer than i imagined
APM
@APMerchant
Sep 18 2015 14:55
oh ok...still stuck on mutations...not all my tests are running as intended :worried:
Fabio
@FabioSeves
Sep 18 2015 14:55
Hi, Iam having problems with Pulling from a Remote. I'm not sure how to fill $ git pull <REMOTENAME> <BRANCHNAME>
Coira Ellison
@Coira
Sep 18 2015 14:56
@APMerchant if you post your code i can take a look at it
APM
@APMerchant
Sep 18 2015 14:57

@Coira here it is

function mutation(arr) {
var answer = true;
var i = 0;
arr0 = arr0.toLowerCase();
arr1 = arr1.toLowerCase();
if(arr0.indexOf(arr1) == -1)
if(arr0 !== arr1)
answer = false;
return answer;
}

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

Coira Ellison
@Coira
Sep 18 2015 15:01
@APMerchant this part here
 if(arr[0].indexOf(arr[1]) == -1) {
    if(arr[0] !== arr[1])
      answer = false;
  }
can you explain what you're doing?
APM
@APMerchant
Sep 18 2015 15:03
yep....it checks if the second element is in the first element of the array.
thenif its there, checks if both the elents are the same...
oh wait, i think i got it
i have to use the length property
Coira Ellison
@Coira
Sep 18 2015 15:06
@APMerchant hey, sent you a private message
Bill Zerega
@dedicatedfuture
Sep 18 2015 15:46
good afternoon everyone
Elizabeth Hatleli
@TheHighPriestess
Sep 18 2015 15:50
Can someone tell me why this is returning only 4 instead of 3,4?
function drop(arr, func) {

    arrayLength = arr.length;
    console.log(arrayLength);

    var shifted = arr[0];

    if (func(arr[0]) === true){
        return arr;
    }

    for (var i=0;i<arrayLength;i++){

        if (func(shifted) === true){
           return arr;
        }


        else {
          shifted = arr.shift();
        }

    }//end for


return arr;
}

//drop([1, 2, 3], function(n) {return n > 0; });
//drop([1, 2, 3, 4], function(n) {return n > 5; });
drop([1, 2, 3, 4], function(n) {return n >= 3; });
I have gone over and over it....and to me...it should be returning 3,4...as the Bonfire wants. However, it only returns 4
Bill Zerega
@dedicatedfuture
Sep 18 2015 15:52
can anyone help me with some formating issues on Zipline: Use the Twitchtv JSON API
Bill Zerega
@dedicatedfuture
Sep 18 2015 15:58
has anyone completed Zipline: Use the Twitchtv JSON API?
i could use some help working out some bugs
gee-oge
@gee-oge
Sep 18 2015 15:58
@catapixel I've resolved the issues I was having yesterday
Bill Zerega
@dedicatedfuture
Sep 18 2015 16:03
@frogmorton you around?
@ArielLeslie You around?
Coira Ellison
@Coira
Sep 18 2015 16:11
@TheHighPriestess did you work out your problem?
matoula
@matoulam
Sep 18 2015 16:17
can anyone help me with: Bonfire: Reverse a String pleasee
CamperBot
@camperbot
Sep 18 2015 16:17
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
gee-oge
@gee-oge
Sep 18 2015 16:18
@catapixel str = str.replace(/[\s\W_]/g, "");
Bill Zerega
@dedicatedfuture
Sep 18 2015 16:22
@Motolans str.split("").reverse().join("");
@Motolans gimme my brownie points
Elizabeth Hatleli
@TheHighPriestess
Sep 18 2015 16:25
@Coira I figured out some of it...but then when I pasted it into the Bonfire....it threw me another error.
Coira Ellison
@Coira
Sep 18 2015 16:25
@TheHighPriestess post your code again
Elizabeth Hatleli
@TheHighPriestess
Sep 18 2015 16:26
function drop(arr, func) {

    arrayLength = arr.length;
    console.log(arrayLength);

    var shifted;
    var test = arr[0];

    if (func(arr[0]) === true){
        return arr;
    }

    for (var i=0;i<arrayLength;i++){

        if (func(arr[i-1]) === true){
           return arr;
        }


        else {
          shifted = arr.shift();
        }

    }//end for


return arr;
}

//drop([1, 2, 3], function(n) {return n > 0; });
//drop([1, 2, 3, 4], function(n) {return n > 5; });
//drop([1, 2, 3, 4], function(n) {return n >=3; });
drop([1, 2, 3, 7, 4], function(n) {return n > 5; });
See....this last test...was added, it seems...after I tried to submit my other tests.
..and this last test returns 3,7,4 instead of just 7,4
Coira Ellison
@Coira
Sep 18 2015 16:27
hm, i'll take a look
Elizabeth Hatleli
@TheHighPriestess
Sep 18 2015 16:28
Just when I thought I had it working...I pasted it into the Bonfire...and it threw me another test
Coira Ellison
@Coira
Sep 18 2015 16:29
@TheHighPriestess ah, you're pretty close, change arr[i-1] to arr[0]
Elizabeth Hatleli
@TheHighPriestess
Sep 18 2015 16:33
@Coira You're my new best friend LOL Thank you.
CamperBot
@camperbot
Sep 18 2015 16:33
thehighpriestess sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 221 | @coira | http://www.freecodecamp.com/coira
Elizabeth Hatleli
@TheHighPriestess
Sep 18 2015 16:33
I knew that I was REALLY close...
but I was getting so tired of looking at it
Coira Ellison
@Coira
Sep 18 2015 16:34
lol, np :)
sometimes your brain just turns to mush after staring at it for so long!
Elizabeth Hatleli
@TheHighPriestess
Sep 18 2015 16:35
Yeah....I was having truoble looking at it with fresh eyes
chromuh
@chromuh
Sep 18 2015 16:45
the javascript section is kicking my ass
could use some help on this part
var Car = function() {
   this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();

this.engines = 4;






//Add the property "engines" to myCar, and make it a number.


// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
Luís Melo
@luisfmelo
Sep 18 2015 16:45
@chromuh i can try to help you :p
chromuh
@chromuh
Sep 18 2015 16:46
i know it's something simple @MrHormonas
it just feels like i am reading the instructions improperly or maybe the lack there-of
tva10
@tva10
Sep 18 2015 16:46
@chromuh you use this in other scope
Luís Melo
@luisfmelo
Sep 18 2015 16:46
so, Car is an object...
wheels is a property of that object
chromuh
@chromuh
Sep 18 2015 16:46
right
Luís Melo
@luisfmelo
Sep 18 2015 16:46
you have to use this.engines inside the function
because the keyword `this
tva10
@tva10
Sep 18 2015 16:47
@chromuh or you should write myCar.engines
Luís Melo
@luisfmelo
Sep 18 2015 16:47
is refering to the Object Car...
later... you may have VW, Opel, Fiat,... which are all Cars
and all of them would have wheels and engines
chromuh
@chromuh
Sep 18 2015 16:48
ok i believe i understand
thanks @MrHormonas and @tva10
CamperBot
@camperbot
Sep 18 2015 16:48
chromuh sends brownie points to @mrhormonas and @tva10 :sparkles: :thumbsup: :sparkles:
:star: 231 | @tva10 | http://www.freecodecamp.com/tva10
:star: 262 | @mrhormonas | http://www.freecodecamp.com/mrhormonas
chromuh
@chromuh
Sep 18 2015 16:48
i guess i just am over thinking some of these later sections
Luís Melo
@luisfmelo
Sep 18 2015 16:48
anytime ;)
chromuh
@chromuh
Sep 18 2015 16:49
like i feel as though there is all of a sudden less hand holding lol
Altaf Shaikh
@altaf933
Sep 18 2015 16:54
I am created nested a element in p tag but still not accepted .
'<p>Web browsing at the speed of light. <a href="http://ad.example.com/?adid=375&pubid=1422">This is two link <a href="www.willdo.com"> ok will do that</a>.</a></p>'
Jack Demynn
@infectiouscode
Sep 18 2015 16:54
Hey guys, im stuck on this, how do i get it to read the false answer?
// Not sure where to begin? Check the Hint!

if  ("10 x 10 = 5") { true
} 

else  {("I finished my first course!");
}
Jack Demynn
@infectiouscode
Sep 18 2015 17:00
:/
tva10
@tva10
Sep 18 2015 17:02
@infectiouscode
if(10*10 ===5){
   console.log('true');
}
 else{
   console.log('false');
}
but I'm not shure what you mean
chanhi2000
@chanhi2000
Sep 18 2015 17:03
Hi, guys. I'm stuck on this problem. Can someone explain why my code wouldn;t pass?
'''
CamperBot
@camperbot
Sep 18 2015 17:03
:bulb: to format code use backticks! ``` more info
Mateja Trifunovski
@Matko95
Sep 18 2015 17:03
it's probably a course from codecademy @tva10
chanhi2000
@chanhi2000
Sep 18 2015 17:03
'''
var = function truncate(str, num) {
// Clear out that junk in your trunk
var j = str.slice(0, num).split(" ")
if (num >= str.length) {
return j.join(" ") + "...";
} else {
return j.slice(0, j.length-1).join(" ") + "...";
}
}"""
CamperBot
@camperbot
Sep 18 2015 17:03
:bulb: to format code use backticks! ``` more info
Mateja Trifunovski
@Matko95
Sep 18 2015 17:03
@chanhi2000 use backticks for formatting "```"
chanhi2000
@chanhi2000
Sep 18 2015 17:04
var = function truncate(str, num) {
  // Clear out that junk in your trunk
  var j = str.slice(0, num).split(" ")
  if (num >= str.length) {
    return j.join(" ") + "...";
  } else {
    return j.slice(0, j.length-1).join(" ") + "...";
  }
}
ah thanks!
CamperBot
@camperbot
Sep 18 2015 17:04
if you want to thank someone, put an @ before their name!
tva10
@tva10
Sep 18 2015 17:04
@Matko95 mmm codecademy. Never been where.
chanhi2000
@chanhi2000
Sep 18 2015 17:04
@Matko95 thanks so much
CamperBot
@camperbot
Sep 18 2015 17:04
chanhi2000 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 322 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Sep 18 2015 17:04
@chanhi2000 you can't only cut to num, you need to count in 3 more spaces for the three dots
and in your else statement you only need to return str
not sure what you're trying to do there
chanhi2000
@chanhi2000
Sep 18 2015 17:06
@Matko95 I made case statements because i previously made a variable that saves an array of words splitted by space
@Matko95 and if the num I input is bigger than the length of the string input, I simply have to join them, else, I'll truncate the last part.
Mateja Trifunovski
@Matko95
Sep 18 2015 17:07
@chanhi2000 you don't need the split function since you don't manipulate the array
@chanhi2000 you just need to change your slice, so it includes the 3 places for the 3 dots
@chanhi2000 and if num is less than str.length you need to return the original string
chanhi2000
@chanhi2000
Sep 18 2015 17:09
isn't it opposite? num is how much you want to take out of string
@Matko95 you would want to return original string if num is bigger than str.length
Mateja Trifunovski
@Matko95
Sep 18 2015 17:10
bf truncate
CamperBot
@camperbot
Sep 18 2015 17:10

:fire:Bonfire: Truncate a string :link:

function truncate(str, num) {
  // Clear out that junk in your trunk
  return str;
}

truncate('A-tisket a-tasket A green and yellow basket', 11);

Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a '...' ending.

more info:  bf details | bf links | hint

Mateja Trifunovski
@Matko95
Sep 18 2015 17:10
bf details
CamperBot
@camperbot
Sep 18 2015 17:10

:fire:Bonfire: Truncate a string :link:

function truncate(str, num) {
  // Clear out that junk in your trunk
  return str;
}

truncate('A-tisket a-tasket A green and yellow basket', 11);
Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a '...' ending.
Note that the three dots at the end add to the string length.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Mateja Trifunovski
@Matko95
Sep 18 2015 17:10
@chanhi2000 Truncate a string (first argument) if it is longer than the given maximum string length (second argument).
chanhi2000
@chanhi2000
Sep 18 2015 17:13
@Matko95 oh okay. truncate a string when the length of first argument (string) is bigger than the second argument (num)
Randall Mason
@ClashTheBunny
Sep 18 2015 17:13
Hi there
Mateja Trifunovski
@Matko95
Sep 18 2015 17:14
@chanhi2000 yep, and if it's less you just return the first argument
chanhi2000
@chanhi2000
Sep 18 2015 17:15
var = function truncate(str, num) {
  // Clear out that junk in your trunk
  var j = str.slice(0, num).split(" ")
  if (num < str.length) {
    return str;
  } else {
    return j.slice(0, j.length-1).join(" ") + "...";
  }
}
Randall Mason
@ClashTheBunny
Sep 18 2015 17:15
I've got a question about the formatting of the function call at the end of most exercises:
function("bla","bla","")
They always seem to include an extra zero length string.
chanhi2000
@chanhi2000
Sep 18 2015 17:15
@Matko95 isn't my if statement already doing this? (i edited the inside)
@Matko95 nvm. i'm fixing some part
Mateja Trifunovski
@Matko95
Sep 18 2015 17:16
@chanhi2000 do you know what j.slice(0, j.length-1).join(" ") + "..."; this does?
Randall Mason
@ClashTheBunny
Sep 18 2015 17:16
I assume it's because of the test harness or something.
Mateja Trifunovski
@Matko95
Sep 18 2015 17:16
@ClashTheBunny Someone recently added that, don't worry about it
chanhi2000
@chanhi2000
Sep 18 2015 17:16
@Matko95 I do a little bit.
Randall Mason
@ClashTheBunny
Sep 18 2015 17:17
My problem is that on the array arguments bonfire (Bonfire: Seek and Destroy) it is significant.
chanhi2000
@chanhi2000
Sep 18 2015 17:17
oh
@Matko95 It worked!
@Matko95 Thanks Matko95
CamperBot
@camperbot
Sep 18 2015 17:17
chanhi2000 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:warning: chanhi2000 already gave matko95 points
Mateja Trifunovski
@Matko95
Sep 18 2015 17:18
@chanhi2000 np
@camperbot i think it's not included there
Randall Mason
@ClashTheBunny
Sep 18 2015 17:18
If my array contains a "", the code will remove it. If my arguments object doesn't account for it, by slicing it off, the tests fail.
Just want to make sure that this has been considered.
Or should I file a bug?
Mateja Trifunovski
@Matko95
Sep 18 2015 17:20
@ClashTheBunny i just logged the arguments from seek and destroy, and it logs this [1, 2, 3, 1, 2, 3]
Randall Mason
@ClashTheBunny
Sep 18 2015 17:20
Now call it with destroyer([1, 2, 3, 1, "", 2, 3], 2, 3, "");
Mateja Trifunovski
@Matko95
Sep 18 2015 17:20
why would you call it like that?
Randall Mason
@ClashTheBunny
Sep 18 2015 17:21
Depending on the student's solution, it will either be correct or incorrect.
Mateja Trifunovski
@Matko95
Sep 18 2015 17:21
it works for me still
Randall Mason
@ClashTheBunny
Sep 18 2015 17:24
It's not as much about just getting the answer and moving on. Programming is replete with off-by-one errors. This is a classic example of if there is one more argument, it could mess things up for a poorly coded solution.
Let's say you solution is Array.prototype.slice.call(arguments,1,arguments.length - 1); because you include the existence of the double quotes at the end and try to account for it. Your tests all fail with off by one errors.
If you don't include it, and you execute your code in JSBin or on node, you can remove elements that shouldn't be removed.
subhadeepgayen
@subhadeepgayen
Sep 18 2015 17:38
Please help, in this twitch.tv frontend project, i am just trying out showing users name and if user is online, but the results are completely random, that is, onnline or offline should be below each user but it gets randomly placed, what is the reason behind it? Is there any ways it can be placed below each user and not randomly http://codepen.io/subhadeepgayen/pen/PPNXGq
Rex Schrader
@SaintPeter
Sep 18 2015 17:41
@subhadeepgayen All AJAX queries are asynchrnous (that's what the 'A' stands for). That means that they occur in whatever order they complete. As you launch the requests across the web, any number of factors can affect which request is completed first: network latency, other network traffic, other requests to twitch.tv, and however long twich.tv takes to respond. Assume that every single one of these items is completely random. That means that you're going to get them back in random order every time.
@subhadeepgayen You can sort your items, if you like, doing an insertion sort with each item you get back.
Ariel
@ArielLeslie
Sep 18 2015 17:47
@subhadeepgayen :point_up_2: I would probably create an object for each user and then later do whatever formatting I want using those objects
Christoffer92
@Christoffer92
Sep 18 2015 18:04
Hi i need some help with the Bonfire: Sum All Odd Fibonacci Numbers
//Bonfire: Sum All Odd Fibonacci Numbers
function sumFibs(num) {

  var firstNum = 1; 
  var secoundNum = 1;
  var fibNum = 2;
  var sum = 2;

  while (num-1 > fibNum){

    fibNum = firstNum + secoundNum;

    if (fibNum % 2 != 0 && fibNum < num){
      sum += fibNum;
      console.log(fibNum, sum); //Look bottom to see the log.
    }

    firstNum = secoundNum;
    secoundNum = fibNum;


  }

  console.log(sum);

  return sum;
}

sumFibs(75025);
//Tests succeded: 1000, 4000000. 4. 75024.
//Tests failed: 75025.
//Made by: Christoffer92

/*Console Log:
3 5
5 10
13 23
21 44
55 99
89 188
233 421
377 798
987 1785
1597 3382
4181 7563
6765 14328
17711 32039
28657 60696
60696*/
I dont know why it cant past the last test. 75025. Also camper bot: Sum All Odd Fibonacci Numbers
CamperBot
@camperbot
Sep 18 2015 18:06
Sorry, can't find a bonfire called sum all odd fibonacci numbersfunction sumfibsnum var firstnum 1 var secoundnum 1 var fibnum 2 var sum 2 while num-1 fibnum fibnum firstnum secoundnum if fibnum 2 0 fibnum num sum fibnum consolelogfibnum sum look bottom to see the log firstnum secoundnum secoundnum fibnum consolelogsum return sumsumfibs75025tests succeded 1000 4000000 4 75024tests failed 75025made by christoffer92console log3 55 1013 2321 4455 9989 188233 421377 798987 17851597 33824181 75636765 1432817711 3203928657 6069660696i dont know why it cant past the last test 75025 also camper bot sum all odd fibonacci numbers. [ Check the map? ]
Rex Schrader
@SaintPeter
Sep 18 2015 18:07
@Christoffer92 You need to include the last num - try <=
Christoffer92
@Christoffer92
Sep 18 2015 18:13
@SaintPeter Thanks Changed it in my while loop and in my if fibNum < num :D It worked :D How could i have forgot about =<. Also now i can remove the stupid num-1 in my for loop :D
CamperBot
@camperbot
Sep 18 2015 18:13
christoffer92 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 655 | @saintpeter | http://www.freecodecamp.com/saintpeter
x34passenger
@x34passenger
Sep 18 2015 18:29
I am not sure how to vertically put ample spaces between each button on the forth page
http://codepen.io/x34passenger/pen/KdwjEB
jb299
@jb299
Sep 18 2015 18:34
Does anyone use Brackets live preview to work on the ziplines?
x34passenger
@x34passenger
Sep 18 2015 18:40
for the random quote machine how do you make the font cursive? http://codepen.io/AdventureBear/full/vEoVMw
Dealga McArdle
@zeffii
Sep 18 2015 18:45
@x34passenger either import an italic font.. or use the <i> </i> tags around the text
Ariel
@ArielLeslie
Sep 18 2015 18:50
@zeffii I think the best practice now is to use <em> </em> instead of <i> </i>
Roman
@Rome21
Sep 18 2015 18:59

Hello everyone, I am having a lot of trouble with this exercise. I did a lot of looking but somehow I am not finding the solution. Any help will be very much appreciated. Thanks- Roman.. Waypoint Add borders around your Elements: <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

{border-width:10px;
border-style: solid;
border-color: green;}
>
</style>

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

Dealga McArdle
@zeffii
Sep 18 2015 18:59
@ArielLeslie maybe , maybe not... i read conflicting rhetoric about em vs i ...
i'd lean towards using a proper italic font, ..and not a faux slanting of a regular font.
Roman
@Rome21
Sep 18 2015 19:01
I don't know how to copy with and paste with a nice image. I apologize if it looks like crap. lol
Ariel
@ArielLeslie
Sep 18 2015 19:07
explain formatting
CamperBot
@camperbot
Sep 18 2015 19:07

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks, then type js or html and then press [shift + enter ⏎]

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

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

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

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

Ariel
@ArielLeslie
Sep 18 2015 19:07
@Rome21 :point_up_2:
subhadeepgayen
@subhadeepgayen
Sep 18 2015 19:12
@SaintPeter thanks got it :) @ArielLeslie thanks :) how do i create object for each user? i tried and came up with this http://codepen.io/subhadeepgayen/pen/PPNXGq doesnt work. I am new to objects
CamperBot
@camperbot
Sep 18 2015 19:12
subhadeepgayen sends brownie points to @saintpeter and @arielleslie :sparkles: :thumbsup: :sparkles:
:star: 656 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 396 | @arielleslie | http://www.freecodecamp.com/arielleslie
x34passenger
@x34passenger
Sep 18 2015 19:23
I'm not sure how the button works to bring random quotes http://codepen.io/x34passenger/pen/jbqdrp
Rex Schrader
@SaintPeter
Sep 18 2015 19:23
@x34passenger Are you askign how to modify your project to add a button to pull another quote?
x34passenger
@x34passenger
Sep 18 2015 19:24
@SaintPeter I am not sure how to use http://forismatic.com/en/api/ in my webpage
Rex Schrader
@SaintPeter
Sep 18 2015 19:25
@x34passenger I see. Have you looked into using jQuery or anything to fetch the API URL?
@x34passenger Have you tried to manually construct an API url?
x34passenger
@x34passenger
Sep 18 2015 19:27
@SaintPeter is there a sample jquery on the api url?
Rex Schrader
@SaintPeter
Sep 18 2015 19:28
@x34passenger Try their tester: http://api.forismatic.com/api/tester/
@x34passenger In general, a query string is going to look like this:
http://example.com/api/1.0/?param1=value1&param2=value2
@x34passenger So you choose the params you need and the values for them and build up a URL to query. You can then use jQuery's $.getJSON function to call the query.
techimunchi
@techimunchi
Sep 18 2015 19:32
can someone help me with the thinking behind how to solve this bonfire? http://www.freecodecamp.com/challenges/bonfire-return-largest-numbers-in-arrays
CamperBot
@camperbot
Sep 18 2015 19:32
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Rex Schrader
@SaintPeter
Sep 18 2015 19:32
@techimunchi Sure
techimunchi
@techimunchi
Sep 18 2015 19:32
@SaintPeter thanks! The logic is the hardest part for me since I have no previous experience with Javascript
CamperBot
@camperbot
Sep 18 2015 19:32
techimunchi sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 657 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 18 2015 19:34
@techimunchi So it's really 4 different examples of the same problem: Find the largest number in an array. So think about how you would find the largest number. As a human, if you're looking over the array you probably just scan through and keep in mind the largest number you've seen, right?
@techimunchi But the computer can't really just "see" them, you need to compare each number and keep track of which is the largest.
@techimunchi So you'll need to visit each number at least once and you'll need a way to keep track of what the largest number you've seen is.
@techimunchi This problem may sound familiar to you, though, if you recall the "Find the longest word in the sentence" problem - you've done that one, right?
techimunchi
@techimunchi
Sep 18 2015 19:36
@SaintPeter and I keep track by keeping them in an array?
I have done that one
Rex Schrader
@SaintPeter
Sep 18 2015 19:37
@techimunchi Go take a look at your solution for that one - it should be on your profile page.
techimunchi
@techimunchi
Sep 18 2015 19:38
got it open
Rex Schrader
@SaintPeter
Sep 18 2015 19:38
@techimunchi Certainly you can keep your final answer in an array - that'll be needed to solve this problem, but you don't necessarily need to keep it in an array until you've determined the largest number.
@techimunchi So, how are you solving that one? Do you see how that might be applicable to this problem?
@techimunchi At least for the inner loop - when you're looking at the individual inside arrays
techimunchi
@techimunchi
Sep 18 2015 19:40
it compares the length of the words to each other and then returns the length of the longest word
Rex Schrader
@SaintPeter
Sep 18 2015 19:41
@techimunchi So in this case, you already have the "length", right? It's basically just a number.
techimunchi
@techimunchi
Sep 18 2015 19:41
it differentiates that on its own?
Rex Schrader
@SaintPeter
Sep 18 2015 19:42
@techimunchi You have some sort of test, right? You're comparing the length of the current word vs. some "longest word"?
@techimunchi In this case you're just comparing the values.
techimunchi
@techimunchi
Sep 18 2015 19:43
right
Rex Schrader
@SaintPeter
Sep 18 2015 19:45
@techimunchi So:
1) Loop through the outer array (the one that contains all the smaller arrays)
2) For each inner array, loop through the array and apply logic to find the largest number
3) store the largest number in an "answers" array
4) when you're done with the outer loop, return your "answers" array
@techimunchi Is that enough to get you started?
techimunchi
@techimunchi
Sep 18 2015 19:47
ah, I see, it definitely is! Thanks so much!
CamperBot
@camperbot
Sep 18 2015 19:47
if you want to thank someone, put an @ before their name!
techimunchi
@techimunchi
Sep 18 2015 19:47
This message was deleted
@SaintPeter thanks!
CamperBot
@camperbot
Sep 18 2015 19:47
techimunchi sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: techimunchi already gave saintpeter points
Rex Schrader
@SaintPeter
Sep 18 2015 19:47
@techimunchi ;)
Jack Demynn
@infectiouscode
Sep 18 2015 20:03
Im wanted to create an if statement with a warning message if theyre 13, but for else they want me to encourage to play the "game" what have i done wrong that makes it not go through?
// Check if the user is ready to play!
confirm("I am ready to play!")
var age = prompty("What's your age?");
if(age is less than 13)
{
    console.log("You are allowed to play, but I take no responsibility");
}
else {

console.log("Please continue, and have FUN!");
}
the y was a typo i fixed that (in prompt)
Bill
@kirah1314
Sep 18 2015 20:04
@infectiouscode if(age < 13)
Jack Demynn
@infectiouscode
Sep 18 2015 20:04
Noo that wasn't the problem, the questions suggest I use if age is less than
Bill
@kirah1314
Sep 18 2015 20:05
you can't use english age is less than 13
Jack Demynn
@infectiouscode
Sep 18 2015 20:05
The question has requested I use it.
Bill
@kirah1314
Sep 18 2015 20:05
yes, but you have to use javascript code to represent that sentence
a < b means a is less than b
Jack Demynn
@infectiouscode
Sep 18 2015 20:06
ok it worked now, thanks @kirah1314 its confusing when it asks me to write out in that way, but means using the < symbol
CamperBot
@camperbot
Sep 18 2015 20:06
infectiouscode sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 245 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Sep 18 2015 20:08
@infectiouscode here's some helpful information
http://www.w3schools.com/js/js_comparisons.asp
@infectiouscode all the FCC projects and exercises will be in English describing what you need to do and you have to use codes to achieve it
it asks you to write the code representing: age is less than 13
Jack Demynn
@infectiouscode
Sep 18 2015 20:12
Kirah, you may be of assistance again!
this isnt reading as true? line 16!
// Check if the user is ready to play!
confirm("I am ready to play!")
var age = prompt("What's your age?");
if(age < 13)
{
    console.log("You are allowed to play, but I take no responsibility");
}
else {

console.log("Please continue, and have FUN!");
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'")
console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'")
var userAnswer = prompt ("Do you want to race Bieber on stage?");

if(userAnswer === yes){
    console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!")
}
else{ ("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}
Bill
@kirah1314
Sep 18 2015 20:13
@infectiouscode put quotes around yes
because yes is a string
Jack Demynn
@infectiouscode
Sep 18 2015 20:13
Silly me, thanks again @kirah1314
CamperBot
@camperbot
Sep 18 2015 20:13
infectiouscode sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: infectiouscode already gave kirah1314 points
Bill
@kirah1314
Sep 18 2015 20:13
without quotes, it needs to be a variable
Jack Demynn
@infectiouscode
Sep 18 2015 20:14
ok i see !
Sorry to ask again...
this code says on line 22 that the > sign isnt needed? :s When it is, so I can show the feedback would be greater than 8
// Check if the user is ready to play!
confirm("I am ready to play!")
var age = prompt("What's your age?");
if(age < 13)
{
    console.log("You are allowed to play, but I take no responsibility");
}
else {

console.log("Please continue, and have FUN!");
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'")
console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'")
var userAnswer = prompt ("Do you want to race Bieber on stage?");

if(userAnswer === "yes"){
    console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!")
}
else{ ("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}
var feedback = prompt ("Rate my game from 1-10");
if (feedback === > "8"){
    console.log("Thank-you! We should race at the next concert!")
}
else ("I'll keep practicing coding and racing.");
}
CamperBot
@camperbot
Sep 18 2015 20:18
if you want to thank someone, put an @ before their name!
Bill
@kirah1314
Sep 18 2015 20:19
@infectiouscode did you check out the link I posted?
http://www.w3schools.com/js/js_comparisons.asp
Jack Demynn
@infectiouscode
Sep 18 2015 20:20
Yeah. I fixed the problem now! But the problem was the greater than sign, it didn't want it there, but the answer was going to be greater than 8, so surely I would put > 8 not just the 8 on its own which is what worked
Bill
@kirah1314
Sep 18 2015 20:20
@infectiouscode if you want to show a is greater than b, it'll be a > b and if you want to show a is equal or greater than b then it's a >= b
Jack Demynn
@infectiouscode
Sep 18 2015 20:21
Yes I get that, but it asked me to show it was greater than 8. So I put feedback === > "8" and it wouldnt work. As soon as I deleted the greater than sign, it completed the task.
Angel Jose
@ajose01
Sep 18 2015 20:25
Hi, I have a quick question regarding how some of the early bonfire exercises are set up...
on the reverse string bonfire, the function is executed as so: reverseString("hello", "");
Bill
@kirah1314
Sep 18 2015 20:25
ok, awesome! @infectiouscode here's a good resource if you want to read up more on javascript
http://eloquentjavascript.net/
Angel Jose
@ajose01
Sep 18 2015 20:26
I was able to figure the solution fine, but coming from ruby that extra "" after hello is throwing me off. What's it there for?
Robert Smith
@Tanker5419
Sep 18 2015 20:26
@infectiouscode " === " compares the two values and checks that they are of same exact type and value. You need to place " >= " to show you that it is greater than or equal to 8.
Jack Demynn
@infectiouscode
Sep 18 2015 20:34
Another Q guys,
this code is asking me to call a greeting? and the error says that I need to pass it a name? Which i dont understand cause its the first or second function exercise.
// Below is the greeting function!
// See line 7
// We can join strings together using the plus sign (+)
// See the hint for more details about how this works.

var greeting = function (name) {
    console.log("Great to see you," + " " + name);
};

// On line 11, call the greeting function!
var greeting = function (name) {
    console.log("Well Howdy flipkin do," + " " +  Jack);
};
The bottom greeting is my code, the above is an example
Florian Peninon
@florianpnn
Sep 18 2015 20:40
I just discovered JSBin and it’s amazing compared to Codepen because you can have a « console » view and don’t need to open your browser console! Example : https://jsbin.com/qihabavame/edit?js,console
Jack Demynn
@infectiouscode
Sep 18 2015 20:41
Is anyone available to lend a hand?
Florian Peninon
@florianpnn
Sep 18 2015 20:41
This message was deleted
Jack Demynn
@infectiouscode
Sep 18 2015 20:42
?
Florian Peninon
@florianpnn
Sep 18 2015 20:42
var greeting = function (name) {
    console.log("Well Howdy flipkin do," + " " +  Jack !!!!This need to be the name you pass!!!);
};
@infectiouscode Was trying to answer but the code part doesn’t work with a @ :/
Jack Demynn
@infectiouscode
Sep 18 2015 20:42
Whats the !'s for?
Florian Peninon
@florianpnn
Sep 18 2015 20:43
Just to point where you have an error, now it’s up to you to find what is the mistake ;)
Luis Felipe López G.
@luishendrix92
Sep 18 2015 20:43
Codepen is for frontend projects more than anything. It has bootstrap, materialize and whatnot. For JS I prefer jSBin or Repl.it
Jack Demynn
@infectiouscode
Sep 18 2015 20:43
oh okay one sec :P
Florian Peninon
@florianpnn
Sep 18 2015 20:44
@infectiouscode It’s better to point out and let you find it than giving you the answer!
Jack Demynn
@infectiouscode
Sep 18 2015 20:44
I dont know what passing a name is though because it hasnt taught me it yet >.< @florianpnn
Florian Peninon
@florianpnn
Sep 18 2015 20:46
@infectiouscode Your current code has your name hardcoded in it. The goal of your function is to change the output based on a parameter you pass to it. How would you update your code to be able to handle any name passed as a parameter? In your case « name »
Rakshit Pandey
@netNinja11
Sep 18 2015 20:47
@aldraco Ok. I'm here.
Jack Demynn
@infectiouscode
Sep 18 2015 20:47
I have no idea I really dont :/ @florianpnn
Ashley Drake
@aldraco
Sep 18 2015 20:49
var arr = [1,2,3,4];
var newArr = arr.map(function(num, index){
    return num * index;
});
// newArr = [0, 2, 6, 12]
// forEach produces side effects, or you can do something for each value in the array
var counter = 0;
var container = [];
arr.forEach(function(val, index){
    counter = counter + 1; // add one to the counter for each value
    container.push(val);
   console.log(index);
});
// this will console.log each index
// counter = 4;
// container = [1,2,3,4];
aw jeez, how do you format multiline code?
Jack Demynn
@infectiouscode
Sep 18 2015 20:50
Ooo, I somehow worked it out haha @florianpnn
Ashley Drake
@aldraco
Sep 18 2015 20:50
:/
Florian Peninon
@florianpnn
Sep 18 2015 20:50
@infectiouscode Imagine I want to call your function with my name :
greeting(‘Florian’);
and then greet you with :
greeting(‘Jack’);
How would you update your code to handle any name?
@infectiouscode Good! It will become clearer and clearer when you will move forward!
Ashley Drake
@aldraco
Sep 18 2015 20:51
@netNinja11 so when you map over an array, you are creating a new array using the values in the one you are mapping over.
you can save that new array into a variable
but mapping doesn't modify the contents of your original array
Alexandru Rotaru
@alexurotaru
Sep 18 2015 20:52
Hey guys! Anyone can help me with a Bonfire? I'm not sure what I'm doing wrong
CamperBot
@camperbot
Sep 18 2015 20:52
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Ashley Drake
@aldraco
Sep 18 2015 20:52
when you use forEach, you can execute a function for each value in the array, but it doesn't output any kind of variable.
IgnisCerebrum
@IgnisCerebrum
Sep 18 2015 20:52
Why is this wrong? I'm doing a Waypoint about jQuery
Rakshit Pandey
@netNinja11
Sep 18 2015 20:52
@aldraco Thanks!! This is really helpful! :smile:
CamperBot
@camperbot
Sep 18 2015 20:52
netninja11 sends brownie points to @aldraco :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for aldraco
Ashley Drake
@aldraco
Sep 18 2015 20:53
yay! I'm glad :) they're both very useful functions to know.
Alexandru Rotaru
@alexurotaru
Sep 18 2015 20:53
bonfire reverse a string
CamperBot
@camperbot
Sep 18 2015 20:53

:fire:Bonfire: Reverse a String :link:

function reverseString(str) {
  return str;
}

reverseString('hello');

Reverse the provided string.

more info:  bf details | bf links | hint

Rakshit Pandey
@netNinja11
Sep 18 2015 20:53
@camperbot How am I supposed to do that? I'm such a newb. :frowning:
IgnisCerebrum
@IgnisCerebrum
Sep 18 2015 20:53
Scratch that. This is what I have, and this is what I need to do for the Waypoint: For example, let's make all of your button elements bounce. Just add this code inside your document ready function: $("button").addClass("animated bounce").
<script>
  $(document).ready(function() {

  });

</script>
Alexandru Rotaru
@alexurotaru
Sep 18 2015 20:54
bf details
CamperBot
@camperbot
Sep 18 2015 20:54

:fire:Bonfire: Reverse a String :link:

function reverseString(str) {
  return str;
}

reverseString('hello');
Reverse the provided string.
You may need to turn the string into an array before you can reverse it.
Your result must be a string.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
DoRm
@DoRm
Sep 18 2015 20:55
@alexurotaru What do you need help with?
Alexandru Rotaru
@alexurotaru
Sep 18 2015 20:56
@DoRm I'm stuck at the lesson. I thought that I created the necessary code but the page does not seem to validate
@DoRm How do I post my code in here?
DoRm
@DoRm
Sep 18 2015 20:56
@alexurotaru paste your code so we can help
wiki format
CamperBot
@camperbot
Sep 18 2015 20:56

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks, then type js or html and then press [shift + enter ⏎]

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

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

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

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

Alexandru Rotaru
@alexurotaru
Sep 18 2015 20:57
This message was deleted
Rakshit Pandey
@netNinja11
Sep 18 2015 20:57
thanks @aldraco
CamperBot
@camperbot
Sep 18 2015 20:57
netninja11 sends brownie points to @aldraco :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for aldraco
Rakshit Pandey
@netNinja11
Sep 18 2015 20:58
@aldraco I solved the waypoint. Yay! :thumbsup:
Ashley Drake
@aldraco
Sep 18 2015 21:00
yay!
Alexandru Rotaru
@alexurotaru
Sep 18 2015 21:01

```js function reverseString(str, separator) {

var reverse = str.split(separator).reverse().join("");
return reverse;
}

reverseString("hello","");
` ``

DoRm
@DoRm
Sep 18 2015 21:03
you need a line break after ```js for it to format correctly
Ashley Drake
@aldraco
Sep 18 2015 21:03
@DoRm yup I just made that same mistake haha
DoRm
@DoRm
Sep 18 2015 21:04
@alexurotaru Anyway you don't need the separator parameter and you can just change str.splt(separator) to str.splt("")
also don't name variables anything in the global namespace it will cause errors
Alexandru Rotaru
@alexurotaru
Sep 18 2015 21:05
@DoRm Omg. I've been at this for the last 1 hour. Such a newb mistake :)) . Thanks!
CamperBot
@camperbot
Sep 18 2015 21:05
alexurotaru sends brownie points to @dorm :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for dorm
DoRm
@DoRm
Sep 18 2015 21:06
No problem
Oliver Mensah
@OMENSAH
Sep 18 2015 21:10

Please may some one help me to understand this code var product = 2.0 * 2.5; // equals 5.0

(function(y){return 'product='+y;})(product);

Jack Demynn
@infectiouscode
Sep 18 2015 21:11
Apparently im not printing anything to the console?
// Write your foodDemand function below.
// Last hint: In your reusable block of code, end each line
// with a semicolon (;)
var foodDemand = function (food) {
    console.log("I want to eat" + " " + foodDemand("chocolate"));
};
DoRm
@DoRm
Sep 18 2015 21:14
@infectiouscode I'm pretty sure that's an infinite loop
Jack Demynn
@infectiouscode
Sep 18 2015 21:16
How do I make it not?
its exactly the same as the code I put for a different function
Rex Schrader
@SaintPeter
Sep 18 2015 21:29
@infectiouscode You're calling the function from within itself. The parameter food is the thing you want to eat.
Jack Demynn
@infectiouscode
Sep 18 2015 21:32
So how else do I do it? Its really got me stressed cause its not explaining it properly :/ @SaintPeter
DoRm
@DoRm
Sep 18 2015 21:32
you just need to print food
Jack Demynn
@infectiouscode
Sep 18 2015 21:32
Yes, but how is that done? It says im not printing anything
Rex Schrader
@SaintPeter
Sep 18 2015 21:32
@infectiouscode In your output you're trying to put the name of the food that was passed in to the function. That value is held in the parameter/variable food.
DoRm
@DoRm
Sep 18 2015 21:33
var foodDemand = function (food) {
    console.log("I want to eat" + " " + food);
};
Jack Demynn
@infectiouscode
Sep 18 2015 21:33
its telling me to stuff it hasnt taught me yet
If I just leave the code like the above that @DoRm has put it tells me i havent called the foodDemand function
and I don't know how to do both, cause before it only taught to call it, not call it aswell as do ing the above
DoRm
@DoRm
Sep 18 2015 21:34
outside the function you just type Fooddemand("Apples");
Jack Demynn
@infectiouscode
Sep 18 2015 21:35
Where abouts though? Cause I typed it before and it told me it wouldn't print
DoRm
@DoRm
Sep 18 2015 21:36
var foodDemand = function (food) {
    console.log("I want to eat" + " " + food);
};
foodDemand("Apples");
Jack Demynn
@infectiouscode
Sep 18 2015 21:36
See it never taught me that I was meant to do that, it just expects me to know without teaching me first. thankyou so much @DoRm
I'm giving code a rest for the night haha, night guys
DoRm
@DoRm
Sep 18 2015 21:37
I'm sure it taught you but you forgot but it happens to all of us
Clayton
@cjg040103
Sep 18 2015 22:23
anyone know what i'm doing wrong?
var Car = function() {
   this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();


  myCar.engine === 1;


// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
DoRm
@DoRm
Sep 18 2015 22:25
@cjg040103 look at the car function
Clayton
@cjg040103
Sep 18 2015 22:25
oh?
DoRm
@DoRm
Sep 18 2015 22:26
you got a little to happy with your equal signs
Clayton
@cjg040103
Sep 18 2015 22:26
k
var Car = function() {
   this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();


  myCar.engine = 1;


// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
now what?
it seems to be working...
Ariel
@ArielLeslie
Sep 18 2015 22:29
I think that's all you need to do for that exercise
Paul M Rest
@vaticdart
Sep 18 2015 22:29

In regards to Bonfire: Seek and Destroy (#184), how is it possible that a solution like this works? https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki/Bonfire-Seek-and-Destroy

The user is calling filter( ) on the parameter Arguments object, not an Array. Isn't that not supposed to work?

I've confirmed that the same thing works in my solution: I can call filter( ) on the Arguments object parameter.

Clayton
@cjg040103
Sep 18 2015 22:29
nope
Ariel
@ArielLeslie
Sep 18 2015 22:29
@cjg040103 What else do you need to do?
Clayton
@cjg040103
Sep 18 2015 22:30
I don't know. All I know is that it is not accepting it.
Ariel
@ArielLeslie
Sep 18 2015 22:30
What test is it failing?
Clayton
@cjg040103
Sep 18 2015 22:31
"The property engine of myCar should be a number"
Ariel
@ArielLeslie
Sep 18 2015 22:32
That's after re-running the tests?
Clayton
@cjg040103
Sep 18 2015 22:32
yes
Ariel
@ArielLeslie
Sep 18 2015 22:34
@cjg040103 You're missing an 's' in 'engines'
Clayton
@cjg040103
Sep 18 2015 22:34
wow i'm an idiot
:wink2:
Rex Schrader
@SaintPeter
Sep 18 2015 22:35
@cjg040103 @ArielLeslie Here's the funny thing - that's the second time I've seen that exact error in two days. Maybe it's because we know that cars can only have one engine?
Clayton
@cjg040103
Sep 18 2015 22:36
there is no logic in this place
Rex Schrader
@SaintPeter
Sep 18 2015 22:36
It's nothing but logic . . it's just a strange, alien logic, far from normal human logic.
Ariel
@ArielLeslie
Sep 18 2015 22:37
@SaintPeter Probably, but it does teach a valuable lesson about reading requirements carefully.
Rex Schrader
@SaintPeter
Sep 18 2015 22:37
@ArielLeslie indeed.
Ariel
@ArielLeslie
Sep 18 2015 22:37
And reading your code carefully
SaintPeter @SaintPeter nods sagely
Ariel
@ArielLeslie
Sep 18 2015 22:37
I can't tell you how many times I track down an error in my code to a typo
Clayton
@cjg040103
Sep 18 2015 22:37
k thanks @ArielLeslie
CamperBot
@camperbot
Sep 18 2015 22:37
cjg040103 sends brownie points to @arielleslie :sparkles: :thumbsup: :sparkles:
:star: 398 | @arielleslie | http://www.freecodecamp.com/arielleslie
Rex Schrader
@SaintPeter
Sep 18 2015 22:38
I get a little thrill on the rare occasions that I write out a function and it works properly on the first try.
Rory Smith
@alanbuchanan
Sep 18 2015 22:38
hi all, anyone using webstorm?
DoRm
@DoRm
Sep 18 2015 22:39
The good news is webstorm is at least fixing the awful billing method
Ariel
@ArielLeslie
Sep 18 2015 22:40
@SaintPeter I distrust it.
Nathan Kipsang Tum
@nathantum
Sep 18 2015 22:43
can someone help explain how the .pop( ) work ?
having trouble with it.
Risle
@Risle
Sep 18 2015 22:45
@SaintPeter I've heard rumors of this. Code working on the first try, ha. Not on my watch.
Danny Peck
@dannytpeck
Sep 18 2015 22:52
I seem to be having some issues getting started on Cloud 9 for base jumps
It keeps running out of memory and killing npm, anyone else have this issue?
Joshua Travis
@jktravis
Sep 18 2015 22:52
Could I get a little help on js regex, specifically how to use back refs? I'm trying to do the following, but it's using the literal value of $1 instead of the captured value.
str.replace(/[\s+_(A-Z)]/g, "-$1")
Angel Jose
@ajose01
Sep 18 2015 22:53
Woohoo. Today I've gone through all the OO & Functional Programming lessons, and halfway through the basic algo stuff.
Joshua Travis
@jktravis
Sep 18 2015 22:58
I think my parens are being matched instead of capturing...
Rakshit Pandey
@netNinja11
Sep 18 2015 23:07
This message was deleted
murphytimothyl
@murphytimothyl
Sep 18 2015 23:19

can someone explain what the pairwise bonfire is actually asking me to do. I am confused to what they are asking when they say the sum should equal 11. Return the sum of all indices of elements of 'arr' that can be paired with one other element to form a sum that equals the value in the second argument 'arg'. If multiple sums are possible, return the smallest sum. Once an element has been used, it cannot be reused to pair with another.

For example, pairwise([1, 4, 2, 3, 0, 5], 7) should return 11 because 4, 2, 3 and 5 can be paired with each other to equal 7.

pairwise([1, 3, 2, 4], 4) would only equal 1, because only the first two elements can be paired to equal 4, and the first element has an index of 0!

Risle
@Risle
Sep 18 2015 23:23
@murphytimothyl It looks like they want you to find the values that can add up to the second argument (here: 7) then, once you've selected them, find their index numbers and add up those. So the indices for 4,2,3 and 5 are, respectively, 1,2,3, and 5. Then return 1 + 2 + 3 + 5 = 11.
murphytimothyl
@murphytimothyl
Sep 18 2015 23:25
thanks @risle. I just realized that. I think i was getting confused because I was forgetting that the first index was 0 and not 1.
CamperBot
@camperbot
Sep 18 2015 23:25
murphytimothyl sends brownie points to @risle :sparkles: :thumbsup: :sparkles:
:star: 194 | @risle | http://www.freecodecamp.com/risle
Risle
@Risle
Sep 18 2015 23:30
Does anyone more advanced than me have a side-project app on github that they're willing to share so I could stare at it and practice parsing someone else's code?
Np @murphytimothyl . The way that was written was confusing as hell.
Robert Smith
@Tanker5419
Sep 18 2015 23:38

Need help please? ```js
function chunk(arr, size) {
var newArray = [];
for (var i = 0; i < arr.length; i += size) {
newArray.push(arr.slice(i, i + size));
return newArray;
}

chunk(["a", "b", "c", "d"], 2, "");
```

format help
DTing
@dting
Sep 18 2015 23:43
@Tanker5419 your return statement should be outside the for loop
Hedonism Bot
@davidnata83
Sep 18 2015 23:44
Why is this a problem on 106, guize?
<script>
$(document).ready(function() {
$("button").adClass("btn-primary")
$(".btn").adClass("shake")
$("#target1").adClass("animated")
});
</script>
DTing
@dting
Sep 18 2015 23:44
function chunk(arr, size) {
  var newArray = [];
  for (var i = 0; i < arr.length; i += size) {
    newArray.push(arr.slice(i, i + size));
  }
  return newArray;
}
chunk(["a", "b", "c", "d"], 2, "");
@davidnata83 "add" not "ad"
Hedonism Bot
@davidnata83
Sep 18 2015 23:44
Jesus, thanks, slick.
CamperBot
@camperbot
Sep 18 2015 23:44
if you want to thank someone, put an @ before their name!
Hedonism Bot
@davidnata83
Sep 18 2015 23:44
@dting thanks
Robert Smith
@Tanker5419
Sep 18 2015 23:46
@dting thanks!
CamperBot
@camperbot
Sep 18 2015 23:46
tanker5419 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1208 | @dting | http://www.freecodecamp.com/dting
Bitra Balachandra Tejaswi
@BalachandraTejas
Sep 18 2015 23:47
Just curious, any benefits of accumulating brownie points?
Konrad Kale
@MrKale38
Sep 18 2015 23:53
What's one reason why I would rather use disable instead of just deleting the line?