These are chat archives for FreeCodeCamp/Help

10th
Sep 2015
tuckerkline
@tuckerkline
Sep 10 2015 00:01
Just use your console in chrome
or repl.it
@masonc15
max77p
@max77p
Sep 10 2015 00:02
how do i join a string which maybe a sentence without the spaces?
burySpot
@burySpot
Sep 10 2015 00:02
haha, guys, does anyone passed the chunky money bonfire?
you call join('')
@max77p
max77p
@max77p
Sep 10 2015 00:07
how would code for something like "life is a beach" look like for reverse and join all in lower case?
@burySpot
Cristián Berríos
@crisberrios
Sep 10 2015 00:08
str = str.split('').reverse().join('').toLowerCase();
msaoudallah
@msaoudallah
Sep 10 2015 00:09
guys would any one help me with the Where art thou bonfire ?
CamperBot
@camperbot
Sep 10 2015 00:09
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Steven Nevins
@dmintercept
Sep 10 2015 00:09
burySpot
@burySpot
Sep 10 2015 00:10
@max77p , @crisberrios is right!
max77p
@max77p
Sep 10 2015 00:11
@crisberrios js var str="liFe is a Beach"; var newstr = str.split('').reverse().join('').toLowerCase();
for this when its reversed the space is still there
Cristián Berríos
@crisberrios
Sep 10 2015 00:11
you want to remove whitespace?
you didn't say that :)
Steven Nevins
@dmintercept
Sep 10 2015 00:12
use a regexp
max77p
@max77p
Sep 10 2015 00:12
@crisberrios oops sorry lol...whitespace and punctuation
can't seem to understand the documentation on that
Cristián Berríos
@crisberrios
Sep 10 2015 00:13
then add to the chain .replace(/[\W_]/g,'')
that's a regex expression that will replace all non alphanumeric characters with nothing (remove)
I think I'm missing the space also within the brackets
as \W doesn't target _ and space I think
msaoudallah
@msaoudallah
Sep 10 2015 00:16
@max77p have you done the Where art thou bonfire ?
max77p
@max77p
Sep 10 2015 00:17
@crisberrios this is what i am not understand in the documentation...W is used to find non word character, but what is deciding I want it to remove all non word characters? is it the g?
Cristián Berríos
@crisberrios
Sep 10 2015 00:17
g is a flag
it says "find all the matches for this expression"
then the 2nd parameter is the replace value
that can also be a function and can use saved groups (more advanced)
Vadimich18
@Vadimich18
Sep 10 2015 00:27

Hi, guys! I'm stuck on "Waypoint: Use a CSS Class to Style an Element".
That's my task
Create a CSS class called red-text and apply it to your h2 element.

Classes are reusable styles that can be added to HTML elements.

Here's an example CSS class declaration:

<style>

  .blue-text {

    color: blue;

  }

</style>

You can see that we've created a CSS class called blue-text within the <style> tag.

You can apply a class to an HTML element like this: <h2 class="blue-text">CatPhotoApp</h2>.

Note that in your CSS style element, classes should start with a period. In your HTML elements' class declarations, classes shouldn't start with a period.

Instead of creating a new style element, try removing the h2 style declaration from your existing style element, then replace it with the class declaration for .red-text.

I have no idea what to do!

max77p
@max77p
Sep 10 2015 00:34
is there way to match two strings in a if statement to see if they are the same or is for loop best way?
jkieberk
@jkieberk
Sep 10 2015 00:37
\\
woops
\\
var a = "hi";
var b = "hi";
if(a == b){
//do something
}
\\
D:
'''
var a = "hi";
var b = "hi";
if(a == b){
//do something
}
'''
CamperBot
@camperbot
Sep 10 2015 00:38
:bulb: to format code use backticks! ``` more info
max77p
@max77p
Sep 10 2015 00:39
@jkieberk is it == instead of ===?
two ver 3...thought it was three equals to use in if statements
max77p
@max77p
Sep 10 2015 00:43
@jkieberk interesting, both do work, wondering which is the correct way to do this or if it doesnt matter
jkieberk
@jkieberk
Sep 10 2015 00:45
@max77p I think if you are just comparing two strings you are fine using either :)
Santosh Sankar
@santoshsankar
Sep 10 2015 00:45

Hi. I'm trying the Title Case exercise and I'm unable to see where my error is. I spent my time researching but wasn't able to see where my error is.
'''
function titleCase(str) {

var splitter = str.split(' ');
for(var i = 0; i < splitter.length; i++) {

splitter[i].charAt(0).toUpperCase;
var splitOutput = splitter.join(" ");

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

DTing
@dting
Sep 10 2015 00:47
@santoshsankar
function titleCase(str) {
  var splitter = str.split(' ');
  for(var i = 0; i < splitter.length; i++) {
    splitter[i].charAt(0).toUpperCase; // strings are immutable. you didnt call the function
    var splitOutput = splitter.join(" "); // this should be after the loop?
  }
  return splitOutput;
}
titleCase("I'm a little tea pot");
help immutable
CamperBot
@camperbot
Sep 10 2015 00:48

: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

DTing
@dting
Sep 10 2015 00:48
also in addition making the first letter uppercase you need to make the rest of the letters lowercase
Santosh Sankar
@santoshsankar
Sep 10 2015 00:49
ah ok. I will review this and give it another shot. thanks @dting
CamperBot
@camperbot
Sep 10 2015 00:49
santoshsankar sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1083 | @dting | http://www.freecodecamp.com/dting
Ian Wang
@ianw3214
Sep 10 2015 00:59
Hey guys I have been stuck on the bonfire no repeats please for quite a while now and I couldn't figure anything out. I have checked many tutorials and forums for answers but i don't quite understand the logic and reasoning behind most of them, and I was hoping someone could explain it to me. I kind of know how the code should work but I can't figure out the formula to calculate the final result. If anyone has any answers, it would be greatly appreciated!
Derek Alvarado
@derekalvarado
Sep 10 2015 01:05
@ianw3214 I like how they always include helpful links in the bonfire to point you in the right direction. I've completed a few bonfires without using what they suggested, only to go back and see how it could be done with what they had in mind
CamperBot
@camperbot
Sep 10 2015 01:05
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Derek Alvarado
@derekalvarado
Sep 10 2015 01:07
@ianw3214 maybe you could build a dictionary of permutations of the provided string, then run them through a regex for the criteria provided.
@ianw3214 push the ones that fit the criteria into a final array, then return the count of said array
@ianw3214 I haven't attempted it yet, but you haven't tried that already, maybe give it a shot and see how far that can go.
Ian Wang
@ianw3214
Sep 10 2015 01:10
@derekalvarado That's a good idea! I haven't looked into that approach yet, I'v been thinking about it just in terms of numbers and finding a formula to find the amount of possible permutations. I will try listing out the permutations into an array, and hopefully it works!
Derek Alvarado
@derekalvarado
Sep 10 2015 01:15
@ianw3214 and nvm about using some final array... just increment a counter
cwalsh003
@cwalsh003
Sep 10 2015 01:30

function titleCase(str) {

for (var i = 0; i < str.length; i++)
{
if (str.charAt(i).match(/\s/g))
str.replace(str.charAt(i+1), str.charAt(i+1).toUpperCase());
}

return str;
}

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

Can someone please help me with this? Why isn't this working?

Rex Schrader
@SaintPeter
Sep 10 2015 01:33
@cwalsh003 Strings in Javascript are immutable - they cannot be changed. In order to save the change to str, you need to write it back to that variable, like this:
str = str.replace(str.charAt(i+1), str.charAt(i+1).toUpperCase());
cwalsh003
@cwalsh003
Sep 10 2015 01:34
@SaintPeter Thank you so much. I knew it was somehting like that
CamperBot
@camperbot
Sep 10 2015 01:34
cwalsh003 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 561 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 10 2015 01:34
@cwalsh003 Then, additionally, I don't think what you're trying to do with .replace is going to work like you think. What if the word was Bonobo - if you replace 'b', you're going to be replaceing alll instances of b.
cwalsh003
@cwalsh003
Sep 10 2015 01:35
@SaintPeter I just realize that when I ran it
DTing
@dting
Sep 10 2015 01:35
replace replaces the first occurance
cwalsh003
@cwalsh003
Sep 10 2015 01:36
@dting @SaintPeter It replaced the first occurance of the letter
DTing
@dting
Sep 10 2015 01:36
@cwalsh003 strings are immutable
help immutable
CamperBot
@camperbot
Sep 10 2015 01:36

: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

Rex Schrader
@SaintPeter
Sep 10 2015 01:36
@dting @cwalsh003 Oh, interesting, I didn't realize it only replaced the first instance.
cwalsh003
@cwalsh003
Sep 10 2015 01:36
But arrays aren't
I think I got it
Rex Schrader
@SaintPeter
Sep 10 2015 01:37
@cwalsh003 Correct. You can change their contents after creation.
DTing
@dting
Sep 10 2015 01:37
@cwalsh003
str.replace(str.charAt(i+1), str.charAt(i+1).toUpperCase()); this doesnt mutate the string
Rex Schrader
@SaintPeter
Sep 10 2015 01:38
@dting told him this above :D
cwalsh003
@cwalsh003
Sep 10 2015 01:38
@dting I understand. I am used to C where Strings are stored as pointers with their own address
DTing
@dting
Sep 10 2015 01:38
oh i didnt see just saw the most recent code block
Jesse
@jctm30
Sep 10 2015 01:39
 var idx = firstArray.indexOf(newElement);
  while (idx != -1) {
      indices.push(idx);
      idx = array.indexOf(newElement, idx + 1);
hi guys, what does idx + 1 really mean here?
Rex Schrader
@SaintPeter
Sep 10 2015 01:40
@jctm30 You see in the first line where idx is assigned? It's taking the .indexOf newElement in the firstArray - IE: the first instance of it in newArray. Since indexes are zero based, indexOf returns a -1 if it doesn't find anything. So if newElement is found, it gets pushed onto indices.
DTing
@dting
Sep 10 2015 01:41
idx+1 there is the start position of indexof
so that loop is trying to find each index of the element.
fromIndex
The index to start the search at. If the index is greater than or equal to the array's length, -1 is returned, which means the array will not be searched. If the provided index value is a negative number, it is taken as the offset from the end of the array. Note: if the provided index is negative, the array is still searched from front to back. If the calculated index is less than 0, then the whole array will be searched. Default: 0 (entire array is searched).
cwalsh003
@cwalsh003
Sep 10 2015 01:50
@dting @SaintPeter Got it, guys, thank you for your help!!
CamperBot
@camperbot
Sep 10 2015 01:50
cwalsh003 sends brownie points to @dting and @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: cwalsh003 already gave saintpeter points
:star: 1085 | @dting | http://www.freecodecamp.com/dting
Brett Guillory
@kurzninja
Sep 10 2015 01:52
!music
CamperBot
@camperbot
Sep 10 2015 01:52
Hunter
@retnuh1974
Sep 10 2015 01:55
Thank you for the new Section: "Object Oriented and Functional Programming" much needed going into the "Basic Algorithm Scripting" section. Again, thank you thank you
CamperBot
@camperbot
Sep 10 2015 01:55
if you want to thank someone, put an @ before their name!
Mukul Patel
@Mukul215
Sep 10 2015 01:57
bonfire Title Case a Sentence
CamperBot
@camperbot
Sep 10 2015 01:57

:fire:Bonfire: Title Case a Sentence :link:

function titleCase(str) {
  return str;
}

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

Return the provided string with the first letter of each word capitalized.

more info:  bf details | bf links | hint

Mukul Patel
@Mukul215
Sep 10 2015 01:57
hint
CamperBot
@camperbot
Sep 10 2015 01:57
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Jesse
@jctm30
Sep 10 2015 01:59
@SaintPeter @dting thanks guys, a little confused but why does idx + 1 mean its finding it in each index of element?
CamperBot
@camperbot
Sep 10 2015 01:59
jctm30 sends brownie points to @saintpeter and @dting :sparkles: :thumbsup: :sparkles:
:star: 562 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 1086 | @dting | http://www.freecodecamp.com/dting
Rex Schrader
@SaintPeter
Sep 10 2015 02:00
@jctm30 It means it's looking for a second instance of that element, AFTER the first instance of the element. If it found it one time at location idx, then searching agains starting at idx + 1 means it will only find a SECOND instance of newElement, not the one it just found.
DTing
@dting
Sep 10 2015 02:02
var idx = "ababc".indexOf("a");
// idx === 0;
var idx = "ababc".indexOf("a", idx+1);
// "ababc".indexOf("a", 1) <- starts looking for "a" starting at index 1
// idx === 2
var idx = "ababc".indexOf("a", idx+1);
// "ababc".indexOf("a", 3) <- starts looking for "a" starting at index 3
// idx === -1
Jesse
@jctm30
Sep 10 2015 02:04
@dting @SaintPeter wow makes sense. thanks alot guys
CamperBot
@camperbot
Sep 10 2015 02:04
jctm30 sends brownie points to @dting and @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: jctm30 already gave saintpeter points
:warning: jctm30 already gave dting points
Junior Griffiths
@Jegriff23
Sep 10 2015 02:06
blob
need help with nesting
Alejandro Tejada
@wannabecoding
Sep 10 2015 02:08
Hi all. Anybody have any good external references for JavaScript?
Jose M Viloria
@josevill
Sep 10 2015 02:09
@wannabecoding http://devdocs.io and Mozilla Developer Network should do the trick man
Alejandro Tejada
@wannabecoding
Sep 10 2015 02:09
@Jegriff23 when nesting remember that the inner < /> close before the outer < />
Will look into that
@josevill will look into that, objects and methods rack my brain right now...
Junior Griffiths
@Jegriff23
Sep 10 2015 02:10
ok wannabecoding
Alejandro Tejada
@wannabecoding
Sep 10 2015 02:11
@Jegriff23 let me know if that helps, don't want to give it away
Junior Griffiths
@Jegriff23
Sep 10 2015 02:12
still didnt work
Jose M Viloria
@josevill
Sep 10 2015 02:13
@wannabecoding If you're having some issues with theory mozilla developer network will help you out sort most of them (At least it does for me, if it works for me, you should be able to do it too, so keep it up :) )
@Jegriff23 When nesting stuff. Remember to properly use identation. That's why most of the time we fail at nesting..
Alejandro Tejada
@wannabecoding
Sep 10 2015 02:14
@Jegriff23 you need to add the <input
Luciano Britis
@LucianoBritis
Sep 10 2015 02:14
@Jegriff23 close your form tag
Junior Griffiths
@Jegriff23
Sep 10 2015 02:15
blob
it is closed, look
Philip Warkentien II
@warkentien2
Sep 10 2015 02:18
@Jegriff23 your first form tag. needs a '>' in the end. right before </form>
Luciano Britis
@LucianoBritis
Sep 10 2015 02:18
no it is not, check again @Jegriff23
Junior Griffiths
@Jegriff23
Sep 10 2015 02:20
even after I put '>' in the end before </form> it don't work
whats your suggestion LucianoBritis?
guess not
Luciano Britis
@LucianoBritis
Sep 10 2015 02:24
@Jegriff23 involves the input to the form
<form action="/submit-cat-photo">
<input type="text" placeholder="cat photo URL"></form>
Junior Griffiths
@Jegriff23
Sep 10 2015 02:27
it worked, thanks. Guess I had to reverse the order.
CamperBot
@camperbot
Sep 10 2015 02:27
if you want to thank someone, put an @ before their name!
Junior Griffiths
@Jegriff23
Sep 10 2015 02:27
it worked, thanks. Guess I had to reverse the order @ LucianBritis
CamperBot
@camperbot
Sep 10 2015 02:27
if you want to thank someone, put an @ before their name!
cooljoe21
@cooljoe21
Sep 10 2015 02:27
Fangirl365
@Fangirl365
Sep 10 2015 02:30
Thanks @fangirl365
CamperBot
@camperbot
Sep 10 2015 02:30
sorry fangirl365, you can't send brownie points to yourself! :sparkles: :sparkles:
Fangirl365
@Fangirl365
Sep 10 2015 02:30
Dang!
Why not?
Thanks @cooljoe21 @camperbot @Jegriff23 @Fangirl365 @wannabecoding @Jegriff23 @wannabecoding @josevill
CamperBot
@camperbot
Sep 10 2015 02:32
fangirl365 sends brownie points to @cooljoe21 and @camperbot and @jegriff23 and @ and @wannabecoding and @jegriff23 and @wannabecoding and @josevill :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for jegriff23
:warning: could not find receiver for jegriff23
:star: 232 | @wannabecoding | http://www.freecodecamp.com/wannabecoding
:star: 200 | @camperbot | http://www.freecodecamp.com/camperbot
:star: 299 | @josevill | http://www.freecodecamp.com/josevill
:star: 232 | @wannabecoding | http://www.freecodecamp.com/wannabecoding
:star: 21 | @cooljoe21 | http://www.freecodecamp.com/cooljoe21
Fangirl365
@Fangirl365
Sep 10 2015 02:32
It worked!
Whats the words? Camperbot whats your status?
Austin Lin
@austinylin
Sep 10 2015 02:33
@cooljoe21 what do you have so far?
cooljoe21
@cooljoe21
Sep 10 2015 02:33
<script>
  $(document).ready(function() {
  $("button").addclass
  $(".btn").addclass
  $("#target1").addclass("animated  shake btn-primary")
  });
</script>

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

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <h4>#left-well</h4>
      <div class="well" id="left-well">
        <button class="btn 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>
Austin Lin
@austinylin
Sep 10 2015 02:35
@cooljoe21 I think they want you to use the three selectors to each add a class.
Junior Griffiths
@Jegriff23
Sep 10 2015 02:35
how do you copy and past your code in the black box @ cooljoe21
Austin Lin
@austinylin
Sep 10 2015 02:36
@cooljoe21 also make sure you capitalize the C in addClass
Nishaan Lalgee
@NishL
Sep 10 2015 02:36
@cooljoe21 you need to addClass to each of you targets
cooljoe21
@cooljoe21
Sep 10 2015 02:37
@Jegriff23 use 'code'
Danielle "Dani" Moss
@psykobilliethekid
Sep 10 2015 02:37
is there something i need to do to get the animations to work properly on codepen? i cant get my jquery to work on my bootstrap site
cooljoe21
@cooljoe21
Sep 10 2015 02:37
Use ```
Junior Griffiths
@Jegriff23
Sep 10 2015 02:37
@cooljoe21 , you just typ'code'?
'code'
Nishaan Lalgee
@NishL
Sep 10 2015 02:38
for example $("button").addClass("animated")
ninjatron
@ninjatron
Sep 10 2015 02:38
anybody know angular js?
cooljoe21
@cooljoe21
Sep 10 2015 02:38
Use ``` at the beginning and at the end
Austin Lin
@austinylin
Sep 10 2015 02:38
@psykobilliethekid do you have the javascript assets added to your codpen?
cooljoe21
@cooljoe21
Sep 10 2015 02:39
thank you @austinylin and @NishL
CamperBot
@camperbot
Sep 10 2015 02:39
cooljoe21 sends brownie points to @austinylin and @nishl :sparkles: :thumbsup: :sparkles:
:star: 65 | @austinylin | http://www.freecodecamp.com/austinylin
:star: 161 | @nishl | http://www.freecodecamp.com/nishl
Danielle "Dani" Moss
@psykobilliethekid
Sep 10 2015 02:40
@austinylin yep. followed the steps like in the video
Junior Griffiths
@Jegriff23
Sep 10 2015 02:41
@cooljoe21 , it didnt work
Danielle "Dani" Moss
@psykobilliethekid
Sep 10 2015 02:42
@austinylin realized it didnt work with a drop down menu wouldnt work
Luciano Britis
@LucianoBritis
Sep 10 2015 02:51
@cooljoe21 It worked?
Ian Wang
@ianw3214
Sep 10 2015 03:18
Thanks @derekalvarado
CamperBot
@camperbot
Sep 10 2015 03:18
ianw3214 sends brownie points to @derekalvarado :sparkles: :thumbsup: :sparkles:
:star: 109 | @derekalvarado | http://www.freecodecamp.com/derekalvarado
Jacob Boykin
@jacobboykin
Sep 10 2015 03:49

Hey guys, I don't quite understand why this doesn't work in Waypoint - Make Object Properties Private in the OOP section.

var Bike = function() {
  // Only change code below this line.
  speed = 100;
  function addUnit(value) {
    return value + "KM/H";
  }

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

};

Why is the getSpeed() function still private?

Ian Wang
@ianw3214
Sep 10 2015 03:53
@jacobboykin I think it has to be this.getSpeed to make it public
Luciano Britis
@LucianoBritis
Sep 10 2015 03:54
@jacobboykin remove o this. --> (this.speed);
Jacob Boykin
@jacobboykin
Sep 10 2015 03:55
Thank you, both @ianw3214 @LucianoBritis
CamperBot
@camperbot
Sep 10 2015 03:55
jacobboykin sends brownie points to @ianw3214 and @lucianobritis :sparkles: :thumbsup: :sparkles:
:star: 239 | @lucianobritis | http://www.freecodecamp.com/lucianobritis
:star: 286 | @ianw3214 | http://www.freecodecamp.com/ianw3214
Michael Bomholt
@bomholtm
Sep 10 2015 03:56
whats the best way to make my header fullscreen on every device? found vh and vw using viewport units but this wont work on older browsers
there also is this http://jsfiddle.net/pkf7guzu/ way but i use header section section section footer as layout and if i try to use this way it messes everything up and doesnt work
Victor Hernandez
@Theviajerock
Sep 10 2015 04:13
Hi!
Can somebody explain me something... ??
I am in this Waypoint :
and i really don't underestand it.
lds-walker
@lds-walker
Sep 10 2015 04:16
myCar.engines = 1;
the line above it creates a Car object called myCar
and now you're adding an engine property to it, and assigning it 1
or whatever number
according to the directions
Victor Hernandez
@Theviajerock
Sep 10 2015 04:19
I understand the part where i add the new property...
but this line confuses me
var myCar = new Car();
crlz
@crlz
Sep 10 2015 04:19
hey all! i was wondering if someone could help me out at the waypoint for targeting parents of jquery. it says the background isnt the right color but i followed the directions hmm <script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").parent().prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#left-well").parent().css("background-color", "red");
});
</script>
Victor Hernandez
@Theviajerock
Sep 10 2015 04:19
"new Car()"....
Mike Bobadilla
@mikebobadilla
Sep 10 2015 04:20
@Theviajerock you are assigning a variable to a car object
you can create as many as you want with different variables
thats what OOP is
lds-walker
@lds-walker
Sep 10 2015 04:22
the "new" is the key part
Victor Hernandez
@Theviajerock
Sep 10 2015 04:22
But previously i create a function called Car too...
Mike Bobadilla
@mikebobadilla
Sep 10 2015 04:23
@Theviajerock thats the constructor. you made a blueprint got an object
for an object*
Victor Hernandez
@Theviajerock
Sep 10 2015 04:24
thanks @bitsandbytez
CamperBot
@camperbot
Sep 10 2015 04:24
theviajerock sends brownie points to @bitsandbytez :sparkles: :thumbsup: :sparkles:
:star: 262 | @bitsandbytez | http://www.freecodecamp.com/bitsandbytez
Victor Hernandez
@Theviajerock
Sep 10 2015 04:24
Sorry if i botter
Mike Bobadilla
@mikebobadilla
Sep 10 2015 04:24
@Theviajerock naw no problem. thats waht this is for
Victor Hernandez
@Theviajerock
Sep 10 2015 04:25
by last... To be clear...

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

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

Is the same assign the new Car() to the object "myCar" and assign myCar.engines = 1 ?

var Car = function() {
this.engines = 1;
};
var myCar = new Car();

// Same than this...
myCar.engines = 1;

?
Mike Bobadilla
@mikebobadilla
Sep 10 2015 04:27
@Theviajerock youre adding a property of engines to your copy of the car object. personalizing it
Victor Hernandez
@Theviajerock
Sep 10 2015 04:28
I think that i understand.
Thanks a lot
CamperBot
@camperbot
Sep 10 2015 04:28
if you want to thank someone, put an @ before their name!
Mike Bobadilla
@mikebobadilla
Sep 10 2015 04:28
@Theviajerock its weird I know
lds-walker
@lds-walker
Sep 10 2015 04:28
the var Car function is the blueprint
so every new Car() you make will have whatever properties you define in there
so in your second example, you dont have to do a myCar.engines = 1 because it already has engines = 1 property on it
Mike Bobadilla
@mikebobadilla
Sep 10 2015 04:29
^ this
lds-walker
@lds-walker
Sep 10 2015 04:29
but also in your second example, your car doesn't have any wheels
Victor Hernandez
@Theviajerock
Sep 10 2015 04:30
@lds-walker i put the second example showing that i se this similar...
seems similar to me this :
var Car = function() {
this.engines = 1;
};
var myCar = new Car();
To this....... :
myCar.engines = 1;
Because add the same property and value
its like two ways of do the same thing
@bitsandbytez Yes, is weird jeje
lds-walker
@lds-walker
Sep 10 2015 04:33
yes, both of those are fine ways to get engine = 1 onto your car
you put the common things into the blueprint
like this.wheels = 4
but maybe you do a var ferrari = new Car() and give it a property of cylinders = 8
and a var civic = new Car() and give it a cylinders = 4
but they both have 4 wheels automatically because it's in the blueprint
Mike Bobadilla
@mikebobadilla
Sep 10 2015 04:34
@ianw3214 or a civic with a hemi :D
Victor Hernandez
@Theviajerock
Sep 10 2015 04:35
Jejee
Yes!!
crlz
@crlz
Sep 10 2015 04:35
$("#left-well").parent().css("background-color", "blue") <-- i followed this adding red but the console says im not right
Victor Hernandez
@Theviajerock
Sep 10 2015 04:35
Thanks a lot!!
CamperBot
@camperbot
Sep 10 2015 04:35
if you want to thank someone, put an @ before their name!
Victor Hernandez
@Theviajerock
Sep 10 2015 04:35
@lds-walker @bitsandbytez Thanks
CamperBot
@camperbot
Sep 10 2015 04:35
theviajerock sends brownie points to @lds-walker and @bitsandbytez :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for lds-walker
:warning: theviajerock already gave bitsandbytez points
Victor Hernandez
@Theviajerock
Sep 10 2015 04:35
You are very kind.
i have to go out
Have a nice day/night.
lds-walker
@lds-walker
Sep 10 2015 04:36
@crlz so what did you type?
crlz
@crlz
Sep 10 2015 04:37
i put <script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").parent().prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#left-well").parent().css("background-color", "red");
});
</script>
it asked for left-well to be red hmm
lds-walker
@lds-walker
Sep 10 2015 04:38
read the instructions, says it wants the parents of #target1
not left well
'''
$(".well:nth-child(2)").addClass("animated bounce");
});
'''
CamperBot
@camperbot
Sep 10 2015 04:42
:bulb: to format code use backticks! ``` more info
lds-walker
@lds-walker
Sep 10 2015 04:43
$(".well:nth-child(2)").addClass("animated bounce");
  });
lol
anyways, that's making all of the wells bounce
as opposed to the second child of the wells
am I missing something obvious here
if I use .css to color it blue, it's targeting the entire well
DTing
@dting
Sep 10 2015 04:45
@lds-walker you need a space between the .well and the :nth-child
crlz
@crlz
Sep 10 2015 04:46
@lds-walker thanks
CamperBot
@camperbot
Sep 10 2015 04:46
crlz sends brownie points to @lds-walker :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for lds-walker
lds-walker
@lds-walker
Sep 10 2015 04:48
wow, that is way more complicated than i thought
thanks @dting
CamperBot
@camperbot
Sep 10 2015 04:48
lds-walker sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1093 | @dting | http://www.freecodecamp.com/dting
DavidThms
@DavidThms
Sep 10 2015 04:50
hello, can someone help me with the reverse string bonfire.
this is what I have i dont see why it doesn't work
Bill
@kirah1314
Sep 10 2015 04:52
@DavidThms sure, paste your codes?
DavidThms
@DavidThms
Sep 10 2015 04:53
here it is
reverseString('hello').split('').reverse().join('');
DTing
@dting
Sep 10 2015 04:54
@DavidThms you code needs to go into the function
Bill
@kirah1314
Sep 10 2015 04:54
@DavidThms you have to return that, not put it on the function
DTing
@dting
Sep 10 2015 04:54
right now you are calling those function on the result of the function
Bill
@kirah1314
Sep 10 2015 04:57
@DavidThms the bonfire starts with:
function reverseString(str) {
  return str;
}
reverseString('hello');
str is 'hello' and you want to use the methods on str
DavidThms
@DavidThms
Sep 10 2015 05:00
uhh let me try, I understand a little better
Bill
@kirah1314
Sep 10 2015 05:00
@DavidThms function reverseString(str) this declares a function named reverseString which takes an argument named str
Ryan Wilson
@rbwilson
Sep 10 2015 05:04

Ok,

var Bike = function() {
  // Only change code below this line.
  speed = 100;
  function addUnit(value) {
    return value + "KM/H";
  }

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

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

I'm getting an error that says,, "The method getSpeed of myBike should be accessible outside the object
".

DavidThms
@DavidThms
Sep 10 2015 05:05
@kirah1314 ok i got it! thanks
CamperBot
@camperbot
Sep 10 2015 05:05
davidthms sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 232 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Sep 10 2015 05:05
@DavidThms awesome!
@rbwilson this.getSpeed
Ryan Wilson
@rbwilson
Sep 10 2015 05:09
wow, thanks @kirah1314. the JS syntax is killing me. Maybe someday I will figure it out haha
Bill
@kirah1314
Sep 10 2015 05:12
@rbwilson haha actually I'm still figuring this out too and more information here if you want to read up.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this
Ryan Wilson
@rbwilson
Sep 10 2015 05:22

missing one rule here apparently:

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

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

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


// Only change code above this line.

I get the error message, "The property engine of myCar should be a number"

Bill
@kirah1314
Sep 10 2015 05:23
@rbwilson myCar.engines = 1;
you can't use this on this one
Ryan Wilson
@rbwilson
Sep 10 2015 05:24
@kirah1314 so placing myCar before engines brings over inherit attributes?
Bill
@kirah1314
Sep 10 2015 05:25
@rbwilson var myCar = new Car(); this means myCar inherited attributes from Car
myCar.engines = 1 adds a new attribute specifically to myCar
Ryan Wilson
@rbwilson
Sep 10 2015 05:26
@kirah1314 awesome, thanks!
CamperBot
@camperbot
Sep 10 2015 05:26
rbwilson sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 233 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Ghost
@ghost~55ee52540fc9f982beaff6cd
Sep 10 2015 05:36
Hey guys, how do i send my code in this chat?
Bill
@kirah1314
Sep 10 2015 05:40
help format
CamperBot
@camperbot
Sep 10 2015 05:40

: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

Ghost
@ghost~55ee52540fc9f982beaff6cd
Sep 10 2015 05:58
var min = 0;
var max = 9;
function myFunction() {
  // Make myFunction return a random number between zero and nine instead of a decimal
  // Only change code below this line.

  return Math.floor(Math.random() * 10);
}
Can someone help me with this? I'm not sure what I'm doing wrong here but I can't get past the "You should be using the function given in the description to calculate the random in number in a range" message
But I think that is the formula?
Hans van Riet
@hansinla
Sep 10 2015 06:01

@peternguyen604 They want to see:

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

You’re generating a number between 0 and 10 (not inclusive).

Shaina Shockley
@sashockster
Sep 10 2015 06:03
Was it jus me or was "Waypoint: Target the same element with multiple jQuery Selectors" confusing as hell? lol
just*
Ghost
@ghost~55ee52540fc9f982beaff6cd
Sep 10 2015 06:06
Thanks for reply hansinla
CamperBot
@camperbot
Sep 10 2015 06:06
if you want to thank someone, put an @ before their name!
Ghost
@ghost~55ee52540fc9f982beaff6cd
Sep 10 2015 06:06
@hansinla
var min = 0;
var max = 9;
function myFunction() {
  // Make myFunction return a random number between zero and nine instead of a decimal
  // Only change code below this line.

  return Math.floor(Math.random() * (9 - 0 + 1)) + 0;
}

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return myFunction();})();
I tried that, but it's still not working. I even tried copying and pasting the formula directly from the instructions and just changing the variables
Hans van Riet
@hansinla
Sep 10 2015 06:07
@peternguyen604 Where did that +1 come from?
Ghost
@ghost~55ee52540fc9f982beaff6cd
Sep 10 2015 06:07

I got it from the instructions "We can use a certain mathematical expression to get a random number between two numbers.

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

By using this we can control the output of a random number."

@hansinla
DTing
@dting
Sep 10 2015 06:08
@peternguyen604 you want to actually use min and max in your code
  return Math.floor(Math.random()*(max-min+1))+min;
Hans van Riet
@hansinla
Sep 10 2015 06:09
@peternguyen604 Your comments in the code say: between 0 and 9. You’re adding 1 to that.
Ghost
@ghost~55ee52540fc9f982beaff6cd
Sep 10 2015 06:09
Ahhhh thanks so much @dting and @hansinla. They wanted the variables in there
CamperBot
@camperbot
Sep 10 2015 06:09
peternguyen604 sends brownie points to @dting and @hansinla :sparkles: :thumbsup: :sparkles:
:star: 357 | @hansinla | http://www.freecodecamp.com/hansinla
:star: 1098 | @dting | http://www.freecodecamp.com/dting
Isaac Calvo
@Icalvo1
Sep 10 2015 06:10
what does this error mean: Cannot GET /%22//gitter.im/freecodecamp/HalfWayClub/%22
aaah ... it still looks funny in here
Hans van Riet
@hansinla
Sep 10 2015 06:11
@badbabykosh Nice animation, but those are the shortest minutes ever...
DTing
@dting
Sep 10 2015 06:14

@hansinla @peternguyen604 the +1 is correct. you need to multiple Math.random() by how many values you want.

if you are looking for the range 1 to 2, both inclusive, that is 2 numbers.

Hans van Riet
@hansinla
Sep 10 2015 06:18
@dting He was looking between 0 and 9, according to his comments in the code.
DTing
@dting
Sep 10 2015 06:20
that still should be Math.floor(Math.random() * (9-0+1)) + 0
Hans van Riet
@hansinla
Sep 10 2015 06:21
@dting That would not be between, that would include 9. Semantics.
DTing
@dting
Sep 10 2015 06:22
oh. maybe 0 should be excluded too?
Hans van Riet
@hansinla
Sep 10 2015 06:23
@dting You’re right if we have take the instruction literally, 0 should be excluded.
KristyCat
@KristyCat
Sep 10 2015 06:24
cant figure out the nth child. here is the code:
$("#right-well:nth-child(2)").addClass("animated bounce");
$("#left-well:nth-child(2)").addClass("animated bounce");
it makes the whole elment bounce
DTing
@dting
Sep 10 2015 06:25
you would need a space between the selector and the :nth-child
KristyCat
@KristyCat
Sep 10 2015 06:28
omg, one space. it worked ty
DTing
@dting
Sep 10 2015 06:29
np
Ankit Panwar
@coderNoob
Sep 10 2015 07:18
Need help on this. How do i do it?
var Car = function() {
   this.wheels = 4;
};

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

//Add the property "engines" to myCar, and make it a number.
Ashraful Islam
@iashraful
Sep 10 2015 07:20
@coderNoob myCar.engines = 1;
Ankit Panwar
@coderNoob
Sep 10 2015 07:22
@iashraful shouldn't myCar[engines] =1; work as well?
DTing
@dting
Sep 10 2015 07:22
engines is undefined
you would have to use a string
myCar["engines"] = 1;
Ashraful Islam
@iashraful
Sep 10 2015 07:23
@coderNoob nah, need quotes myCar['engines'] = 1;
@dting you beat me
:D
DTing
@dting
Sep 10 2015 07:24
normally you would use dot notation rather than brackets if you dont have special characters in the property name or the property isn't a variable.
Ashraful Islam
@iashraful
Sep 10 2015 07:25
Objects the misunderstood arrrays :D
AndyDuffy
@AndyDuffy
Sep 10 2015 08:13
Thanks @Rafase282
CamperBot
@camperbot
Sep 10 2015 08:13
andyduffy sends brownie points to @rafase282 :sparkles: :thumbsup: :sparkles:
:star: 421 | @rafase282 | http://www.freecodecamp.com/rafase282
Ankit Panwar
@coderNoob
Sep 10 2015 08:27
@iashraful Is the Bonfire: Return Largest Number in Arrays working now?
DTing
@dting
Sep 10 2015 08:34
@coderNoob working for me
Ankit Panwar
@coderNoob
Sep 10 2015 08:49
var s = [];
  for(var i in arr){
    var v = 0;
    var a = arr[i];
    for(var j in a){
      if(a[j]>v)
        s.push(v);
    }
  }
Its returning [0,0,0,0,0....] @dting
DTing
@dting
Sep 10 2015 08:50
      if(a[j]>v)
        s.push(v);
thats not correct
Ankit Panwar
@coderNoob
Sep 10 2015 08:50
@dting Nevermind. It worked. Which is weird cause I executed the below in the first place and it didn't work the first time.
:|
```
var s = [];
for(var i in arr){
var v = 0;
var a = arr[i];
for(var j in a){
if(a[j]>v)
v = a[j];
}
s.push(v);
}
Dealga McArdle
@zeffii
Sep 10 2015 09:45
hey this bonfire about symmetric difference bugs me
" [2, 2, 3, 5] " is not a set.
[2,3,5] would be.
unless somehow the two 2's are different in some way... which isn't clarified
Gary Wong
@gary-w
Sep 10 2015 09:58
This message was deleted
This message was deleted
This message was deleted
This message was deleted
Dealga McArdle
@zeffii
Sep 10 2015 10:01
might be handier to type it into a code editor first, then pad it with tripple backticks, then paste it @gary-w
Gary Wong
@gary-w
Sep 10 2015 10:02
var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
function myFunction(){
  // Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".

  // Only change code below this line.
  var heads = 0;
  var tails = 1;

  if (flip === 0) {
    return heads;
  } else {
    return tails;
  }

  myFunction();
  // Only change code above this line.
}

// We use this function to show you the value of your variable in your output box.
var result = myFunction();if(typeof(flip) !== "undefined" && typeof(flip) === "number" && typeof(result) !== "undefined" && typeof(result) === "string"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}
challenge #148 - dont understand why it doesnt work. appreciated.
Dealga McArdle
@zeffii
Sep 10 2015 10:02
function sym(args) {
  // insert magic here
  return arguments;
}
flip will only be evaluated once
@gary-w
and you are calling myFunction, from inside myFunction, thus.. unintentionally most likely
Wastinik
@Wastinik
Sep 10 2015 10:04
@gary-w i think you're trying to call the function inside the function too...
a1rr0wh3ad
@a1rr0wh3ad
Sep 10 2015 10:06
@gary-w also, i think the expected output is a string. "heads" or "tails".
Gary Wong
@gary-w
Sep 10 2015 10:07
thanks @zeffii @Wastinik that’s right.. what should I do to call the program to run then?
CamperBot
@camperbot
Sep 10 2015 10:07
gary-w sends brownie points to @zeffii and @wastinik :sparkles: :thumbsup: :sparkles:
:star: 325 | @zeffii | http://www.freecodecamp.com/zeffii
:star: 189 | @wastinik | http://www.freecodecamp.com/wastinik
Dealga McArdle
@zeffii
Sep 10 2015 10:07
@gary-w
function myFunction(){
  // Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".

  // Only change code below this line.
  var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
  return (flip) ? 'tails' : 'heads';

}
stare at that until you understand it
Wastinik
@Wastinik
Sep 10 2015 10:08
@gary-w it's already calling it, you don't need too.. but you would call it just outside in some other case
Dealga McArdle
@zeffii
Sep 10 2015 10:09
if flip is 1 , then the return value is the string tails otherwise it returns heads
(this is a shortcut way of writing if-else statements)
something to keep in mind..
@gary-w the program you are being asked to write isn't looking for numbers as return values, but strings... 'tails', 'heads'
Gary Wong
@gary-w
Sep 10 2015 10:14
thanks @a1rr0wh3ad @zeffii @Wastinik .. i always thought return can only call functions. didn’t know it can also print strings..
CamperBot
@camperbot
Sep 10 2015 10:14
gary-w sends brownie points to @a1rr0wh3ad and @zeffii and @wastinik :sparkles: :thumbsup: :sparkles:
:warning: gary-w already gave wastinik points
:warning: gary-w already gave zeffii points
:star: 302 | @a1rr0wh3ad | http://www.freecodecamp.com/a1rr0wh3ad
Gary Wong
@gary-w
Sep 10 2015 10:15
@zeffii what’s keyword should i look up to find out more about your short-cut way to create if else statement using “?”
Dealga McArdle
@zeffii
Sep 10 2015 10:16
this is called a 'ternary expression;
and that is probably the worst wiki page for such an epic feature. in the world.
@gary-w I don't think this is covered in the FreeCodeCamp curriculum. but it's a completely legitimate feature of the javascript language
most languages have 'shorthands' like this, and can be used whenever it makes your code easier to read. I use it especially for really short statements.
Gary Wong
@gary-w
Sep 10 2015 10:20
awesome. thank you @zeffii !
CamperBot
@camperbot
Sep 10 2015 10:20
gary-w sends brownie points to @zeffii :sparkles: :thumbsup: :sparkles:
:warning: gary-w already gave zeffii points
Dealga McArdle
@zeffii
Sep 10 2015 10:22
maybe it's best to avoid using it until you have a better grasp on javascript
it might be better initially to have all logic on separate lines, like the if-else statement syntax pushes you towards
but in fairness.. a ? x : y is no more mind bending than nested Jquery selectors...
Daniel O'Mahony
@OMahonyD
Sep 10 2015 10:39
Hi all, I found this last night and found it really REALLY helpful. Been playing with JavaScript for a few years now but this really drove some basic concepts home: https://www.youtube.com/watch?v=zf_cb_Nw5zY
Adam Pinsky
@adampinsky
Sep 10 2015 10:53
I'
oops...
i'm stuck on Bonfire:Seek and Destroy. I've traveled down so many different avenues that now I'm completely lost. Any guiding light would really be appreciated.
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 10:57
@adampiinsky have some code we can look at?
Adam Pinsky
@adampinsky
Sep 10 2015 11:01
I don't. i reset the code without having copied it. (an irrational move I'll admit) I'll can say that I think my problem lays in my understanding of Arguments as Objects.
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 11:01
bf seek and destroy
CamperBot
@camperbot
Sep 10 2015 11:01

:fire:Bonfire: Seek and Destroy :link:

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

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

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

more info:  bf details | bf links | hint

Adam Pinsky
@adampinsky
Sep 10 2015 11:02
oh... that code....thank you
CamperBot
@camperbot
Sep 10 2015 11:02
if you want to thank someone, put an @ before their name!
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 11:02
wait thats the exercice =)
Dealga McArdle
@zeffii
Sep 10 2015 11:04
@adampiinsky use .filter()
oh.. wait.. maybe not. the test cases are a little bit more involved
( I didn't use filter in my solution..btw)
Rory Smith
@alanbuchanan
Sep 10 2015 11:06
filter is a good idea, i used it
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 11:06
well in the end filter works also
Dealga McArdle
@zeffii
Sep 10 2015 11:07
would be neat if there was a mode to download the stub function and all the tests in one place, so all we have to do is open (some texteditor that can execute js), add code to the stub and run -
Rory Smith
@alanbuchanan
Sep 10 2015 11:08
@zeffii i think there might be. but i just put the tests into my unit testing file. we'll have to unit test at some point in the future anyway, so i just think it's good to get into the practise of doing it now
Dealga McArdle
@zeffii
Sep 10 2015 11:10
right now i copy the tests to the end of the stub and run them all sequentially in sublime
Rory Smith
@alanbuchanan
Sep 10 2015 11:10
that's one way of doing it
Dealga McArdle
@zeffii
Sep 10 2015 11:10
not a lot of work.. but still it's repetition
i prefer not to code it on the webpage, for (what i think are) obvious reasons
Rory Smith
@alanbuchanan
Sep 10 2015 11:11
same
i hate it
Adam Pinsky
@adampinsky
Sep 10 2015 11:13
@zeffii I made an attempt at skirting filter but I was getting hung up on arguments as Arguments. But I think I've grasped it.
Dealga McArdle
@zeffii
Sep 10 2015 11:13
@adampiinsky it's great seeing alternative solutions after solving them
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 11:20
bf Arguments Optional
CamperBot
@camperbot
Sep 10 2015 11:20
Sorry, can't find a bonfire called arguments optional . [ Check the map? ]
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 11:21
I think i just made my head explode lol
Rory Smith
@alanbuchanan
Sep 10 2015 11:21
@FabioParaiso that's a weird one too
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 11:22
grasping the return of functions... bah
Erik Kynast
@carnivean
Sep 10 2015 11:23
Can someone help me with setting up the cloud 9 workspace for my basejumps?
Following the directions gives me the following error:
events.js:72
throw er; // Unhandled 'error' event
^
TypeError: Object [object Object] has no method 'isAbsolute'
at Generator.processDirectory (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/generator-angular-fullstack/util.js:120:19)
at Generator.generateProject (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/generator-angular-fullstack/app/generator.js:394:14)
at /home/ubuntu/.nvm/v0.10.35/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/lib/base.js:421:16
at processImmediate [as _immediateCallback] (timers.js:354:15)
Rory Smith
@alanbuchanan
Sep 10 2015 11:32
bf map the debris
CamperBot
@camperbot
Sep 10 2015 11:32

: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

Rory Smith
@alanbuchanan
Sep 10 2015 11:32
i don't understand how to figure out the formula to convert altitude to orbital period
Dealga McArdle
@zeffii
Sep 10 2015 11:32
which step is that @carnivean
@alanbuchanan the formula can be found on the linked wiki page
it's only one or two lines
Ankit Panwar
@coderNoob
Sep 10 2015 11:38
what if i want to include an image from my pc in the code on codepen?
Dealga McArdle
@zeffii
Sep 10 2015 11:38
you can't
unless you upload it somewhere or convert it to a binary string and embed it in the html/css
Rory Smith
@alanbuchanan
Sep 10 2015 11:39
@coderNoob you could upload it to imgur (or similar) and then make a url link to it
Erik Kynast
@carnivean
Sep 10 2015 11:39
zeffi: it looks like they changed the generator-script to req. node 0.12
Dealga McArdle
@zeffii
Sep 10 2015 11:40
@carnivean fixed then?
Erik Kynast
@carnivean
Sep 10 2015 11:40
and c9 uses node 0.10 as default
Dealga McArdle
@zeffii
Sep 10 2015 11:40
ah..yeah, i remember updating too
Erik Kynast
@carnivean
Sep 10 2015 11:41
Will submit a bug report, so that they can fix it
Pierre Wizla
@pwizla
Sep 10 2015 11:41

Hey everyone! Hope you're having fun coding :-)

Am I the only one finding that the newly added Object Oriented Programming waypoints are confusing?
For instance the "Condense arrays with reduce" doesn't even have a proper instruction…

(To make it clear, I'm not looking for a solution; just looking for feedback from other fellow coders)
Rory Smith
@alanbuchanan
Sep 10 2015 11:42
@pwizla i didn't find it confusing but i had seen reduce before
Dealga McArdle
@zeffii
Sep 10 2015 11:43
@pwizla i agree
Rory Smith
@alanbuchanan
Sep 10 2015 11:43
@pwizla their explanation would never be as accurate or thorough as the docs, anyway
Pierre Wizla
@pwizla
Sep 10 2015 11:44
OK. As a newbie I find it confusing. I wanted to submit a bug but apparently it's already been submitted.
Dealga McArdle
@zeffii
Sep 10 2015 11:44
it could say' get the sum of the array using .reduce()`
JamesKee
@JamesKee
Sep 10 2015 11:44
var newArray = [];
function chunk(arr, size) {

  for(i=0;i < arr.length; i+=size){
    newArray.push(arr.slice(i, i + size));
  }

  return newArray;
}
chunk([0, 1, 2, 3, 4, 5], 4);
Pierre Wizla
@pwizla
Sep 10 2015 11:44
Thanks for your input @zeffii and @alanbuchanan
The problem is not that it lacks explanation, alan. The problem is that they don't clearly ask what to do ;)
CamperBot
@camperbot
Sep 10 2015 11:44
pwizla sends brownie points to @zeffii and @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 326 | @zeffii | http://www.freecodecamp.com/zeffii
:star: 305 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
JamesKee
@JamesKee
Sep 10 2015 11:45
could someone help me out here, it says that I am wrong, but if I copy/paste the correct values are returned
sorry, this is chunky monkey bonfire
Rory Smith
@alanbuchanan
Sep 10 2015 11:45
@pwizla i see. maybe it changed a couple of days ago, they switched that section around in the order of the curriculum so maybe something went wrong
Dealga McArdle
@zeffii
Sep 10 2015 11:46
@pwizla. I gave the problem description, -- not an answer
i agree that the provided problem description is non-existant
Pierre Wizla
@pwizla
Sep 10 2015 11:46
@zeffii Yes! Exactly what I was looking for. Thank you.
CamperBot
@camperbot
Sep 10 2015 11:46
pwizla sends brownie points to @zeffii :sparkles: :thumbsup: :sparkles:
:warning: pwizla already gave zeffii points
Dealga McArdle
@zeffii
Sep 10 2015 11:46
it should not be just a matter 'copy this code into the function and run it '
Pierre Wizla
@pwizla
Sep 10 2015 11:47
@alan, Yes, this section was non-existent yesterday. I was going to keep on completing the Bonfires and saw the new section today.
Dealga McArdle
@zeffii
Sep 10 2015 11:47
but as it stands, i that is exactly what it is.
Pierre Wizla
@pwizla
Sep 10 2015 11:47
Totally agree zeffii
JamesKee
@JamesKee
Sep 10 2015 11:47
I explained it incorectly
Dealga McArdle
@zeffii
Sep 10 2015 11:48
so a good description would be ' return the sum of the array, using .reduce'
Rory Smith
@alanbuchanan
Sep 10 2015 11:48
@pwizla it was just a little later on in the map but they decided to switch it
JamesKee
@JamesKee
Sep 10 2015 11:48
I mean I copied each "check" into my code and it returns the correct answer
Rory Smith
@alanbuchanan
Sep 10 2015 11:48
@pwizla (i think, at least)
JamesKee
@JamesKee
Sep 10 2015 11:48
but for some reason each check is coming back as false
Pierre Wizla
@pwizla
Sep 10 2015 11:49
Yes, for instance @zeffii . OK, thank you @alanbuchanan . I understand that FCC curriculum is a constant work in progress, but it is sometimes confusing for users already engaged in the learning process.
CamperBot
@camperbot
Sep 10 2015 11:49
pwizla sends brownie points to @zeffii and @alanbuchanan :sparkles: :thumbsup: :sparkles:
:warning: pwizla already gave zeffii points
:warning: pwizla already gave alanbuchanan points
Pierre Wizla
@pwizla
Sep 10 2015 11:49
It's as if teachers re-arrange the program of the year constantly through the college year ;)
Dealga McArdle
@zeffii
Sep 10 2015 11:49
@pwizla all human endeavor can be confusing :)
Pierre Wizla
@pwizla
Sep 10 2015 11:49
haha, exactly ;)
Dealga McArdle
@zeffii
Sep 10 2015 11:50
but yeah, FCC is still a little fluid
it may be good practice for realworld. where also nothing is static...very often
Jack Demynn
@infectiouscode
Sep 10 2015 11:50
Hi, I'm new to coding, I know a little about HTML and CSS but this one code is confusing me (It wasn't taught on codeacademy where I originally learnt it) I'm trying to add the red-text code to make my H2 header red, but it wont work? Anyone know what i'm doing wrong? This is the code I put in: <h2 style="red-text">CatPhotoApp</h2>
Pierre Wizla
@pwizla
Sep 10 2015 11:51
Totally agree again, @zeffii .
Anyway, need to go back to work for now (my main work, not coding). Thanks a lot for your input and this little conversation, @zeffii and @alanbuchanan :-) See you later maybe.
CamperBot
@camperbot
Sep 10 2015 11:51
pwizla sends brownie points to @zeffii and @zeffii and @alanbuchanan :sparkles: :thumbsup: :sparkles:
:warning: pwizla already gave zeffii points
:warning: pwizla already gave zeffii points
:warning: pwizla already gave alanbuchanan points
Dealga McArdle
@zeffii
Sep 10 2015 11:51
<h2 class='red-text'>
Rory Smith
@alanbuchanan
Sep 10 2015 11:51
@pwizla see you! :wave:
Jack Demynn
@infectiouscode
Sep 10 2015 11:52
Sorry zeffi that is what I wrote I typed it out on here wrong. I'll copy the entire code

<style>
.h2 red-text
</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

Dealga McArdle
@zeffii
Sep 10 2015 11:52
h2 is not a class
so drop the prefix .
Jack Demynn
@infectiouscode
Sep 10 2015 11:52
So when typing in the code, should I not be putting the word class?
Rory Smith
@alanbuchanan
Sep 10 2015 11:53
@infectiouscode h2 has a class, but is not a class itself
Jack Demynn
@infectiouscode
Sep 10 2015 11:53
Could you define what a class is please
Dealga McArdle
@zeffii
Sep 10 2015 11:53
let me find that bonfire. hold on @infectiouscode
Jack Demynn
@infectiouscode
Sep 10 2015 11:53
It's the main thing I get mostly stuck on
Rory Smith
@alanbuchanan
Sep 10 2015 11:54
@infectiouscode if you had lots of different HTML elements in your code and you wanted all of them to have the same sort of style, you could give them all the same class
then, you wouldn't have to style them all separately @infectiouscode
Dealga McArdle
@zeffii
Sep 10 2015 11:54
what number bonfire is that @infectiouscode
Jack Demynn
@infectiouscode
Sep 10 2015 11:55
Number 10
JamesKee
@JamesKee
Sep 10 2015 11:56
can someone please tell me if there is something wrong in my code for the chunky monkey bonfire? it returns the correct answers, but the freecodecamp client doesn't accept the answers as correct. I would really appreciate it.
var newArray = [];
function chunk(arr, size) {

  for(i=0;i < arr.length; i+=size){
    newArray.push(arr.slice(i, i + size));
  }

  return newArray;
}

chunk(['a', 'b', 'c', 'd'], 2);
Dealga McArdle
@zeffii
Sep 10 2015 11:57
@infectiouscode does this make sense ?
<style>
  h2 {
    color: blue;
  }

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

<h2 class='red-text'>CatPhotoApp</h2>
the .red-text overrides the h2 color
Jack Demynn
@infectiouscode
Sep 10 2015 11:57
Ahhh I see... I thought I had to completely wipe out the blue text.
I'll just try it and see!
Dealga McArdle
@zeffii
Sep 10 2015 11:58
@infectiouscode writing instructions for these things is deceptively difficult.
Jack Demynn
@infectiouscode
Sep 10 2015 11:59
Awesome Zeffi, it worked! Thanks so much!!
CamperBot
@camperbot
Sep 10 2015 11:59
if you want to thank someone, put an @ before their name!
Jack Demynn
@infectiouscode
Sep 10 2015 11:59
Oh okay, thanks :P
CamperBot
@camperbot
Sep 10 2015 11:59
if you want to thank someone, put an @ before their name!
Jack Demynn
@infectiouscode
Sep 10 2015 11:59
Thanks @zeffii
CamperBot
@camperbot
Sep 10 2015 11:59
infectiouscode sends brownie points to @zeffii :sparkles: :thumbsup: :sparkles:
:star: 327 | @zeffii | http://www.freecodecamp.com/zeffii
Dealga McArdle
@zeffii
Sep 10 2015 11:59
if you re-read the description... @infectiouscode does it get a different meaning?
please re-read the description :)
as an experiment
Jack Demynn
@infectiouscode
Sep 10 2015 12:00
I'm not to sure what it means by "declaration" @zeffii
JamesKee
@JamesKee
Sep 10 2015 12:00
I figured it out but don't quite understand why that fixed it. Putting the "var newArray" code into the function gets past the FCC checks. does anyone know why that would make a difference?
Dealga McArdle
@zeffii
Sep 10 2015 12:01
@infectiouscode your mantra from now on
HASH ID
# if the thing is an ID
and . if it's a class
Jack Demynn
@infectiouscode
Sep 10 2015 12:01
But what's a declaration? It confused me when it said it in the code
Rory Smith
@alanbuchanan
Sep 10 2015 12:02
@infectiouscode when you set up something for the first time
Dealga McArdle
@zeffii
Sep 10 2015 12:03
in the style element -- the parts that start with . are class declarations
and # , are id declarations
Jack Demynn
@infectiouscode
Sep 10 2015 12:03
It was just confusing but it tells me to get rid of the existing declaration, which made me assume I get rid of the blue-text but I wasn't meant to.
Dealga McArdle
@zeffii
Sep 10 2015 12:04
@infectiouscode you can remove the h2 { color: blue } 'declaration'
and add the .red-text { .... } declaration
I just didn't delete it in my response to you
Jack Demynn
@infectiouscode
Sep 10 2015 12:05
So is a declaration just the code you put in?
Dealga McArdle
@zeffii
Sep 10 2015 12:06
it's more like ... i want a name for a particular effect... and i will declare it's name to be .red-text
Jack Demynn
@infectiouscode
Sep 10 2015 12:06
So would this p { background-color: red; } be a declaration?
Dealga McArdle
@zeffii
Sep 10 2015 12:06
This message was deleted
marzelin
@marzelin
Sep 10 2015 12:06
@infectiouscode no - this is a rule
Jack Demynn
@infectiouscode
Sep 10 2015 12:06
Oh okay, so it's the effect you're adding thats a declaration
Dealga McArdle
@zeffii
Sep 10 2015 12:06
meaning. for all elements of p in my html, please do the following
what? @marzelin
Jack Demynn
@infectiouscode
Sep 10 2015 12:07
So when it said in bonfire ten to get rid of the existing declaration was it requesting that I removed the blue and added the red?
Dealga McArdle
@zeffii
Sep 10 2015 12:07
yes.. it seems so
Jack Demynn
@infectiouscode
Sep 10 2015 12:08
Right okay that makes sense, so is the p { apart of the declaration or is it just the background-color?
marzelin
@marzelin
Sep 10 2015 12:08
@zeffii p { background-color: red; } <- rule
background-color: red; <- declaration
p <- selector
Dealga McArdle
@zeffii
Sep 10 2015 12:08
that's a rule.. as a marzellin points out
Jack Demynn
@infectiouscode
Sep 10 2015 12:09
I see okay so just to experiment to make sure I know it, would this be a declaration? margin:500px;
Dealga McArdle
@zeffii
Sep 10 2015 12:09
looks like it :)
Jack Demynn
@infectiouscode
Sep 10 2015 12:10
Okay awesome, thanks @zeffii
CamperBot
@camperbot
Sep 10 2015 12:10
infectiouscode sends brownie points to @zeffii :sparkles: :thumbsup: :sparkles:
:warning: infectiouscode already gave zeffii points
Jack Demynn
@infectiouscode
Sep 10 2015 12:10
thanks @marzelin
CamperBot
@camperbot
Sep 10 2015 12:10
infectiouscode sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles:
Dealga McArdle
@zeffii
Sep 10 2015 12:10
thanks @marzelin
CamperBot
@camperbot
Sep 10 2015 12:10
:star: 162 | @marzelin | http://www.freecodecamp.com/marzelin
Dealga McArdle
@zeffii
Sep 10 2015 12:12
keep the page that @marzelin linked bookmarked @infectiouscode :)
Jack Demynn
@infectiouscode
Sep 10 2015 12:13
Okay :) @zeffii
Dealga McArdle
@zeffii
Sep 10 2015 12:13
or make your own graphic :) -- that 's the worst MDN page i've ever seen.
all these thick borders
Jack Demynn
@infectiouscode
Sep 10 2015 12:15
Haha XD
Out of curiosity because I studied graphics design for 3 years, with just html and css could you make a really awesome site? Or is it reccomended once you have them properly down you learn other codes aswell?
marzelin
@marzelin
Sep 10 2015 12:18
@infectiouscode you could, but it would be like a page in a book, (almost) no interactivity
Jack Demynn
@infectiouscode
Sep 10 2015 12:19
What codes do you suggest to make a really good website? @marzelin
marzelin
@marzelin
Sep 10 2015 12:20
@infectiouscode by codes you mean programming languages?
Jack Demynn
@infectiouscode
Sep 10 2015 12:20
@marzelin I do, sorry I'm not so well learnt in the terms yet
marzelin
@marzelin
Sep 10 2015 12:22
@infectiouscode to add inteaction (behaviour) to your pages, you need to know JavaScript
Jack Demynn
@infectiouscode
Sep 10 2015 12:23
@marzelin How long would you say it would take to become efficient with all 3 of these languages?
marzelin
@marzelin
Sep 10 2015 12:25
@infectiouscode if you learn fast and have good resources a week
Jack Demynn
@infectiouscode
Sep 10 2015 12:25
Wow, I thought it'd take longer.
@marzelin it's because there's a few web development jobs in the area that im moving to, that also include web design and I really want to get into one of them
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:26
@marzelin a week?
I'd disagree
Rory Smith
@alanbuchanan
Sep 10 2015 12:27
@infectiouscode it definitely takes longer
Jack Demynn
@infectiouscode
Sep 10 2015 12:28
@alanbuchanan How long would you estimate?
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:29
@infectiouscode depends from person to person
Rory Smith
@alanbuchanan
Sep 10 2015 12:29
@infectiouscode why rush it? when you learn, make sure you understand everything. if you become knowledgable about everything you learn about, you're further ahead than people that rush it by default
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:29
@alanbuchanan true words
Rory Smith
@alanbuchanan
Sep 10 2015 12:30
here is an interesting article entitled Teach Yourself Programming in Ten Years
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:31
Yep, that's a popular one
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 12:34
10 year is to dam high! (insert meme image)
=P
But got curious. Gonna read eheh
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:38
@FabioParaiso 10 year = pro
= real programmer
= not some 30 day nonsense after which you shouldn't even be considered a beginner
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 12:38
eheh I know I know =)
I was kidding of course
like everything getting knowledge has a great part in experience
and for experience you need time ;)
had I would say even 10 year is so so. Always new and different things to learn =)
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:40
:)
Jack Demynn
@infectiouscode
Sep 10 2015 12:41
I was just curious I wasn't trying to rush things
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 12:41
@infectiouscode It's good to have a time frame of course =)
Jack Demynn
@infectiouscode
Sep 10 2015 12:42

Can I have some help on bonfire 12 guys? The font doesnt seem to change to 16 px This is what I've put in <style>
.red-text {
color: red;
.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> Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. </p>

CamperBot
@camperbot
Sep 10 2015 12:42
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
marzelin
@marzelin
Sep 10 2015 12:43
@awesomeaniruddh the question was how long it takes to be efficient not to now everything and immediately produce error free code at all times. For that even 10 years is not enough.
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 12:44
exactly =)
Is that even achievable?
marzelin
@marzelin
Sep 10 2015 12:46
@FabioParaiso i think it is, but isn't woth the cost needed to achieve that
Jack Demynn
@infectiouscode
Sep 10 2015 12:46
Can anyone help with bonfire 12 please
CamperBot
@camperbot
Sep 10 2015 12:46
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
marzelin
@marzelin
Sep 10 2015 12:47
@infectiouscode you messed with }
Jack Demynn
@infectiouscode
Sep 10 2015 12:48
Can you elaborate please? @marzelin
Rory Smith
@alanbuchanan
Sep 10 2015 12:48
@marzelin what can you become efficient with after a week of programming? maybe a little html and css, but javascript too?
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 12:49
Well and don't forget it depends on a lot of things
marzelin
@marzelin
Sep 10 2015 12:49
@infectiouscode you enclosed p in red-text rule, get it out. And remove . before p.
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 12:49
if you have a strong math background things will go smoother in my opinion
Jack Demynn
@infectiouscode
Sep 10 2015 12:49
Thanks @marzelin that helped!
CamperBot
@camperbot
Sep 10 2015 12:49
infectiouscode sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles:
:warning: infectiouscode already gave marzelin points
Rory Smith
@alanbuchanan
Sep 10 2015 12:50
@FabioParaiso unlike us, with our 270-page thesis on finding the smallest common denominator of an array :)
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 12:52
Lol well i'm offended by that =P
But yes not our brightest moments lol
dam smalles common denominator... I had nightmares lol
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:53
Which bf is that?
Rory Smith
@alanbuchanan
Sep 10 2015 12:53
@FabioParaiso i'm sure you know more about math than me :wink2:
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 12:53
bf small common
CamperBot
@camperbot
Sep 10 2015 12:53
Sorry, can't find a bonfire called small common. [ Check the map? ]
Rory Smith
@alanbuchanan
Sep 10 2015 12:53
bf smallest common multiple
CamperBot
@camperbot
Sep 10 2015 12:53

:fire:Bonfire: Smallest Common Multiple :link:

function smallestCommons(arr) {
  return arr;
}


smallestCommons([1,5]);

Find the smallest number that is evenly divisible by all numbers in the provided range.

more info:  bf details | bf links | hint

Aniruddh Agarwal
@anrddh
Sep 10 2015 12:53
Oh this one
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 12:53
that =P
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:53
Simple solution :/
Loop 1 through 5
and then infinite loop
Rory Smith
@alanbuchanan
Sep 10 2015 12:54
@awesomeaniruddh i followed your approach for it
the brute force
Saminu
@Saminu
Sep 10 2015 12:54

function palindrome(str) {
// Good luck!
//str.toLowerCase().replace(/apples/gi,'')

str.replace(/[^\w\s]|_/g, "").replace(/\s+/g, "");
str = str.toLowerCase();

if (str === str.split('').reverse().join('')){
    return true
}
return false;

}

any help here would be appreciated
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:55
@alanbuchanan Simplest and works IMHO
Dealga McArdle
@zeffii
Sep 10 2015 12:55
@infectiouscode you can learn javascript superfically in a short period, but if you are a non-coder you should not be deluded into thinking that it's going to be as easy as reading a book
learning to program well (or to be able to accomplish anything meaningful) is a massive time-sink.
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:56
And it's one that pays off!
Jack Demynn
@infectiouscode
Sep 10 2015 12:57
Nooo, I've been trying for a while and already find it complex, I've even gone so far to install coding challenges on my phone for when im out and about, I'm trying it all day
Dealga McArdle
@zeffii
Sep 10 2015 12:57
like like if you only speak one language, and you start learning another spoken language
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:57
@infectiouscode it's frustrating, sure
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 12:57
Because in the end that is always a better way to do what you are doing =P
Jack Demynn
@infectiouscode
Sep 10 2015 12:57
I say a while I mean 1 week and a half
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:57
That's way too less time!
Dealga McArdle
@zeffii
Sep 10 2015 12:57
i've been learning how to code for about 7 years now... it's an angoing journey
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:57
I've been at it for 5 years
Soumya Rauth
@soumyaRauth
Sep 10 2015 12:58
I skipped the ziplines and moved on to other sections... should I finish the ziplines first?
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:58
I was frustrated when I started with Node and Angular
@soumyaRauth It is recommended
Dominic Imbuga
@Domminique
Sep 10 2015 12:58
Bonfire: Reverse a String
CamperBot
@camperbot
Sep 10 2015 12:58

:fire:Bonfire: Reverse a String :link:

function reverseString(str) {
  return str;
}

reverseString('hello');

Reverse the provided string.

more info:  bf details | bf links | hint

Dealga McArdle
@zeffii
Sep 10 2015 12:58
and there are levels of competencies you reach..
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:58
but I kept at it
Jack Demynn
@infectiouscode
Sep 10 2015 12:58
How far into coding do you reckon you have to be to be at job level
Rory Smith
@alanbuchanan
Sep 10 2015 12:58
@Saminu the problem is your regex
Jack Demynn
@infectiouscode
Sep 10 2015 12:58
for website dev and stuff
Dealga McArdle
@zeffii
Sep 10 2015 12:58
like you plateau ...and then the next difficult concept comes along.. you struggle with it... and with enough struggle you reach the next level
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:58
Complete the entire FCC curriculum and you should be at job level
That's ~1600 hours
Dealga McArdle
@zeffii
Sep 10 2015 12:59
^^ what @awesomeaniruddh says
Jack Demynn
@infectiouscode
Sep 10 2015 12:59
ouch
Rory Smith
@alanbuchanan
Sep 10 2015 12:59
@infectiouscode why not look at job specs on job sites? when you know everything on their list, you're starting to get ready
Dealga McArdle
@zeffii
Sep 10 2015 12:59
it's worth it tho
Jack Demynn
@infectiouscode
Sep 10 2015 12:59
A lot of websites ask for c++ html, css javascript and sql
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:59
@alanbuchanan one of the biggest problems with job postings is that they're not always accurate
Soumya Rauth
@soumyaRauth
Sep 10 2015 12:59
@awesomeaniruddh I have been struggling to figure out pomodoro clock zipline for days. Though I finished the previous ones. So I decided to move on and finish them later.
Aniruddh Agarwal
@anrddh
Sep 10 2015 12:59
They're done by HR guys who don't know shit about programming
Dealga McArdle
@zeffii
Sep 10 2015 13:00
c++ is nothing like javascript
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:00
@soumyaRauth What's the issue?
Maybe I can help out? No promises though
C++ is much harder than JS, because JS takes care of a lot of things for you
Rory Smith
@alanbuchanan
Sep 10 2015 13:01
@awesomeaniruddh well here is a good up to date guide for potential javascript devs. also, check stackoverflow careers postings, because they're less likely to be posted by those HR guys
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:01
C++ is lower level, and gives you a lot more control
lot more control = you must know your shit
Soumya Rauth
@soumyaRauth
Sep 10 2015 13:01
@awesomeaniruddh Nothing is working. I made a mess out of my code.. http://codepen.io/soumya_rauth/pen/PPoZMM
Jack Demynn
@infectiouscode
Sep 10 2015 13:01
Okay thanks guys!
CamperBot
@camperbot
Sep 10 2015 13:01
if you want to thank someone, put an @ before their name!
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:02
@alanbuchanan Great
I only know the answers to the last 3 questions in the standard JS questions
And I thought I was getting good at js... :P
@soumyaRauth your timer does not seem to be advancing
Rory Smith
@alanbuchanan
Sep 10 2015 13:02
@awesomeaniruddh in that case i am jealous of you for understanding what a bloody promise is
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:03
Okay yeah, I misread the question
No idea what's the difference between a promise and a callback
Rory Smith
@alanbuchanan
Sep 10 2015 13:03
also bear in mind these are mid-level, not entry or junior
Soumya Rauth
@soumyaRauth
Sep 10 2015 13:03
@awesomeaniruddh It did advanced but, I changed some code, then it stopped working... :(
Rory Smith
@alanbuchanan
Sep 10 2015 13:03
the challenges are good though. they make you think.
Soumya Rauth
@soumyaRauth
Sep 10 2015 13:03
@awesomeaniruddh I made a mess.
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:04
@soumyaRauth That's all right
We can fix it
Soumya Rauth
@soumyaRauth
Sep 10 2015 13:04
@awesomeaniruddh Thanks
CamperBot
@camperbot
Sep 10 2015 13:04
soumyarauth sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 396 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Soumya Rauth
@soumyaRauth
Sep 10 2015 13:04
@awesomeaniruddh I am dying to solve it.
That should get you started
I suggest saving your JS code on your hard drive and starting from scratch
Soumya Rauth
@soumyaRauth
Sep 10 2015 13:06
@awesomeaniruddh Can we have a pair programming.... Could you help me out.. ? I used setTimeout.... But, setTimeout does not run over and over again. So....
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:07
Sure, we can do that
Surya Man Bajracharya
@Zurya
Sep 10 2015 13:07
Anyone interested to teach me "Waypoint: Iterate over Arrays with map"? I am a newbie, I googled but I could not understand anything.
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:07
But not right now
@soumyaRauth Tomorrow morning?
Soumya Rauth
@soumyaRauth
Sep 10 2015 13:07
@awesomeaniruddh :( I am afraid i won't be able to do it tomorrow morning.
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:08
evening?
Soumya Rauth
@soumyaRauth
Sep 10 2015 13:08
@awesomeaniruddh Yes, evening would be fine....
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:08
Great!
Why don't you skip that ziplines and do the other challenges till then?
Soumya Rauth
@soumyaRauth
Sep 10 2015 13:09
@awesomeaniruddh I need some help regarding pomodoro...
Dealga McArdle
@zeffii
Sep 10 2015 13:09
@soumyaRauth don't be afraid to start from scratch sometimes
Anna Presnyakova
@chiffenok
Sep 10 2015 13:10

Hi I need to get the current city of a user

var city2;
$.get("http://ipinfo.io", function(response) {
    //console.log(response.city);
    city2 = response.city;
    $("#city").html(city2 + ", " + response.region);
}, "jsonp");
console.log(city2);

but why the cariable city2 is underfined ?? I need to save a city in the variable and then pass as an argument to another function

Soumya Rauth
@soumyaRauth
Sep 10 2015 13:10
@awesomeaniruddh I do not understand the timing thing... Some one suggested that 3600 seconds and some thing like that.. Could someone make me clear about it
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:11
Hated the pomodoro myself when I did mine and I don't remember what I did :P
We'll figure it out tomorrow together
Soumya Rauth
@soumyaRauth
Sep 10 2015 13:11
@awesomeaniruddh okayyyy
Rory Smith
@alanbuchanan
Sep 10 2015 13:13
@chiffenok have you double-checked that console log?
Anna Presnyakova
@chiffenok
Sep 10 2015 13:13
@alanbuchanan yes((
I suppose smth with a scope but I'm not sure
Rory Smith
@alanbuchanan
Sep 10 2015 13:14
@chiffenok does this make a difference: declaring var city2 = response.city within the callback
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:15
@chiffenok you're not logging inside the callback
city2 is logged before it is set to the city
from the API response
Anna Presnyakova
@chiffenok
Sep 10 2015 13:20
@awesomeaniruddh I didn't get you, can you make an example pls?
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:20
var city2;
$.get("http://ipinfo.io", function(response) {
    //console.log(response.city);
    city2 = response.city;
    $("#city").html(city2 + ", " + response.region);

console.log(city2);
}, "jsonp");
Try that
Seems like you're not aware of async programming either?
Anna Presnyakova
@chiffenok
Sep 10 2015 13:21
@alanbuchanan within the callback it 'll underfined
Rory Smith
@alanbuchanan
Sep 10 2015 13:21
@chiffenok did you try @awesomeaniruddh 's suggestion
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:24
@chiffenok are you aware of what async programming is?
Anna Presnyakova
@chiffenok
Sep 10 2015 13:24
@awesomeaniruddh not so much, that's what I'm doing here - learning) but I need it outside to pass as the function to another function, let's say
```js
var city2;
$.get("http://ipinfo.io", function(response) {
    //console.log(response.city);
    city2 = response.city;
    $("#city").html(city2 + ", " + response.region);

console.log(city2);
}, "jsonp");
someFunction(city2);
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:24
Let me explain async programming first
have you programmed in any other language bfore?
Omar Lashkar
@xxx-mar
Sep 10 2015 13:25
now I'm at the buliding portofolio zipline chalange , but the documentation of bootstrap is really difficuly to cope with , is there is any link summarizing the whole class of bootstrap ? please
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:25
is what you're looking for
Anna Presnyakova
@chiffenok
Sep 10 2015 13:25
@awesomeaniruddh yes , why do u ask?
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:26
So you're aware of how code is compiled?
That is, the compiler goes through each line and executes it in sequence?
Anna Presnyakova
@chiffenok
Sep 10 2015 13:26
@awesomeaniruddh yes
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:26
And that's how you expected JS to be interpreted?
hmm?
Anna Presnyakova
@chiffenok
Sep 10 2015 13:29
This is a help chat, that's why I posted my question here, what the problem with my question?
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:29
The problem is that your code doesn't work because it is not being executed as you expected it to
Anna Presnyakova
@chiffenok
Sep 10 2015 13:30
for sure I'm not an expert and I didn't say so, so I want to know where is mistake
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:30
To understand the mistake you will have to understand how the code is being executed
Which is what I'm attempting to explain here
Anna Presnyakova
@chiffenok
Sep 10 2015 13:32
so... I don't see what you're saying, and I can't get why is variable underfined outside a $.get
And that's how you expected JS to be interpreted?
Dealga McArdle
@zeffii
Sep 10 2015 13:34
@chiffenok you are doing this in codepen?
Anna Presnyakova
@chiffenok
Sep 10 2015 13:35
i didn't get what you mean by this question
Rory Smith
@alanbuchanan
Sep 10 2015 13:36
@chiffenok you don't need it outside of $.get
Soumya Rauth
@soumyaRauth
Sep 10 2015 13:39
can I directly use Math.max on an array Math.max(arr); arr=[1,2,3];
Fábio Paraíso Oliveira
@FabioParaiso
Sep 10 2015 13:40
@soumyaRauth u need the apply function like this Math.max.apply(null,arr).
Read a little bit of apply examples it will get handy ;)
for example
Anna Presnyakova
@chiffenok
Sep 10 2015 13:41

when how can I pass it another var or function

var city;
$.get("http://ipinfo.io", function(response) {
    //console.log(response.city);
    var city = response.city;
    $("#city").html(city + ", " + response.region);
}, "jsonp");
console.log(city);
var urlW = "http://api.openweathermap.org/data/2.5/weather?q=" + city + "&units=metric" ;
$.ajax({
    url: urlW,

I need to pass it url variable

Aniruddh Agarwal
@anrddh
Sep 10 2015 13:41
@chiffenok You can't access response.city outside the callback
even if you set it to a variable
GET https://ipinfo.io/?callback=jQuery21308334966651163995_1441892379853&_=1441892379854 net::ERR_BLOCKED_BY_CLIENT
the IPInfo API is not returning anything
Paul Simon Ongpin
@mochiii
Sep 10 2015 13:42
can sombody help me in my zipline project. i started my portfolio but got stuck on navbar because the collapse button for mobile screen size is not working pls check where is the problem here: http://codepen.io/mochiii/pen/zvvvWJ?editors=100
kiran
@kartikz
Sep 10 2015 13:43
This message was deleted
getting err......Your h2 element should have the class red-text.
Coira Ellison
@Coira
Sep 10 2015 13:44
@chiffenok @awesomeaniruddh it'll work fine in codepen, but gitter chat blocks mixed content
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:44
@Coira not working on Codepen :)
Coira Ellison
@Coira
Sep 10 2015 13:44
worked ok for me? got weather and city
Anna Presnyakova
@chiffenok
Sep 10 2015 13:45
@awesomeaniruddh ok, then anothe another question I need to form url variable which takes city var urlW = "http://api.openweathermap.org/data/2.5/weather?q=" + city + "&units=metric" ; and pass it to $.ajax , how can I do that?
Mohamed A. Farouk
@captainmoha
Sep 10 2015 13:45
@mochiii Add bootstrap JavaScript and it should work.
Coira Ellison
@Coira
Sep 10 2015 13:45
@chiffenok can you embed it in your $.get? or perhaps take a look at jquery's $.when, which you can use to return a variable
Paul Simon Ongpin
@mochiii
Sep 10 2015 13:46
oh so dumb of me yeah i forgot hahahahahaha thanks for pointing it out
CamperBot
@camperbot
Sep 10 2015 13:46
if you want to thank someone, put an @ before their name!
Paul Simon Ongpin
@mochiii
Sep 10 2015 13:46
thanks @captainmoha
CamperBot
@camperbot
Sep 10 2015 13:46
mochiii sends brownie points to @captainmoha :sparkles: :thumbsup: :sparkles:
:star: 279 | @captainmoha | http://www.freecodecamp.com/captainmoha
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:46
Your code is correct for that in @chiffenok
Mohamed A. Farouk
@captainmoha
Sep 10 2015 13:47
@mochiii I did the same when I was making mine :smile: until someone pointed it out. :smile:
Jack Demynn
@infectiouscode
Sep 10 2015 13:50
Hey guys, I'm stuck on Bonfire 17, I don't know how to make the image element have a class. Here's what I have so far:
blob
Anna Presnyakova
@chiffenok
Sep 10 2015 13:50
@awesomeaniruddh then I'm confused. console.log(city); says underfined but it ok if var urlW = "http://api.openweathermap.org/data/2.5/weather?q=" + city + "&units=metric" ; ...
Paul Simon Ongpin
@mochiii
Sep 10 2015 13:50
yeah yeah @captainmoha im used to coding in the text editor and copying the links of bootstrap and jquery. I think the devs of freecodecamp should point it out in the first zipline
Mohamed A. Farouk
@captainmoha
Sep 10 2015 13:50
@infectiouscode It's better if you paste your code.
explain format
CamperBot
@camperbot
Sep 10 2015 13:50

: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

Jack Demynn
@infectiouscode
Sep 10 2015 13:51
Sorry @captainmoha
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:51
Because no city is defined, it seems to be defaulting to Connaught PLace
The API
Jack Demynn
@infectiouscode
Sep 10 2015 13:51
What do you mean explain format? @captainmoha
Mohamed A. Farouk
@captainmoha
Sep 10 2015 13:52
it's just a command that makes the bot explain to you how to paste your code :smile:
Jack Demynn
@infectiouscode
Sep 10 2015 13:52
Do I just a colon or anything before writing it
put*
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:52
```
put that
press Shit+enter
paste code
Shift-enter
put that again
Ctrl+enter
Paul Simon Ongpin
@mochiii
Sep 10 2015 13:53
can i ask again how do i center the text in the collapse dropdown? http://codepen.io/mochiii/pen/zvvvWJ?editors=110
Anna Presnyakova
@chiffenok
Sep 10 2015 13:53
@awesomeaniruddh .... I still didn't get that ((
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:54
city is undefined
Jack Demynn
@infectiouscode
Sep 10 2015 13:54
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }
smaller-image {
  width:100px;

}
  p {
    font-size: 16px;
    font-family: Monospace;
  }
</style>

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

<img src="https://bit.ly/fcc-relaxing-cat">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Aniruddh Agarwal
@anrddh
Sep 10 2015 13:54
So when the API gets no city in the request
it uses a default location
something that has been preset by the creator
Jack Demynn
@infectiouscode
Sep 10 2015 13:55
So can anyone see what I've don wrong? I need the image to have a width of 100px
done*
Philip Warkentien II
@warkentien2
Sep 10 2015 13:55

@chiffenok to paste a block quote (more than 1 line)
do ```
plus js on the same line, no spaces (can't do it here for obvious reasons)

paste your code and finish it off with ``` (without js now)

if one line. just put one ` before
and after your code.

Mohamed A. Farouk
@captainmoha
Sep 10 2015 13:56
@mochiii try adding the class text-center.
Anna Presnyakova
@chiffenok
Sep 10 2015 13:57
so?! how can I fix it. I don't understands you at all, you said it works, when you say it uses default location, how can I fix it?
Mohamed A. Farouk
@captainmoha
Sep 10 2015 13:57
@infectiouscode you are not selecting the image.
Paul Simon Ongpin
@mochiii
Sep 10 2015 13:57
@captainmoha ok i'll try thanks
CamperBot
@camperbot
Sep 10 2015 13:57
mochiii sends brownie points to @captainmoha :sparkles: :thumbsup: :sparkles:
:warning: mochiii already gave captainmoha points
Anna Presnyakova
@chiffenok
Sep 10 2015 13:58
I want to pass here the city of a uservar urlW = "http://api.openweathermap.org/data/2.5/weather?q=" + city + "&units=metric" ; how can I do it?
Jack Demynn
@infectiouscode
Sep 10 2015 13:58
How do I select the image? @captainmoha
Mohamed A. Farouk
@captainmoha
Sep 10 2015 13:58
@infectiouscode first you need to add the class smaller-image to your image element
Paul Simon Ongpin
@mochiii
Sep 10 2015 13:58
@captainmoha awesome!!!! you're god sent
Mohamed A. Farouk
@captainmoha
Sep 10 2015 13:59
@infectiouscode and then you use this to select it from the style element .smaller-image
@mochiii Glad it worked :smile:
when you need to style a class you add a . before it's name
Jack Demynn
@infectiouscode
Sep 10 2015 14:01
How do I add the class to the image element? Where do you put it? Because I've got the <img src="blah blah blah"> I'm not sure where to put the smaller-image class
Mohamed A. Farouk
@captainmoha
Sep 10 2015 14:01
you see the src="blah blah blah" ?
this is called an attribute
you can add many attributes to your html elment
so you add class=nameofclass
next to it
<img src="blah blah blah" class="dingding">
like that
Jack Demynn
@infectiouscode
Sep 10 2015 14:05
Oh okay I see, I'll give that a whix
whiz*
It worked! Thanks @captainmoha
CamperBot
@camperbot
Sep 10 2015 14:05
infectiouscode sends brownie points to @captainmoha :sparkles: :thumbsup: :sparkles:
:star: 280 | @captainmoha | http://www.freecodecamp.com/captainmoha
a1rr0wh3ad
@a1rr0wh3ad
Sep 10 2015 14:07
@chiffenok how about if you put all code for geting openweathermap.org data inside the callback for getting data from http://ipinfo.io?
Jack Demynn
@infectiouscode
Sep 10 2015 14:10
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }
smaller-image {
  width:100px;

}
  p {
    font-size: 16px;
    font-family: Monospace;
  }
</style>

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

<img src="https://bit.ly/fcc-relaxing-cat">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
For some reason I can't get my image to have the class of
border, but it seems to have gotten rid of all of the classes I add in this image.
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  .thick-green-border {

    border-width: 10px solid 
      color: green;
  }
  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""class="thick-green-border"" src="https://bit.ly/fcc-relaxing-cat">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
That's better, It didnt give the image a green border
Mohamed A. Farouk
@captainmoha
Sep 10 2015 14:13
@infectiouscode when adding multiple classes to your element you just need to separate them by a space.
Jack Demynn
@infectiouscode
Sep 10 2015 14:13
It's on BF 18 if it helps
Mohamed A. Farouk
@captainmoha
Sep 10 2015 14:14
class='class1 class2 class3'
like so
Jack Demynn
@infectiouscode
Sep 10 2015 14:15
So they don't need to have equals for each one?
Mohamed A. Farouk
@captainmoha
Sep 10 2015 14:15
no
Jack Demynn
@infectiouscode
Sep 10 2015 14:15
Oh okay
I'll give it a go real quick
I think I've done the border wrong, because it's still not included
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  .thick-green-border {

    border-width: 10px solid 
      color: green;
  }
  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">

<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>
Can you have a look at the thick green border command please to make sure I've done it correctly? I have no idea what's wrong
it needs to have a width of 10px, be solid and be green
Mohamed A. Farouk
@captainmoha
Sep 10 2015 14:18
you don't need this part "color:"
Jack Demynn
@infectiouscode
Sep 10 2015 14:18
So how do I make the border green?
Mohamed A. Farouk
@captainmoha
Sep 10 2015 14:19
border: 1px solid black; @infectiouscode
use this format
Jack Demynn
@infectiouscode
Sep 10 2015 14:19
Right okay, Ill try that
You're seriously the best. Thank-you so much @captainmoha
CamperBot
@camperbot
Sep 10 2015 14:20
infectiouscode sends brownie points to @captainmoha :sparkles: :thumbsup: :sparkles:
:warning: infectiouscode already gave captainmoha points
Mohamed A. Farouk
@captainmoha
Sep 10 2015 14:21
@infectiouscode My pleasure :smile:
Sasa Popovic
@Zunior
Sep 10 2015 14:21

does anyone knows why this code isnt working? thx
var myDog = {
"name": "Camper",
"legs": 4,
"tails": 1,
"friends": []
};
// Only change code below this line.

// Let's add the property bark to myDog
add myDog.bark;

// Now delete the property tails
delete myDog.tails;

CamperBot
@camperbot
Sep 10 2015 14:21
if you want to thank someone, put an @ before their name!
Blauelf
@Blauelf
Sep 10 2015 14:28
@Zunior Why don't you assign something to myDog.bark? Never seen an "add" keyword...
justindobbs
@justindobbs
Sep 10 2015 14:28
This message was deleted
Rory Smith
@alanbuchanan
Sep 10 2015 14:34
@Blauelf please could you give me a shove in the right direction for
bf map the debris
CamperBot
@camperbot
Sep 10 2015 14:34

: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

Paul Simon Ongpin
@mochiii
Sep 10 2015 14:34
the text mochi is not showing up pls help :( http://codepen.io/mochiii/pen/zvvvWJ?editors=110
Sasa Popovic
@Zunior
Sep 10 2015 14:35
@Blauelf Assigning did the trick. But it is confusing that you can assign value to property which is not added.
@Blauelf Oh, and I removed line with add command
@Blauelf thx for hint
CamperBot
@camperbot
Sep 10 2015 14:36
zunior sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 291 | @blauelf | http://www.freecodecamp.com/blauelf
Paul Simon Ongpin
@mochiii
Sep 10 2015 14:37
oh i figure it out the navbar is overlapping the text
Arooj
@aroojahmad
Sep 10 2015 14:37
How to add new properties to an instance without changing the constructor?

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

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

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

Philip Warkentien II
@warkentien2
Sep 10 2015 14:38
instance[new_property_name] = whatever;
Arooj
@aroojahmad
Sep 10 2015 14:38
I'm a n00b
thank you @warkentien2
CamperBot
@camperbot
Sep 10 2015 14:38
aroojahmad sends brownie points to @warkentien2 :sparkles: :thumbsup: :sparkles:
Philip Warkentien II
@warkentien2
Sep 10 2015 14:38
@aroojahmad been there. and for ziplines. I'm the noob
CamperBot
@camperbot
Sep 10 2015 14:38
:star: 281 | @warkentien2 | http://www.freecodecamp.com/warkentien2
Philip Warkentien II
@warkentien2
Sep 10 2015 14:40
@aroojahmad you'll need "" on the property_name. but I bet you figured that out
Jason
@jason
Sep 10 2015 14:42
oh wow. I just learned about using a debugger. Here's how you make your lives 5x easier. install npm and then npm install -g node-inspector
node-debug app.js
voila. you can see your variables as they're being run
drd13
@drd13
Sep 10 2015 14:45
@jason that looks cool, does it debug express, mongodb etc too ?
Steven Nevins
@dmintercept
Sep 10 2015 14:54
@aroojahmad myCar.engines = 2;
Jack Demynn
@infectiouscode
Sep 10 2015 14:57
Does anyone know why my a href link on line 11 isn't showing up in the view box?
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

<a href="http://www.freecatphotoapp.com">cat photos</a>

  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>

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Jelani Thompson
@JelaniThompson
Sep 10 2015 14:57
Hey guys, does anyone here know why FCC's run tests button isn't working?
It's not allowing me to finish challenges
I feel like it may just be an error on my end
Joseph odhiambo
@Theonlysmartboy
Sep 10 2015 15:00
@infectiouscode Try removing it from the style section and have it right before the h2 element
Jack Demynn
@infectiouscode
Sep 10 2015 15:01
Cheers! It still doesnt show the link tho :/
its registered the code and the anchor text but not showing up
Rory Smith
@alanbuchanan
Sep 10 2015 15:02
i really need some sort of a hint for
bf map the debris
CamperBot
@camperbot
Sep 10 2015 15:02

: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

Jack Demynn
@infectiouscode
Sep 10 2015 15:02
Nevermind, it was that I added www. to the code
thanks @Theonlysmartboy
CamperBot
@camperbot
Sep 10 2015 15:03
infectiouscode sends brownie points to @theonlysmartboy :sparkles: :thumbsup: :sparkles:
:star: 165 | @theonlysmartboy | http://www.freecodecamp.com/theonlysmartboy
Sasa
@tanasic
Sep 10 2015 15:07
guys
can any JavaScript expert look at my code and say why doesnt it let me pass Bonfire ?
its the simple one, Factorialize 6
I mean 5
Jack Demynn
@infectiouscode
Sep 10 2015 15:08
<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="http://www.freecatphotoapp.com">cat photos</a>.</p>

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Have no idea why this isn't working. It asks me to dead this href link with a hash key, but when I put a hash in it doesnt work, where is the hash placed?
It should really show examples so you know what it means
Paul Simon Ongpin
@mochiii
Sep 10 2015 15:11
can somebody pls help me center the text in col-lg-8 div? i cant figure it out. here is the code http://codepen.io/mochiii/pen/zvvvWJ?editors=110
Rory Smith
@alanbuchanan
Sep 10 2015 15:11
@mochiii this might help
Joseph odhiambo
@Theonlysmartboy
Sep 10 2015 15:11
@infectiouscode it should be placed as the value of the href i.e your link code should look like this <a href="3">cat photos</a>
Paul Simon Ongpin
@mochiii
Sep 10 2015 15:12
@alanbuchanan thanks for the reference
CamperBot
@camperbot
Sep 10 2015 15:12
mochiii sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 311 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Jack Demynn
@infectiouscode
Sep 10 2015 15:12
Oh okay, so I place it where the link goes? @Theonlysmartboy
Got it! Thanks again @Theonlysmartboy
CamperBot
@camperbot
Sep 10 2015 15:13
infectiouscode sends brownie points to @theonlysmartboy :sparkles: :thumbsup: :sparkles:
:warning: infectiouscode already gave theonlysmartboy points
Jack Demynn
@infectiouscode
Sep 10 2015 15:14
Why would we ever need it to be a deadlink though?
Joseph odhiambo
@Theonlysmartboy
Sep 10 2015 15:15
Yes @infectiouscode instead of the url you use the hash #
Well @infectiouscode dead links are user when we are creating the parent anchor in drop down or horizontal menus.
Jack Demynn
@infectiouscode
Sep 10 2015 15:18
Ohhh I see
Paul Simon Ongpin
@mochiii
Sep 10 2015 15:23
how do i put the 's next to the mochi text? http://codepen.io/mochiii/pen/zvvvWJ?editors=110
Tom Pyszczuk
@Ne0nite
Sep 10 2015 15:27
Erm need some help with part of a code .. Trying to do the seek and destroy bonfire. My idea is to search the newArray for the arguments with indexOf. If it finds a match it should state that if not then state its looping . I will be adding what to do with the match later when this part works. for some reason it finds a match on every loop.
CamperBot
@camperbot
Sep 10 2015 15:27
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Tom Pyszczuk
@Ne0nite
Sep 10 2015 15:27
function destroyer(arr) {
  var newArray = arr;
  for (var i=0; i<newArray.length; i++) {
      console.log(arguments[i]);
      if (newArray.indexOf(arguments[i] >0)) {
        console.log ("Found match");
      }
      else {
        console.log("Looping");
      }
  }
  console.log(newArray);

}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Joseph odhiambo
@Theonlysmartboy
Sep 10 2015 15:28
@mochiii I suggest placing the second h1 element inside a div and then using the css float-left
Paul Simon Ongpin
@mochiii
Sep 10 2015 15:28
figure it out already inline is the answer
Tom Pyszczuk
@Ne0nite
Sep 10 2015 15:32
actually this a change in code, but the same outcome .
function destroyer(arr) {
  var newArray = arr;
  for (var i=0; i<newArray.length; i++) {
      console.log(arguments[i]);
      if (newArray.indexOf(arguments[i] === -1)) {
        console.log ("Looping");
      }
      else {
        console.log("Found match");
      }
  }
  console.log(newArray);

}

destroyer([1, 2, 3, 1, 2, 3], 2, 3, 4);
Jack Demynn
@infectiouscode
Sep 10 2015 15:36
<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>Things cats love:</p>
<ul>
  <li>cat nip</li>
  <li>laser pointers</li>
  <li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
  <li>flea treatment</li>
  <li>thunder</li>
  <li>other cats</li>
</ol>
<form action="/submit-cat-photo">
  <input type="submit">This button submits the form
  <input type="text" placeholder="cat photo URL">
</form>
It says the button at the bottom needs to be in the form?
Nevermind I figured it out! Wasn't paying enough attention
Rory Smith
@alanbuchanan
Sep 10 2015 15:46
can anyone help with the formula for
bf map the debris
CamperBot
@camperbot
Sep 10 2015 15:46

: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

MikBH
@MikBH
Sep 10 2015 15:49
Hello, anyone knows how to prevent a video to auto play when using iframe?
<iframe width="1280" height="720" src="video/Moore's_Law.mp4" frameborder="0" allowfullscreen></iframe>
Tom Pyszczuk
@Ne0nite
Sep 10 2015 15:52
not an exper but did you try : autoplay=false
soonerprid3
@soonerprid3
Sep 10 2015 15:53
can anyone help with the id tag for form?
to be exact; Give your form element the id of cat-photo-form.
MikBH
@MikBH
Sep 10 2015 15:53
tried, didn't work. I also tried
autoplay="0"
didn't work either
soonerprid3
@soonerprid3
Sep 10 2015 15:54
MikBH did you try autoplay="false"
quotes and all
MikBH
@MikBH
Sep 10 2015 15:55
tried that one too = failed :/
yan arlex vallejo
@aprendiendoando
Sep 10 2015 15:56
<a class="ver_trailer fancybox fancybox.iframe" href="https://www.youtube.com/embed/WCM-o4JJoQE?autoplay=0">Trailer</a>
Tom Pyszczuk
@Ne0nite
Sep 10 2015 15:56
@MikBH check this, they seemed to fix it
soonerprid3
@soonerprid3
Sep 10 2015 16:00
any idea on mine Ne0nite?
MikBH
@MikBH
Sep 10 2015 16:00
Yes I ended up switching to <video> yesterday after looking for a long time.
@soonerprid3 Your waypoint is #38?
soonerprid3
@soonerprid3
Sep 10 2015 16:01
ya
Mowgli418
@Mowgli418
Sep 10 2015 16:01
Hey Guys. Can I get some backing here? I've been googling up storm but I'm new and all I'm finding is ways to fix an error I'm not dealing with.
I just don't know what I'm looking to do
Screen Shot 2015-09-10 at 11.58.51 AM.png
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:02
@soonerprid3 hmm it jsut wants you to add id to form ? don't remember that one :) can you paste your code ? :)
soonerprid3
@soonerprid3
Sep 10 2015 16:03
ya
MikBH
@MikBH
Sep 10 2015 16:03
Just tried the waypoint and it works, what is your issue?
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:04
@Mowgli418 I havent done the new jquery but did you try [0] , [1] and [2] ?
not all 0
Mowgli418
@Mowgli418
Sep 10 2015 16:05
@Ne0nite d0h!!!
Hahahaha. Thanks man. :+1:
CamperBot
@camperbot
Sep 10 2015 16:05
mowgli418 sends brownie points to @ne0nite :sparkles: :thumbsup: :sparkles:
:star: 129 | @ne0nite | http://www.freecodecamp.com/ne0nite
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:05
@Mowgli418 Your welcome :)
soonerprid3
@soonerprid3
Sep 10 2015 16:05
Im doing form id="cat-photo-app" and for some reason I cant seem to put it in the right place or just using the improper code
Im lost now been messing with it too long
Mateja Trifunovski
@Matko95
Sep 10 2015 16:06
@soonerprid3 can you send the code?
explain code formatting
CamperBot
@camperbot
Sep 10 2015 16:06

: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

Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:06
@soonerprid3 yea the code would be helpfull
it should just be form id = blah blah
soonerprid3
@soonerprid3
Sep 10 2015 16:09
ok
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:09
@soonerprid3 <form id = "cat-photo-form" action="/submit-cat-photo">
thats the code, just checked it and it works
on 38
Mateja Trifunovski
@Matko95
Sep 10 2015 16:10
what waypoint is that
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:10
38
one of the few that were new from alpha so i had to do it myself :D
@Matko95 have You done bonfires already ?
Rory Smith
@alanbuchanan
Sep 10 2015 16:12
can any maths genius help me with
bf map the debris
CamperBot
@camperbot
Sep 10 2015 16:12

: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

Mateja Trifunovski
@Matko95
Sep 10 2015 16:12
@Ne0nite i did
bf details
CamperBot
@camperbot
Sep 10 2015 16:12

: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:
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:12
@Matko95 My new best friend, have you done seek and destroy :) ?
bf 15
CamperBot
@camperbot
Sep 10 2015 16:13
Sorry, can't find a bonfire called 15. [ Check the map? ]
Mateja Trifunovski
@Matko95
Sep 10 2015 16:13
@Ne0nite i did :)
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:13
@Matko95 Well then might you please maybe answer me what the bloody hell is wrong with this :P
```

function destroyer(arr) {
var newArray = arr;
var cleanArray = [];
for (var i=0; i<newArray.length; i++) {
console.log(arguments[i]);
if (newArray.indexOf(arguments[i] === -1)) {
console.log ("Looping");
}
else {
console.log("Found match");
cleanArray.push(arguments[i]);
}
}
console.log(cleanArray);

}

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

ups
calypte
@sarah-l
Sep 10 2015 16:14
Having a dozy moment: I don't 'get' the instructions for Waypoint: Target the same element with multiple jQuery Selectors, where it says "Only add one class with each of your three selectors.". What's wrong with the following: $("button").AddClass("animated");
$(".btn").AddClass("shake");
$("#target1").AddClass("btn-primary");
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:14
function destroyer(arr) {
  var newArray = arr;
  var cleanArray = [];
  for (var i=0; i<newArray.length; i++) {
      console.log(arguments[i]);
      if (newArray.indexOf(arguments[i] === -1)) {
        console.log ("Looping");
      }
      else {
        console.log("Found match");
        cleanArray.push(arguments[i]);
      }
  }
  console.log(cleanArray);

}

destroyer([1, 2, 3, 1, 2, 3], 2, 3, 4);
ok the idea is
Erm need some help with part of a code .. Trying to do the seek and destroy bonfire. My idea is to search the newArray for the arguments with indexOf. If it finds a match it should state that if not then state its looping . I will be adding what to do with the match later when this part works. for some reason it finds a match on every loop.
CamperBot
@camperbot
Sep 10 2015 16:14
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Mateja Trifunovski
@Matko95
Sep 10 2015 16:14
@Ne0nite i kind hardcoded that one, but nvm :D
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:14
oh lol
Rory Smith
@alanbuchanan
Sep 10 2015 16:15
@sarah-l AddClass should be addClass, but i'm not sure that's the issue
Mateja Trifunovski
@Matko95
Sep 10 2015 16:15
@Ne0nite newArray.indexOf(arguments[i]) === -1 first do this
calypte
@sarah-l
Sep 10 2015 16:15
thanks, @alanbuchanan - that was the answer! :)
CamperBot
@camperbot
Sep 10 2015 16:15
sarah-l sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 312 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Rory Smith
@alanbuchanan
Sep 10 2015 16:15
@sarah-l :+1:
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:16
@Matko95 oh please dont tell me this is going to be it lol .. sec checking
Mateja Trifunovski
@Matko95
Sep 10 2015 16:17
@Ne0nite it wont :D
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:17
@Matko95 Rotfl, let me go hit my head really hard somewhere .. it is... at least it looks like it , since now it finds matches
@Matko95 thanks :)
CamperBot
@camperbot
Sep 10 2015 16:17
ne0nite sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 239 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Sep 10 2015 16:18
@Ne0nite cool, np :D
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:18
@soonerprid3 did you manage to get the code working ?
Rhythm Garg
@logicflakes
Sep 10 2015 16:22
Hello!
Yuriy
@theGame
Sep 10 2015 16:22
Hello friend,
Rhythm Garg
@logicflakes
Sep 10 2015 16:22
need some help
Yuriy
@theGame
Sep 10 2015 16:23
I have a problem in 'Waypoint: Make Object Properties Private' chapter
Rhythm Garg
@logicflakes
Sep 10 2015 16:24
haven't started that yet..
Yuriy
@theGame
Sep 10 2015 16:25
var Bike = function() {
  // Only change code below this line.
  this.speed = 100;
  function addUnit(value) {
    return value + "KM/H";
  }

  function speed (){

  }

  function addUnit (){

  }

  this.getSpeed = function(){

  }

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

};

// Only change code above this line.
var myCar = new Car();
var myBike = new Bike();
can't pass this test
assert(typeof(myBike.speed) === 'undefined', 'myBike.speed should remain undefined.');myBike.speed should remain undefined.
Florian Peninon
@florianpnn
Sep 10 2015 16:26
@theGame I’m one step from it. If you don’t get an answer I’ll see if I can help you
Kushagra Sinha
@kushagra21
Sep 10 2015 16:27
'''
CamperBot
@camperbot
Sep 10 2015 16:27
:bulb: to format code use backticks! ``` more info
Yuriy
@theGame
Sep 10 2015 16:28
@florianpnn , ok, I will wait, if I passed it I will let you know
Florian Peninon
@florianpnn
Sep 10 2015 16:28
@theGame You don’t have to rewrite all the code, just remove one ‘this.’ and add one somewhere else ;)

@theGame ```
var Bike = function() {
// Only change code below this line.
this.speed = 100;
function addUnit(value) {
return value + "KM/H";
}

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

};
```
Here we can see that speed is public and the 2 others are private because there is no « this » before

Kushagra Sinha
@kushagra21
Sep 10 2015 16:29

'''
function factorialize(num) {
val sum=1;
for(val i=1;i<=num;i++)
{
sum=sum*i;
}
return sum;
}

factorialize(5);

CamperBot
@camperbot
Sep 10 2015 16:29
:bulb: to format code use backticks! ``` more info
Kushagra Sinha
@kushagra21
Sep 10 2015 16:30

'''
function factorialize(num) {
val sum=1;
for(val i=1;i<=num;i++)
{
sum=sum*i;
}
return sum;
}

factorialize(5);
'''

what is the error in this code , i'm not able to compile it !

CamperBot
@camperbot
Sep 10 2015 16:30
:bulb: to format code use backticks! ``` more info
Florian Peninon
@florianpnn
Sep 10 2015 16:30
@kushagra21 "val sum=1;’ do you mean var?
@theGame Let me know if you need more help, I don’t want to give you the final solution but some hints ;)
Kushagra Sinha
@kushagra21
Sep 10 2015 16:32
@florianpnn thanks a lot ! didn't saw that .. :smile:
Yuriy
@theGame
Sep 10 2015 16:34
@florianpnn got it, thanks a lot!
CamperBot
@camperbot
Sep 10 2015 16:34
thegame sends brownie points to @florianpnn :sparkles: :thumbsup: :sparkles:
:star: 188 | @florianpnn | http://www.freecodecamp.com/florianpnn
Mowgli418
@Mowgli418
Sep 10 2015 16:37

Hey. Can someone explain this sequence to me? I'm in the slot section and generating random numbers.
I understand that Math.random gives me a random number between zero and one.

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

Hey. Can someone explain this sequence to me? I'm in the slot section and generating random numbers.

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

I understand that Math.random gives me a random number between zero and one.
I understand that Math.floor rounds it down.
And I think I understand that the "+1" is tacked on at the end, in case the number rounds down to zero, and I don't want a zero...

I don't understand the (3-1+1).

Help?

Mateja Trifunovski
@Matko95
Sep 10 2015 16:41
@Mowgli418 the formula goes like this Math.floor(Math.random() * (max - min + 1)) + min
@Mowgli418 in that case min is equal to 1, so -1+1 seems kinda stupid
Caroline Portugal
@carolineportugal
Sep 10 2015 16:43
I’m having problems with SVG and transform-origin not displaying correctly in Firefox. Anybody familiar with that issue?
Steven Nevins
@dmintercept
Sep 10 2015 16:43
@theGame did you get the answerr?
Mowgli418
@Mowgli418
Sep 10 2015 16:44
@Matko95
:) thanks man... :+1: I'm just absorbing a lot and I'd be tearing my hair out with out some support
CamperBot
@camperbot
Sep 10 2015 16:44
mowgli418 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 240 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Sep 10 2015 16:44
@Mowgli418 feel free to ask anything here :D it helps alot
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:47
bleh stupid bonfire :/
Steven Nevins
@dmintercept
Sep 10 2015 16:47
@Ne0nite which one
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:47
@dmintercept same one
ah sorry thought somebody ele asked :)
esle*
seek and destroy
Priyansh
@priyanshAgarwal
Sep 10 2015 16:48
@carolineportugal Why can't we do Math.floor((Math.random() * 3) + 1);
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:48
I know the problem, just can't figure out the logic to fix it
 function destroyer(arr) {
  var newArray = arr;
  var cleanArray = [];
  for (var i=0; i<newArray.length; i++) {
 //     console.log(arguments[i]);
      if (newArray.indexOf(arguments[i]) === -1) {
        console.log ("Looping");
        cleanArray.push(newArray[i]);
      }
      else {
        console.log("Found match");
      }
  }
  console.log(cleanArray);

}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Priyansh
@priyanshAgarwal
Sep 10 2015 16:50
This message was deleted
@Matko95 Why can't we do Math Math.floor((Math.random() * 3) + 1);
Tom Pyszczuk
@Ne0nite
Sep 10 2015 16:50
I know the problem is in the if statement , but I don't know the logic for it check the last 2 numbers in the array
at least not with this if statement that I have :/
Rory Smith
@alanbuchanan
Sep 10 2015 16:53
still stuck with bf map the debris
bf map the debris
CamperBot
@camperbot
Sep 10 2015 16:53

: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

Dealga McArdle
@zeffii
Sep 10 2015 16:53
@alanbuchanan it's ridiculously easy
Rory Smith
@alanbuchanan
Sep 10 2015 16:54
@zeffii :scream:
Dealga McArdle
@zeffii
Sep 10 2015 16:54
it's one equation essentially
This message was deleted
Rory Smith
@alanbuchanan
Sep 10 2015 16:55
i've been experimenting with this formula but i can't see how to calculate SMa or how the altitude comes in to it
yeah that
Dealga McArdle
@zeffii
Sep 10 2015 16:56
var SMa = obj.avgAlt + earthRadius
var per = 2 * Math.PI * (Math.sqrt( (SMa*SMa*SMa) / GM));
then stick a Math.round on per
Mowgli418
@Mowgli418
Sep 10 2015 16:57

Hey. Can one of you lovely people clarify for me?
I'm still working on the slots. I'm passing challenges but failing to comprehend what exactly my code is actually doing.

Can someone break this down into dummy terms for me?

$($(".slot")[0]).html(slotOne);
$($(".slot")[1]).html(slotTwo);
$($(".slot")[2]).html(slotThree);
Screen Shot 2015-09-10 at 11.58.51 AM.png

I don't understand why this is actually pushing my randomized numbers into the slots now.
Where is the bit in the code thats saying "take these results, and plug them into this space"

Edit... Or am I working too hard? Is the slot machine dropped in as a pre-built unit and I'm trying to dig through code to find something that came pre-fabricated and I can't access it in the code?

Dealga McArdle
@zeffii
Sep 10 2015 16:59
blob
that's this converted to code
Rory Smith
@alanbuchanan
Sep 10 2015 16:59
@zeffii but
@zeffii when i calculate that i don't get the expected outcome
Dealga McArdle
@zeffii
Sep 10 2015 17:00
ok, what code do you have
Rory Smith
@alanbuchanan
Sep 10 2015 17:01
@zeffii oh god.
i was just missing out the sqrt each time
Mateja Trifunovski
@Matko95
Sep 10 2015 17:01
@priyansh1990 if your minimum is 1, you can
zeffii @zeffii slaps @alanbuchanan with a fresh trout
Rory Smith
@alanbuchanan
Sep 10 2015 17:02
lol
@zeffii thank you (for explaining the formula, not the fish abuse)
CamperBot
@camperbot
Sep 10 2015 17:03
alanbuchanan sends brownie points to @zeffii :sparkles: :thumbsup: :sparkles:
:star: 329 | @zeffii | http://www.freecodecamp.com/zeffii
Dealga McArdle
@zeffii
Sep 10 2015 17:06
cool
Priyansh
@priyanshAgarwal
Sep 10 2015 17:06
@Matko95 Thank You
CamperBot
@camperbot
Sep 10 2015 17:06
priyansh1990 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 241 | @matko95 | http://www.freecodecamp.com/matko95
Mowgli418
@Mowgli418
Sep 10 2015 17:15
This message was deleted
Erik Kynast
@carnivean
Sep 10 2015 17:20
Anyone here that can walk me through the getting ready for base jumps? I am trying to get it to work for a few hours now and it just won't work.... Tried pretty much anything I could find on stack / on github
Priyansh
@priyanshAgarwal
Sep 10 2015 17:21
$($(".slot")[0]).html(slotOne);
$($(".slot")[1]).html(slotTwo);
$($(".slot")[2]).html(slotThree);
Can anybody please explain the code. How class can have individual slots
How slots class can have html tag
Erik Kynast
@carnivean
Sep 10 2015 17:23
@priyansh1990 : $(".css-class") returns all the elements on the page that have the corresponding css class
the first Result to the query will get the html: "slotOne", the 2nd one "slotTwo" etc
Priyansh
@priyanshAgarwal
Sep 10 2015 17:25
@carnivean How class can have first slot
$($(".slot")[0]).html(slotOne);
Dealga McArdle
@zeffii
Sep 10 2015 17:27
because $(".slot") returns an array
because you have 3 things with the .slot class in the dom
maybe it returns an object with [0] [1] and [2] properties
Priyansh
@priyanshAgarwal
Sep 10 2015 17:29
@zeffii What is "with the .slot class in the dom"