These are chat archives for FreeCodeCamp/Help

22nd
Sep 2015
dkoepke417
@dkoepke417
Sep 22 2015 00:01
I see. Thanks @dting
CamperBot
@camperbot
Sep 22 2015 00:01
if you want to thank someone, put an @ before their name!
DTing
@dting
Sep 22 2015 00:02
@dkoepke417 after you get your answer i have some notes on the basic bonfires including that one. You can takea look if you want https://github.com/dting/fccbonfires/blob/master/basic/Basic%2007%20-%20Return%20Largest%20Numbers%20in%20Arrays.ipynb
Derrick
@Derricksr
Sep 22 2015 01:02
hint
CamperBot
@camperbot
Sep 22 2015 01:02
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
mwandama
@mwandama
Sep 22 2015 01:12

i was asked to Create a CSS class called pink-text that gives an element the color pink.

Give your h1 element the class of pink-text. This is my solution <h1 class="pink-text><h1> The following is the code for my css .pink-text{ color:pink !important}

can some one help me. When i ask a question nobody replies i wonder why

was asked to Create a CSS class called pink-text that gives an element the color pink.

Give your h1 element the class of pink-text. This is my solution <h1 class="pink-text><h1> The following is the code for my css .pink-text{ color:pink !important} this not working

Mateja Trifunovski
@Matko95
Sep 22 2015 01:14
@mwandama <h1 class="pink-text><h1> you are missing an apostrophe, <h1 class="pink-text"><h1>
Abhisek Pattnaik
@abhisekp
Sep 22 2015 01:26
@Avil172 it's called collapsing margin.
Patrick McWilliams
@patrickmac110
Sep 22 2015 01:50
why is my unslider elements slid over to the left so much in my page causing my page to be able to horizontally scrollable ?? http://codepen.io/patrcikmac110/full/PPPKXQ/
you'll have to view it fullscreen, i'm currently sucking at responsive design
x34passenger
@x34passenger
Sep 22 2015 01:51
I have been unable to use the ip address to get the latitude and longitude. http://codepen.io/x34passenger/pen/OyXLOz
Mateja Trifunovski
@Matko95
Sep 22 2015 01:51
@patrickmac110 you can do this to disable horizontal scrolling
html, body {
    max-width: 100%;
    overflow-x: hidden;
}
Patrick McWilliams
@patrickmac110
Sep 22 2015 01:52
@Matko95 thank you so much for that... now why is it pushed to the left though
CamperBot
@camperbot
Sep 22 2015 01:52
patrickmac110 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 341 | @matko95 | http://www.freecodecamp.com/matko95
Timothy Bauman
@baumant
Sep 22 2015 01:53
bf
CamperBot
@camperbot
Sep 22 2015 01:53
we're talking about bonfire :fire: Bonfire: Roman Numeral Converter
Mateja Trifunovski
@Matko95
Sep 22 2015 01:55
@patrickmac110 can't seem to figure it out, it must be something you did in your CSS
Patrick McWilliams
@patrickmac110
Sep 22 2015 01:56
dangit
Don Price
@KingHippo
Sep 22 2015 02:00
Could I get a little help with Bonfire: Return Largest Numbers in Arrays
CamperBot
@camperbot
Sep 22 2015 02:00
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Patrick McWilliams
@patrickmac110
Sep 22 2015 02:01
what issue ar eyou having with it?
x34passenger
@x34passenger
Sep 22 2015 02:01
@Matko95 can you help me with the javascript, I can get the ip address but having trouble trying to use it. http://codepen.io/x34passenger/pen/OyXLOz
Timothy Bauman
@baumant
Sep 22 2015 02:05
bf pairwise
CamperBot
@camperbot
Sep 22 2015 02:05

:fire:Bonfire: Pairwise :link:

function pairwise(arr, arg) {
  return arg;
}

pairwise([1,4,2,3,0,5], 7);

Return the sum of all indices of elements of 'arr' that can be paired with one other element to form a sum that equals the value in the second argument 'arg'. If multiple sums are possible, return the smallest sum. Once an element has been used, it cannot be reused to pair with another.

more info:  bf details | bf links | hint

Timothy Bauman
@baumant
Sep 22 2015 02:05
hint
CamperBot
@camperbot
Sep 22 2015 02:05
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Patrick McWilliams
@patrickmac110
Sep 22 2015 02:07
with margin: 0 auto;
Don Price
@KingHippo
Sep 22 2015 02:08
@patrickmac110 I'm not sure if I'm using the correct logic to solve the problem
````
function largestOfFour(arr) {
  // You can do this!
  var top = [];
  for(var i = 0; i < arr.length; i++) {
   for(var j = 0; j < arr[i]; j++) {
     return j;
   }

  }

}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]], "");
Jhonnathan
@jhonnathan78
Sep 22 2015 02:08
Hello every one
can any one please help me with the following Bonfire: Check for Palindromes
CamperBot
@camperbot
Sep 22 2015 02:08
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Don Price
@KingHippo
Sep 22 2015 02:09
@patrickmac110 I think I need to loop through the arrays with 2 for loops
Jhonnathan
@jhonnathan78
Sep 22 2015 02:11
CamperBot
@camperbot
Sep 22 2015 02:11
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Don Price
@KingHippo
Sep 22 2015 02:12
@jhonnathan78 what problem are you having?
DJ
@qualitymanifest
Sep 22 2015 02:12
@jhonnathan78 What do you need help with? Have you written any code for it yet
Jhonnathan
@jhonnathan78
Sep 22 2015 02:13

function palindrome(str) {
// Good luck!
str.replace("/\s{2,}/g," "")toLowerCase();
return true;
}

palindrome("eye");

hello @KingHippo
that is what I got so far
I don't understand how to solve it
Hello @qualitymanifest
DJ
@qualitymanifest
Sep 22 2015 02:14
@jhonnathan78 I'm not sure about that regex. also, you haven't tried to compare str to str backwards
also to use .toLowerCase() after .replace() you need to remember the period before toLowerCase()
Don Price
@KingHippo
Sep 22 2015 02:15
@jhonnathan78 You need to use a loop to traverse the string as well
Jhonnathan
@jhonnathan78
Sep 22 2015 02:16
how do you check for str backwards
x34passenger
@x34passenger
Sep 22 2015 02:16
I'm not sure how to check for upper case in the string. Bonfire: Search and Replace
DJ
@qualitymanifest
Sep 22 2015 02:16
make a var, call it whatever you like, maybe strBackwards and compare it to str
okay i'm just gonna try to write some pseudocode for this @jhonnathan78
Jhonnathan
@jhonnathan78
Sep 22 2015 02:18
ok thanks
CamperBot
@camperbot
Sep 22 2015 02:18
if you want to thank someone, put an @ before their name!
Matt Everson
@matteverson
Sep 22 2015 02:19
Whenever I feel like my algorithm isn't as good as it could be, I check http://rosettacode.org/wiki/Category:Programming_Tasks
DJ
@qualitymanifest
Sep 22 2015 02:20
function palindrome(str) {
//  get rid of whitespace, split str into individual chars,
// create a variable of str reversed
  if (str reversed === str) {
    return true;
  }

  else {
    do something
  }
}



palindrome("eye");
that first line should read "get rid of non-letters" since you need to do more than eliminate whitespace...
@matteverson thanks i just checked that out and that's a pretty cool resource
CamperBot
@camperbot
Sep 22 2015 02:24
qualitymanifest sends brownie points to @matteverson :sparkles: :thumbsup: :sparkles:
:star: 385 | @matteverson | http://www.freecodecamp.com/matteverson
John Oksasoglu
@oksas
Sep 22 2015 02:26
@matteverson @hansinla many thanks guys :D that did the trick
I'm having some trouble with the validate US phone numbers bonfire. my function works great for all but two tests, and for those two tests it gives me the error "regEx.exec(...) is null"
here's a jsbin with my code: http://jsbin.com/kitoyalije/edit?js,output
anyone know what would cause this to happen? something wrong with my regular expression maybe? even if there was though I would expect a return value of false (ie the test simply fails) rather than somehow returning null
x34passenger
@x34passenger
Sep 22 2015 02:35
I'm having trouble figuring out the Bonfire: Pig Latin
function translate(str) {
 var arr = str.split(''); 
 var consonant = '';
 if( arr[0] != 'a' || arr[0] != 'e' || arr[0] != 'i' || arr[0] != 'o' || arr[0] != 'u' )
 {
   consonant = arr[0];
   arr = arr.slice(0,0);
   arr.append(consonant + 'ay');
 }
 return str;
}

translate("consonant");
Philip Warkentien II
@warkentien2
Sep 22 2015 02:36
@x34passenger let's see.
Mateja Trifunovski
@Matko95
Sep 22 2015 02:40
sry
fourmatsee
@fourmatsee
Sep 22 2015 02:40
Anyone else think the Bonfire for Symmetric Difference evaluates incorrectly?
Mateja Trifunovski
@Matko95
Sep 22 2015 02:40
@fourmatsee it evaluates correctly
@fourmatsee what's the problem?
fourmatsee
@fourmatsee
Sep 22 2015 02:41
symmetric difference of these arrays [1, 2, 5], [2, 3, 5], [3, 4, 5]
evaluates to [1, 4] because they're the only unique elements
the problem expects [1, 4, 5]
Mateja Trifunovski
@Matko95
Sep 22 2015 02:42
@fourmatsee to get a symetric difference of three arrays, or more you need to do symmetric difference of [1,2,5] and [2,3,5] first which is [1,3] and then [1,3] with [3,4,5] and then you get [1,4,5]
and so on
fourmatsee
@fourmatsee
Sep 22 2015 02:43
Oh, I was comparing them all together. So weird. k
x34passenger
@x34passenger
Sep 22 2015 02:44
@Matko95 but ultimately, how do I get the temperature? I'm still not sure how to get the lat and lon?
Philip Warkentien II
@warkentien2
Sep 22 2015 02:45

@x34passenger there are a lot of minor issues.
you also didn't treat the else case that'll return "+way"

make sure when you do a function it updates the original.

str = str.didsomething()

RegEx would make your life way easier

Mateja Trifunovski
@Matko95
Sep 22 2015 02:46
@x34passenger you need to wrap your ajax calls for weather api, with a function, containing 2 arguments (lat,lon)
@x34passenger and you can call that function inside the get for ipinfo
x34passenger
@x34passenger
Sep 22 2015 02:48
@warkentien2 can you give me an example of the regex?
@Matko95 where is there an example of that at http://ipinfo.io/developers
Mateja Trifunovski
@Matko95
Sep 22 2015 02:51
@x34passenger how are you unsure?
  $.get("http://ipinfo.io/", function(response) {
    $('#country').append("<p>" + response.country + "</p>")
    $('#city').append('<p>' + response.city + '</p>')
   var location=response.loc.split(",");
    var lat=location[0];
    var lon=location[1];

  }, "jsonp");
this will get you the lat and lon
and then you do etc GetWeather(lat,lon)
Philip Warkentien II
@warkentien2
Sep 22 2015 02:53

@x34passenger
^ starts with
$ ends with
[ ] one of the options inside brackets
( ) if you use parenthesis you created a group that you can call back later.. (in order)
. any character

  • 0+ times
  • 1+ times

in second parameter:
$number corresponds to group previously selected with ( )
ex:
str.replace(/(^a).*(b$)/, "money$2$1"); // get every word that starts with a has (0 or +) random characters and ends with b
and return.. moneyba

@x34passenger there are many other functionalities
\w <- alpha char
\d <- digit
\w* <- 0 or more alpha char
[abc] <- a or b or c. also can be written as a | b | c

just go back to the RegEx lessons and practice!
you can use regEx in half of your bonfires

x34passenger
@x34passenger
Sep 22 2015 02:56
thanks @Matko95
CamperBot
@camperbot
Sep 22 2015 02:56
x34passenger sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 342 | @matko95 | http://www.freecodecamp.com/matko95
Philip Warkentien II
@warkentien2
Sep 22 2015 02:59

@fourmatsee symmetric difference uses group theory.

What is unique to each group.
when you consider 2 groups.
(will use ^ as "and" since it's the notation used in college)
A and B.. it's A + B - A^B

but if you have 3 groups.
its
A + B + C - A^B - A^C - B^C.. (however since you subtracted A B C one too many times, you compensate with a final add)
A + B + C - A^B - A^C - B^C + A^B^C

and.. so on. it gets tricky if you try number > 3
but the test cases only check up to 3. so you'll be fine stopping there (or using another algorythm)

Jacob Jamell
@jjamell
Sep 22 2015 03:20
This message was deleted
fourmatsee
@fourmatsee
Sep 22 2015 03:43
@warkentien2 once I watched the video on it it all made sense :)
thanks @Matko95
CamperBot
@camperbot
Sep 22 2015 03:43
fourmatsee sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 343 | @matko95 | http://www.freecodecamp.com/matko95
fourmatsee
@fourmatsee
Sep 22 2015 03:44
and thanks @warkentien2
CamperBot
@camperbot
Sep 22 2015 03:44
fourmatsee sends brownie points to @warkentien2 :sparkles: :thumbsup: :sparkles:
:star: 296 | @warkentien2 | http://www.freecodecamp.com/warkentien2
Cornelious Tujare
@Andy9860
Sep 22 2015 03:54
hello everyone
m stuck in bonfire check for pallindromes
Jason Healy
@jhealy86
Sep 22 2015 03:56
@Andy9860 what specifically are you stuck on?
Cornelious Tujare
@Andy9860
Sep 22 2015 03:57
@jhealy86 the last section where it says "0_0 (: /-\ :) 0-0" should return true
Jason Healy
@jhealy86
Sep 22 2015 03:57
help palindrome
CamperBot
@camperbot
Sep 22 2015 03:57

:point_right: bonfire check for palindromes [wiki]

Explanation:

You have to check if the string you get as an input is a palindrome and return true if it is, and false otherwise.

:pencil: read more about bonfire check for palindromes on the FCC Wiki

Timothy Bauman
@baumant
Sep 22 2015 03:57
bf validate
CamperBot
@camperbot
Sep 22 2015 03:57

:fire:Bonfire: Validate US Telephone Numbers :link:

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



telephoneCheck("555-555-5555");

Return true if the passed string is a valid US phone number

more info:  bf details | bf links | hint

Timothy Bauman
@baumant
Sep 22 2015 03:57
hint
CamperBot
@camperbot
Sep 22 2015 03:57
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Jason Healy
@jhealy86
Sep 22 2015 03:59
@Andy9860 Ok, do you understand why the last one is supposed to return true?
Cornelious Tujare
@Andy9860
Sep 22 2015 03:59
yes it is a palindrome...
Jason Healy
@jhealy86
Sep 22 2015 03:59
alright, and is that the only one not working?
Cornelious Tujare
@Andy9860
Sep 22 2015 04:00
yes
Jason Healy
@jhealy86
Sep 22 2015 04:00
can you post your code here so i can take a look at it?
Cornelious Tujare
@Andy9860
Sep 22 2015 04:00

function palindrome(str) {
// Good luck!
str = str.replace(/ /g,'');
str = str.replace(/,/g,'');
str = str.replace(/./g,'');
str = str.toLowerCase();
console.log(str);

var len = str.length;
for ( var i = 0; i < Math.floor(len/2); i++ ) {
if (str[i] !== str[len - 1 - i]) {
console.log(str[i]);
return false;
}
}

return true;
}

m not good with this one...
Jason Healy
@jhealy86
Sep 22 2015 04:01
do you know how to do the formatting?
x34passenger
@x34passenger
Sep 22 2015 04:01
@warkentien2 I see your point of using regex, but using regex, am I correct in assuming then that I don't need to convert the string into an array, but I can just use or manipulate the string?
Jason Healy
@jhealy86
Sep 22 2015 04:02
do it like this:
```
code goes here
```
Cornelious Tujare
@Andy9860
Sep 22 2015 04:02
'''
CamperBot
@camperbot
Sep 22 2015 04:02
:bulb: to format code use backticks! ``` more info
Jason Healy
@jhealy86
Sep 22 2015 04:02
remember to do a line break between the ``` and your code
it's the backtick, right next to the 1 on a qwerty keyboard
Cornelious Tujare
@Andy9860
Sep 22 2015 04:02

'''
function palindrome(str) {
// Good luck!
str = str.replace(/ /g,'');
str = str.replace(/,/g,'');
str = str.replace(/./g,'');
str = str.toLowerCase();
console.log(str);

var len = str.length;
for ( var i = 0; i < Math.floor(len/2); i++ ) {
if (str[i] !== str[len - 1 - i]) {
console.log(str[i]);
return false;
}
}

return true;
}
'''

CamperBot
@camperbot
Sep 22 2015 04:02
:bulb: to format code use backticks! ``` more info
Cornelious Tujare
@Andy9860
Sep 22 2015 04:02
sorry abt that one
function palindrome(str) {
  // Good luck!
  str = str.replace(/ /g,'');
  str = str.replace(/,/g,'');
  str = str.replace(/\./g,'');
  str = str.toLowerCase();
  console.log(str);

  var len = str.length;
  for ( var i = 0; i < Math.floor(len/2); i++ ) {
      if (str[i] !== str[len - 1 - i]) {
          console.log(str[i]);
          return false;
      }
  }

  return true;
}
Jason Healy
@jhealy86
Sep 22 2015 04:04
okay, let's take a look at those replace statements. can you explain what they're doing, specifically?
Cornelious Tujare
@Andy9860
Sep 22 2015 04:04
first one is replacing the space
second will replace commas
and third will replace dot..
Jason Healy
@jhealy86
Sep 22 2015 04:06
okay, is that all the punctuation the last test string has in it?
Cornelious Tujare
@Andy9860
Sep 22 2015 04:07
the last string has colons, slashes n dash
Jason Healy
@jhealy86
Sep 22 2015 04:08
so what can you do to get rid of those?
Cornelious Tujare
@Andy9860
Sep 22 2015 04:10
will need to write regex to replace them
Jason Healy
@jhealy86
Sep 22 2015 04:12
go ahead and try it
Cornelious Tujare
@Andy9860
Sep 22 2015 04:16
done
Jason Healy
@jhealy86
Sep 22 2015 04:18
working?
Cornelious Tujare
@Andy9860
Sep 22 2015 04:22
yes
i first tried removing slashes.. which was wrong i guess.. then i commented them and replaced the brackets it worked
Jason Healy
@jhealy86
Sep 22 2015 04:23
Well, you should be removing the slashes, but they're tricky in a regex
just typing \/\ won't work
or even worse, ///
Cornelious Tujare
@Andy9860
Sep 22 2015 04:25
yes.. it commented everything ahead of it
str = str.replace(/-/g,'');
  str = str.replace(/\(/g,'');

  str = str.replace(/\)/g,'');
  //str = str.replace(///g,'');
  //str = str.replace(/\\/g,'');
Jason Healy
@jhealy86
Sep 22 2015 04:26
you have to escape the slash, which tells the interpreter you want the actual character, and not its functionality. annoyingly enough, to escape a character, you ... type a forward slash in front of it
so a regex to match one forward slash would look like ////
actually, i don't even know if FCC's in-browser thing can handle it
Cornelious Tujare
@Andy9860
Sep 22 2015 04:28
it would still look like a comment... coz of // together...
Jason Healy
@jhealy86
Sep 22 2015 04:28
oh wait, i'm wrong. to escape you type a BACKslash. so the regex would look like /\//
Cornelious Tujare
@Andy9860
Sep 22 2015 04:28
hmm...
Jason Healy
@jhealy86
Sep 22 2015 04:28
escaping characters gets annoying
Cornelious Tujare
@Andy9860
Sep 22 2015 04:28
although this is one of the best ways to learn...
its bit irritating when some programs dont work.. but did understand the use of these functions
Bill
@kirah1314
Sep 22 2015 04:50
@Andy9860 there are many regex resources out there, like this one: http://www.regexr.com/
Cornelious Tujare
@Andy9860
Sep 22 2015 04:52
thank you @kirah1314 ... will go through..
CamperBot
@camperbot
Sep 22 2015 04:52
andy9860 sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 251 | @kirah1314 | http://www.freecodecamp.com/kirah1314
x34passenger
@x34passenger
Sep 22 2015 05:48
how do I come up with a regex that would only check for consonants and not vowels?
SojournerOctocat
@SojournerOctocat
Sep 22 2015 05:51
@x34passenger str.search(/[bcdfghjklmnpqrstvwxyz]/)
Kathy C
@tamienne
Sep 22 2015 05:51
find npm
CamperBot
@camperbot
Sep 22 2015 05:51
find npm
nothing found
DTing
@dting
Sep 22 2015 05:54
@x34passenger /[^aeiou]/
x34passenger
@x34passenger
Sep 22 2015 05:54
@dting wouldn't that search for the vowels?
How do I search for a word in a string that is capitalized?
Bill
@kirah1314
Sep 22 2015 05:55
@x34passenger this should be helpful for all your questions: http://www.regexr.com/
DTing
@dting
Sep 22 2015 05:56
the ^ inside the bracket negates
x34passenger
@x34passenger
Sep 22 2015 05:56
@kirah1314 I don't think my latter question is regex related
If I wanted to search for a word in a string that is capitalized, do I have to convert the string to an array?
Bill
@kirah1314
Sep 22 2015 05:57
regex does have a way to check for capitalized letters
x34passenger
@x34passenger
Sep 22 2015 05:57
@kirah1314 in a string?
Bill
@kirah1314
Sep 22 2015 05:58
yes
^A-Z
Lambo
@JohnnyLamb
Sep 22 2015 06:01
Hey guys, does anyone know if the nonprofit projects have to be done with a pair? I'm wondering if they can be done individually or not.
DTing
@dting
Sep 22 2015 06:01
I believe at least the first one requires a partner.
Bill
@kirah1314
Sep 22 2015 06:01
This message was deleted
scratch the last one
Bill
@kirah1314
Sep 22 2015 06:15
@x34passenger oops it should be [A-Z]
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:15

I added

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

but apparently, that's not the answer.

Kathy C
@tamienne
Sep 22 2015 06:16
@SojournerOctocat you want to leave the wheels at 4 and add a new property for engines
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:17
@tamienne Isn't that what I did?
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.
myCar = function() {
   this.engines = 4;
};

// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
Kathy C
@tamienne
Sep 22 2015 06:18
@SojournerOctocat no... it originally "this.wheels = 4"; in the code you have it has "this.engines = 4;"
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:19
@tamienne But I thought myCar inherited the wheels from Car?
Even the instructions don't mention anything about adding wheels, only engines...
x34passenger
@x34passenger
Sep 22 2015 06:19
I am not able to check for the case correctly in the Bonfire: Search and Replace.
function myReplace(str, before, after) {
 str = str.replace(before, after); 

 var word = str.search(after);
 if( word == before.toUpperCase())
 {
   str = str.replace(before, after.toUpperCase());
 }
 else
 {
   str = str.replace(before, after);
 }

 return str;
}

myReplace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:20
@SojournerOctocat You are creating a constructor for myCar, but myCar is just an instace of the Car constructor.
You need to create a new property for the myCar instance using .notation or ["notation"]
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:20
@luishendrix92 And as an instance, doesn't it inherit wheels?
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:20
But they want you to add engines,
Kathy C
@tamienne
Sep 22 2015 06:20
@SojournerOctocat sorry.. was looking at your earlier one code.. you're reassign myChar to be a different object
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:20
so myCar.engines = 4;
or myCar["engines"] = 4
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:21
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.
myCar.engines = 4; 
};

// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
is not passing the tests.
Kathy C
@tamienne
Sep 22 2015 06:21
you have an extra };
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:22
}; is an extra, shouldn't be there
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:22
Okay, thanks @tamienne @luishendrix92 !
CamperBot
@camperbot
Sep 22 2015 06:22
sojourneroctocat sends brownie points to @tamienne and @luishendrix92 :sparkles: :thumbsup: :sparkles:
:star: 369 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
:star: 267 | @tamienne | http://www.freecodecamp.com/tamienne
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:23
@x34passenger You just want to test the first character, not the whole word.
You could use indexOf for that.
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:24

Remember

Within constructors:
  1. var something = "value"; means a private variable or method
  2. this.something = "other value"; means a public value or method
  3. Constructors create instances which INHERIT BUT TAKE AS THEIR OWN properties or methods from that constructor.
  4. Prototypes let your instances use the methods or properties but they aren't owned by the instances.
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:24
What are prototypes?
Bill
@kirah1314
Sep 22 2015 06:25
@x34passenger after[0] will check the first letter of after
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:25
No, that's not the question @luishendrix92. The question is what does #4 mean "they aren't owned by the instances"
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:26
If you console.log myCar you'll get whatever you put in the constructor
and it will have some curious thing called proto (in chrome)
so if I had
myCar.prototype.something = "lol";
it won't appear as an "enumerable" property
it'll be in its "prototype"
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:27
What's an enumerable property?
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:27
if you use "for in" in the object, it'll list the enumerable properties
something you defined when you created the object
var obj = {
  prop1: 1,
  prop2: 2,
  prop3: 3
}
obj.prototype.prop4 = 4;
I'm really bad at explaining this lol+
x34passenger
@x34passenger
Sep 22 2015 06:29
I am still not getting it.
function myReplace(str, before, after) {
 str = str.replace(before, after); 

 var word = str.search(after);
 if( word == str.indexOf(before.toUpperCase()))
 {
   str = str.replace(before, after.toUpperCase());
 }
 else
 {
   str = str.replace(before, after);
 }

 return str;
}

myReplace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:29
Not really grasping this. Can you give an example of when I might use a prototype instead of a regular whatever, @luishendrix92 ?
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:30
Hmm imagine you want to create objects that get their properties and methods from an Animal constructor
Imagine a prototype as something that holds properties and methods that aren't going to be changed in the future, something that ALL ANIMALS have in common.
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:31
@x34passenger Your code isn't passing the tests?
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:31
They all speak (method), they all eat (method) hmmm
those methods should be in their prototype
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:31
Okay.
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:31
instead of created in every instance possible when you're not really going to change them
x34passenger
@x34passenger
Sep 22 2015 06:32
@SojournerOctocat No it is not passing
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:32
@x34passenger It's the pig latin one, right?
Oops. No.
@luishendrix92 Okay, that makes sense.
@x34passenger I am so sorry. It's not indexOf that you want to use. It's charAt!
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:36
@x34passenger Here:
if( word == str.indexOf( before.toUpperCase() ) )
the methods search and indexOf work differently, you shouldn't really depend on them. And you're even uppercasing the "before" and then looking it up in a string where things are lowercase.
I think you're better off using regular expressions
x34passenger
@x34passenger
Sep 22 2015 06:36
@SojournerOctocat Bonfire: Search and Replace
@luishendrix92 I'm not sure how to use the regex in the code?
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:37
@x34passenger Using the allmighty String.prototype.replace.
but you need a special handle for the whole "matching the case of the original word" thing
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:38
Or, you can test the first letter of the before string, see if it's uppercase or not, then process the after string accordingly, and replace the before string.
x34passenger
@x34passenger
Sep 22 2015 06:39
@luishendrix92 I am suing the String.prototype.replace but I don't know how to formulate the regex to check for the first letter to be capital?
@SojournerOctocat I am trying to do that, I have the logic down, but not sure how to implement with regex
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:41
How do you use String.prototype.replace? This is the first I'm hearing about that.
Is that the same as str.replace?
x34passenger
@x34passenger
Sep 22 2015 06:42
@SojournerOctocat My understanding is it just used like the regular string replace
function myReplace(str, before, after) {
 str = str.replace(before, after); 

 var word = str.search(after);
 if( word == str.indexOf(before.toUpperCase()))
 {
   str = str.replace(before, after.toUpperCase());
 }
 else
 {
   str = str.replace(before, after);
 }

 return str;
}

myReplace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:43
@x34passenger So… my way, which sounds like is going to be more code than @luishendrix92's way, is to use before.charAt(0) in an if statement to see if it's uppercase or not.
x34passenger
@x34passenger
Sep 22 2015 06:44
@SojournerOctocat how do you check for upper case?
@SojournerOctocat toUpperCase()?
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:44
if (before.charAt(0) === before.charAt(0).toUpperCase())
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:45
@SojournerOctocat You can create a helper function:
function isFirstUpper(word) {
  return word.charAt(0) === word.charAt(0).toUpperCase();
}
isFirstUpper("cat") --> false
isFirstUpper("Cat") --> true
x34passenger
@x34passenger
Sep 22 2015 06:50
I believe the problem is that I don't know how to check the capitalized word in the string:
function myReplace(str, before, after) {
 str = str.replace(before, after); 

 if (before.charAt(0) === before.charAt(0).toUpperCase())
 {
   after = after.toUpperCase();
   str = str.replace(before, after);
 }
 else
 {
   str = str.replace(before, after);
 }

 return str;
}

myReplace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");
SojournerOctocat
@SojournerOctocat
Sep 22 2015 06:52
@x34passenger When you use after.toUpperCase(), it turns the entire word to uppercase.
And you only need to change the first letter of after.
Earlier, we changed the first character of a word to uppercase. Do you see how you did that?
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:54
And then I'd tackle the whole bonfire with:
function myReplace(str, before, after) {
  function isFirstUpper(word) {
    return word.charAt(0) === word.charAt(0).toUpperCase();
  } // End of checking if the first letter is uppercase or not
  function capitalize(word) {
    return word[0].toUpperCase() + word.substr(1);
  } // End of capitalizing a word

  return str.replace(new RegExp(before, "ig"), function(match) {
    return isFirstUpper(match) ? capitalize(after) : after;
  });
}

myReplace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");
It looks messy when you create functions for simple task, but it makes the code more readable.
x34passenger
@x34passenger
Sep 22 2015 06:56
thanks @luishendrix92 @SojournerOctocat
CamperBot
@camperbot
Sep 22 2015 06:56
x34passenger sends brownie points to @luishendrix92 and @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:star: 370 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
:star: 308 | @sojourneroctocat | http://www.freecodecamp.com/sojourneroctocat
x34passenger
@x34passenger
Sep 22 2015 06:56
I will have to review the code
it is not that easy to figure out
Luis Felipe López G.
@luishendrix92
Sep 22 2015 06:57
The important parts are:
  1. Once you find the word, you need to check if its first letter is uppercase, that can be done by checking the first character of that word, if it's equal to that same character uppercased, then it's uppercase, else, it's not.
  2. Replace it according to the aforementioned rule, that can be done with word[0].toUpperCase() + word.substr(1)
when word is equal to the after variable
Jepz
@Jepz
Sep 22 2015 07:21
Anyone done the Twtich Zipline assigment? I'm doing some research before starting and the API request only gives me a image if the stream is online. Is there any other way to get the images via API?
Elizabeth Hatleli
@TheHighPriestess
Sep 22 2015 08:17

After my experience with Everything Be True...where I didn't quite understand what I was being asked to do....my advice is...

ALWAYS check the FCC wiki on that bonfire FIRST....before attempting the exercise

@Jepz I didn't use images in mine
Jepz
@Jepz
Sep 22 2015 08:19
@TheHighPriestess so you are only showing one channel?
Elizabeth Hatleli
@TheHighPriestess
Sep 22 2015 08:21
yeah
That's all that's required
Jepz
@Jepz
Sep 22 2015 08:21
@TheHighPriestess and about the "FCC wiki" thingy... might just be cause of to little coffee or something else, but what do you mean?
Oh really? What about chaning between online, offline and search?
What you have coded, is it the bare minimal?
Elizabeth Hatleli
@TheHighPriestess
Sep 22 2015 08:22
if it's online...you will see that
I used an account that was online to test it
Regarding the FCC wiki....it gives you additional information about the bonfires. For example..the one I'm working on now:
Katie
@Katie-S
Sep 22 2015 08:23
Hi all I am just learning how the chat functions work. I understand the the # symbol relates to an issue, but where are the numbers coming from ?
Elizabeth Hatleli
@TheHighPriestess
Sep 22 2015 08:23
Yeah...I believe that what I have there are the basic requirements...the "user stories:\
@Katie-S if you hover over it you'll see something pop up
Jepz
@Jepz
Sep 22 2015 08:25
@TheHighPriestess true, I like to challenge myself and try to complete all the stories ^^
The wiki help will be useful, didn't even know about it before :)
And to the cookie...
@TheHighPriestess thanks for helping out
CamperBot
@camperbot
Sep 22 2015 08:25
jepz sends brownie points to @thehighpriestess :sparkles: :thumbsup: :sparkles:
:star: 264 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
Katie
@Katie-S
Sep 22 2015 08:25
right, but if I needed help with a problem how would I know which number to use?
Elizabeth Hatleli
@TheHighPriestess
Sep 22 2015 08:25
@Jepz I just got lazy haha
Katie
@Katie-S
Sep 22 2015 08:25
Is it the same as whatever the number is in the top right of my screen next to map?
Jepz
@Jepz
Sep 22 2015 08:26
@TheHighPriestess I'm so close to also to do the same ^^
Elizabeth Hatleli
@TheHighPriestess
Sep 22 2015 08:26
@Katie-S honestly...i'm a bit confused about how it works
Katie
@Katie-S
Sep 22 2015 08:26
Okay. Is there a main wiki page that helps explain the system?
Jepz
@Jepz
Sep 22 2015 08:27
camperbot
Elizabeth Hatleli
@TheHighPriestess
Sep 22 2015 08:27
try this;
Jepz
@Jepz
Sep 22 2015 08:27
@camperbot
Katie
@Katie-S
Sep 22 2015 08:27
thanks @TheHighPriestess
CamperBot
@camperbot
Sep 22 2015 08:27
katie-s sends brownie points to @thehighpriestess :sparkles: :thumbsup: :sparkles:
:star: 265 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
Katie
@Katie-S
Sep 22 2015 08:45
@TheHighPriestess I found the answer regarding how issues get their numbers if you are interested in understanding it too. :) Guide to GitHub activities
Walter Lim
@waltzaround
Sep 22 2015 08:56
Stuck on the second bonfire exercise atm, anyone mind giving me a hand?
Katie
@Katie-S
Sep 22 2015 08:56
Where do I find the bonfire exercises? Anyone?
Walter Lim
@waltzaround
Sep 22 2015 08:57
Katie
@Katie-S
Sep 22 2015 08:57
Unable to locate challenges only mention of them
Katie
@Katie-S
Sep 22 2015 08:57
Oh I see. After one more chapter I'm there :)
Walter Lim
@waltzaround
Sep 22 2015 08:58
No worries :)
Katie
@Katie-S
Sep 22 2015 08:58
thanks @waltzaround
CamperBot
@camperbot
Sep 22 2015 08:58
katie-s sends brownie points to @waltzaround :sparkles: :thumbsup: :sparkles:
:star: 173 | @waltzaround | http://www.freecodecamp.com/waltzaround
Walter Lim
@waltzaround
Sep 22 2015 09:11
Anyone around?

:3

tva10
@tva10
Sep 22 2015 09:14
@waltzaround I'm here...
Walter Lim
@waltzaround
Sep 22 2015 09:15
How would you convert the output of a function to a string
tva10
@tva10
Sep 22 2015 09:16
@waltzaround what you mean under output?
array?
Walter Lim
@waltzaround
Sep 22 2015 09:16
not too sure how to explain it tbh
DTing
@dting
Sep 22 2015 09:17
bf reverse
CamperBot
@camperbot
Sep 22 2015 09:17

:fire:Bonfire: Reverse a String :link:

function reverseString(str) {
  return str;
}

reverseString('hello');

Reverse the provided string.

more info:  bf details | bf links | hint

DTing
@dting
Sep 22 2015 09:17
have you taken a look at these links?
bf links
Walter Lim
@waltzaround
Sep 22 2015 09:17
I have
but every time I try to split it it tells me reverseString.split is not a function
DTing
@dting
Sep 22 2015 09:18
what does your code look like right now?
help formatting
CamperBot
@camperbot
Sep 22 2015 09:18

: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

tva10
@tva10
Sep 22 2015 09:18
@waltzaround then you use split(), function return an array
Walter Lim
@waltzaround
Sep 22 2015 09:19

'''js
function reverseString(str) {
return str;

var array = reverseString;
array = reverseString.split("");
array = array.reverse();
array = array;
array = array.join("");
array = reverseString;

}
reverseString("hello", "");

CamperBot
@camperbot
Sep 22 2015 09:19
:bulb: to format code use backticks! ``` more info
tva10
@tva10
Sep 22 2015 09:19
but an array hasn't this function..
DTing
@dting
Sep 22 2015 09:19
reverseString is your function. the parameter that reverseString is called with is accessable inside the reverseString function as str.
tva10
@tva10
Sep 22 2015 09:20
@waltzaround umm your input is in str variable
DTing
@dting
Sep 22 2015 09:20
also if you keep return str; there the rest of your code will never be reached.
Walter Lim
@waltzaround
Sep 22 2015 09:21

```js

function reverseString(str) {

var array = str;
array = str.split("");
array = array.reverse();
array = array;
array = array.join("");
array = str;

return str;
}
reverseString("hello", "");

tva10
@tva10
Sep 22 2015 09:21
@waltzaround return array after join
Walter Lim
@waltzaround
Sep 22 2015 09:22
much appreciated
tva10
@tva10
Sep 22 2015 09:22
@waltzaround and you don't need array=array; there
Walter Lim
@waltzaround
Sep 22 2015 09:22
cheers
thanks tva10
CamperBot
@camperbot
Sep 22 2015 09:23
if you want to thank someone, put an @ before their name!
Walter Lim
@waltzaround
Sep 22 2015 09:23
thanks @tva10
CamperBot
@camperbot
Sep 22 2015 09:23
waltzaround sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 242 | @tva10 | http://www.freecodecamp.com/tva10
Walter Lim
@waltzaround
Sep 22 2015 09:23
thanks @dting
CamperBot
@camperbot
Sep 22 2015 09:23
waltzaround sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1226 | @dting | http://www.freecodecamp.com/dting
tva10
@tva10
Sep 22 2015 09:24
@waltzaround in that task you can use one line code....
Walter Lim
@waltzaround
Sep 22 2015 09:25
I just realized that... var strReverse = str.split('').reverse().join('');
tva10
@tva10
Sep 22 2015 09:25
@waltzaround or like that return str.split('').reverse().join('');
Walter Lim
@waltzaround
Sep 22 2015 09:25
oh
Karolis
@Luomint
Sep 22 2015 10:23
zipline
Ankit Panwar
@coderNoob
Sep 22 2015 10:34
$('.box').html(questions[i].q);
    $(".box1").html(questions[i].g);
<blockquote class="box">
      <footer class="box1">
        <cite>
        </cite>
      </footer>
    </blockquote>
It's not printing the source name. It works fine if I put the footer outside the blockqoute. I'm stuck. Help.
Elizabeth Hatleli
@TheHighPriestess
Sep 22 2015 10:36
@Katie-S thanks :)
CamperBot
@camperbot
Sep 22 2015 10:36
thehighpriestess sends brownie points to @katie-s :sparkles: :thumbsup: :sparkles:
:star: 119 | @katie-s | http://www.freecodecamp.com/katie-s
Prashanth
@dgprashanth
Sep 22 2015 11:14
Guys I need some help printing out the value of an id to the console!
If you look at the addSessionInput code, I want to output the number 25 which is stored in #session id
var inputVal=($('#session').attr('value'));
      console.log(inputVal);
gregorysl
@gregorysl
Sep 22 2015 11:16
$('#session').html() should be enough
Prashanth
@dgprashanth
Sep 22 2015 11:16
I have already assigned a value to that earlier using .html()
I would now like to read the value present in that id
gregorysl
@gregorysl
Sep 22 2015 11:17
if you would have <p id="session" value='23'></p>, then your code would work
Prashanth
@dgprashanth
Sep 22 2015 11:17
oh...
That's how attr('value') works is it? Thanks!
CamperBot
@camperbot
Sep 22 2015 11:17
if you want to thank someone, put an @ before their name!
Prashanth
@dgprashanth
Sep 22 2015 11:18
So now if I do as you suggested, it should directly read the value I have previously entered right?
@gregorysl I seem to be getting the number 25 out on the console using .html()
Thanks @gregorysl
CamperBot
@camperbot
Sep 22 2015 11:18
dgprashanth sends brownie points to @gregorysl :sparkles: :thumbsup: :sparkles:
:star: 255 | @gregorysl | http://www.freecodecamp.com/gregorysl
gregorysl
@gregorysl
Sep 22 2015 11:19
Glad you got it :)
I have problem with Symmetric Difference. In description it says " symmetric difference refers to the elements in two sets that are in either the first or second set, but not in both.". I managed to pass firs test, but I fail second. sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5]
How come in answer there is 5 when it's in all arrays?
Ainuddin Faizan
@andyfaizan
Sep 22 2015 11:26
Hi! Anyone here who's done the "Zipline: Build a Personal Portfolio Webpage"?
gregorysl
@gregorysl
Sep 22 2015 11:27
I did
Ainuddin Faizan
@andyfaizan
Sep 22 2015 11:29
Great! So I just had a query regarding the quality of the work. Are we supposed to completely do it like the example portfolio? I mean same looking buttons, picture inside a circular frame etc?
a1rr0wh3ad
@a1rr0wh3ad
Sep 22 2015 11:31
@gregorysl In that bonfire, I think symmetric difference is applied in pairs. So you get the symmetric difference of the first two arrays, which is [1,3], then the symmetric difference of [1,3] and the last element ([3,4,5]) which is [1,4,5].
gregorysl
@gregorysl
Sep 22 2015 11:31
I customized this to my liking, I just followed general guidelines from first link
@a1rr0wh3ad I'll try to change the code
Ankit Panwar
@coderNoob
Sep 22 2015 11:38
$('.box').html(questions[i].q);
    $(".box1").html(questions[i].g);
<blockquote class="box">
      <footer class="box1">
        <cite>
        </cite>
      </footer>
    </blockquote>
It's not printing the source name. It works fine if I put the footer outside the blockqoute. I'm stuck. Help. @gregorysl
gregorysl
@gregorysl
Sep 22 2015 11:46
Yeah, because you overwrite your html

If you do $('.box'), you'll get

<blockquote class="box">
<footer class="box1">
<cite>
</cite>
</footer>
</blockquote>

but after you do "$('.box1').html('asd')"
your html looks like this <blockquote class="box">asd</blockquote>
And you don't have .box1
but after you do "$('.box1').html('asd')" <-----------------------------should be '.box' not '.box1'
Ankit Panwar
@coderNoob
Sep 22 2015 11:55
@gregorysl I still didn't get it. I'm writing to different classes, so why would it overwrite the other one.
http://codepen.io/coderNoob/pen/MaepdX
gregorysl
@gregorysl
Sep 22 2015 11:57
Change lines 9 and 10 to
alert( $('.box').html())
$('.box').html(questions[i].q);
alert( $('.box').html())
$('#box1').html(questions[i].g);
And check the difference
Prashanth
@dgprashanth
Sep 22 2015 12:04
Guys, can anyone help me out with a certain issue i've not been able to fix for a few days now
Ankit Panwar
@coderNoob
Sep 22 2015 12:05
@gregorysl Class box1 is undefined and box contains the footer part. What can I change to achieve the desired result. If it does not work out, I'm left with the option of the good old div tag.
Prashanth
@dgprashanth
Sep 22 2015 12:05
When I change session duration, I want the timer to change. I think it has something to do with the way I'm looping right now, can't be sure :/
gregorysl
@gregorysl
Sep 22 2015 12:08

@coderNoob

<blockquote>
<p class="box"></p>
<footer class="box1"></footer>
</blockquote>

gregorysl
@gregorysl
Sep 22 2015 12:15
@dgprashanth you have couple errors in code. When adding or substracting time, you dont update variable responsible for text display
Prashanth
@dgprashanth
Sep 22 2015 12:16
@gregorysl in the addSessionInput and the other 3 methods you mean?
Please tell me how I can fix this :)
Ankit Panwar
@coderNoob
Sep 22 2015 12:17
@gregorysl It works but I'm still not able to grasp the concept. Why wouldn't it work if I put the class in the div tags or the blockqoute. Is there a link or resource I can learn from something about it?
gregorysl
@gregorysl
Sep 22 2015 12:18
I didn't check the break section, just session section, but probably too.
Prashanth
@dgprashanth
Sep 22 2015 12:19
If you can help me by telling me where i can place or how i can update the sessionTime variable correctly, i will update the break part of it as well
gregorysl
@gregorysl
Sep 22 2015 12:21
hint: see method resetDisplay
CamperBot
@camperbot
Sep 22 2015 12:21
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Prashanth
@dgprashanth
Sep 22 2015 12:26
@gregorysl Got it working!! thank you so much!! been bugging me forever!
CamperBot
@camperbot
Sep 22 2015 12:26
dgprashanth sends brownie points to @gregorysl :sparkles: :thumbsup: :sparkles:
:star: 256 | @gregorysl | http://www.freecodecamp.com/gregorysl
vvkgdm
@vvkgdm
Sep 22 2015 12:50
@dgprashanth prashanth
can u help me out?
how to do this jQuery
any body
Jason Wood
@catapixel
Sep 22 2015 12:54
@vvkgdm I'll take a look
vvkgdm
@vvkgdm
Sep 22 2015 12:54
@catapixel ok please help me im new here thanks!
CamperBot
@camperbot
Sep 22 2015 12:54
vvkgdm sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 380 | @catapixel | http://www.freecodecamp.com/catapixel
iamzakr
@iamzakr
Sep 22 2015 12:55
you’ve completed the previous task where you added the classes to the button elements, yeah @vvkgdm ?
the difference now is you are selecting elements by class
so where as before it was $(“elementHere”)
Jason Wood
@catapixel
Sep 22 2015 12:57
@vvkgdm I've completed it and it's working. Can you paste in your document ready function so I can see what you have? That is all that needs to be modified for this one...
vvkgdm
@vvkgdm
Sep 22 2015 12:57

<script>
$(".well").addclass("animated shake");
</script>

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

@catapixel
Jason Wood
@catapixel
Sep 22 2015 12:58
.addClass is case-sensitive. you need a capital "C"
iamzakr
@iamzakr
Sep 22 2015 12:58
^^
vvkgdm
@vvkgdm
Sep 22 2015 12:58
@catapixel oh ok
Jason Wood
@catapixel
Sep 22 2015 12:59
@vvkgdm Also your document ready is missing. Copy your jquery line, click the "Reset" button, and then paste your jquery with the capital "C" into the document ready function below the "button" adjustment
Should look like this...
<script>
  $(document).ready(function() {
    $("button").addClass("animated bounce");
    $(".well").addClass("animated shake");
  });
</script>
vvkgdm
@vvkgdm
Sep 22 2015 13:02
@catapixel thanks
done
CamperBot
@camperbot
Sep 22 2015 13:02
vvkgdm sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:warning: vvkgdm already gave catapixel points
Kris Gesling
@krisgesling
Sep 22 2015 13:39
Thanks @Rafase282 @mhelmetag for the wiki-work on BF drop it.
CamperBot
@camperbot
Sep 22 2015 13:39
krisgesling sends brownie points to @rafase282 and @mhelmetag :sparkles: :thumbsup: :sparkles:
:star: 152 | @mhelmetag | http://www.freecodecamp.com/mhelmetag
:star: 475 | @rafase282 | http://www.freecodecamp.com/rafase282
Kris Gesling
@krisgesling
Sep 22 2015 13:42
Is it actually bad to have your return nested inside a for loop or is it just the way FCC is verifying the solution? On Bonfire Drop it the result was showing as undefined when all elements are shift()ed from an array until I used break; to escape the for loop and returned from the top-level of the function (whatever that is called)
I guess if it was part of a broader program and you tried to reuse that result it wouldn't know that it was an array and you would need to redefine it?
Briana
@LiathsAingeal
Sep 22 2015 13:45
New problem I have to write a script element at the top of my program but I can't get the script tag right
blob
Kris Gesling
@krisgesling
Sep 22 2015 13:47
@LiathsAingeal the whole opening <script> tag should go before the $(document)
Briana
@LiathsAingeal
Sep 22 2015 13:47
ah thankyou @krisgesling
Kris Gesling
@krisgesling
Sep 22 2015 13:47
Does it make sense why?
Briana
@LiathsAingeal
Sep 22 2015 13:48
yes I just thought that in this it was like in previous ones where it was written like a class
Kris Gesling
@krisgesling
Sep 22 2015 13:49
yeah, the class is a property of the <div> or other element, where as this is something that <script> will act upon
lol dunno if that made any sense, it's late here, night all
Briana
@LiathsAingeal
Sep 22 2015 13:50
Makes alot more sense so when you add new script like this do you add it underneath this or instead of this?
Kris Gesling
@krisgesling
Sep 22 2015 13:51
Any new javascript has to go between the opening and closing <script></script>
Briana
@LiathsAingeal
Sep 22 2015 13:51
ok
Kris Gesling
@krisgesling
Sep 22 2015 13:52
but you can add in any number of those that you like, just like you can with other tags <p> etc
Briana
@LiathsAingeal
Sep 22 2015 13:52
big help thank you @krisgesling
CamperBot
@camperbot
Sep 22 2015 13:52
liathsaingeal sends brownie points to @krisgesling :sparkles: :thumbsup: :sparkles:
:star: 249 | @krisgesling | http://www.freecodecamp.com/krisgesling
Kris Gesling
@krisgesling
Sep 22 2015 13:52
mostly though your javascript will be fine to load at the top because that first line says to wait until the document is ready, then execute the function between the curly brackets {}
no worries, have a good night / day :p
Briana
@LiathsAingeal
Sep 22 2015 13:53
you to :)
Philip Warkentien II
@warkentien2
Sep 22 2015 14:12
@fourmatsee my Sym Dif function works for n>3, I can PM it to you.
@x34passenger yes. (and no) working with .replace you manipulate string. but match transform each match into a array element of strings.
ex:
"banana".match(/na/g); //=> ["na","na"]
Subcomediante
@Subcomediante
Sep 22 2015 14:20
For Waypoint 10 in HTML and CSS:
It's telling me my h2 element is not red with this html:

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

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

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

Why is this not making the h2 element red?
joshmccall221
@joshmccall221
Sep 22 2015 14:23

Looks correct:

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

}
</style>

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

try that, maybe its just formatting…
Subcomediante
@Subcomediante
Sep 22 2015 14:23
Does to me also. But it won't pass me to next Waypoint. Says I haven't made h2 element red yet.
joshmccall221
@joshmccall221
Sep 22 2015 14:24
did you copy and paste mine in? Maybe its just a white space issue
Weird things happen when you delete and retype exactly what was there. :)
Subcomediante
@Subcomediante
Sep 22 2015 14:25
I think yours won't work because your class and class declaration are different.
But it did when I edited it. Thank you!
CamperBot
@camperbot
Sep 22 2015 14:26
if you want to thank someone, put an @ before their name!
Subcomediante
@Subcomediante
Sep 22 2015 14:26
Now is that my mistake or is that a bug?
Thank you @joshmccall221 !
CamperBot
@camperbot
Sep 22 2015 14:27
subcomediante sends brownie points to @joshmccall221 :sparkles: :thumbsup: :sparkles:
:star: 17 | @joshmccall221 | http://www.freecodecamp.com/joshmccall221
joshmccall221
@joshmccall221
Sep 22 2015 14:35

@Subcomediante unfortunately thats technology. :smile:

To place blame, could be a copy and paste kept a white space or end of line (EOL).

It also could be they way they check with their validation, i.e. you had a mistake, fixed it but the validation test didn’t recognize it.

The is where you can search forever and drive you nuts. If it looks right, copy and pate it somewhere else and retype it. 80% of the time it fixes it. Not just here but in production code as well.

Good luck on the the rest of the challenges !
Rafael J. Rodriguez
@Rafase282
Sep 22 2015 14:45
@krisgesling youa re welcome
vvkgdm
@vvkgdm
Sep 22 2015 14:59
http://freecodecamp.com/challenges/waypoint-target-a-specific-child-of-an-element-using-jquery
$(".target:nth-child(2)").addClass("animated bounce");
here how does the computer take target 2 as 2nd child
Sasa Popovic
@Zunior
Sep 22 2015 15:10
If cg.indexOf(splitted[1])===0 gives true, why if(cg.indexOf(splitted[1])===0) gives false?
joshmccall221
@joshmccall221
Sep 22 2015 15:12

@vvkgdm
should be worded "second child of its parent”. The parent of target is .well. There are 3 buttons inside the div with class well. The first button is the first child the second button is the second child.

When you call .target:nth-child, jquery first finds the parent of the target class (well) then finds the children

@vvkgdm Does that make sense?
vvkgdm
@vvkgdm
Sep 22 2015 15:22
@joshmccall221 yup thanks
CamperBot
@camperbot
Sep 22 2015 15:22
vvkgdm sends brownie points to @joshmccall221 :sparkles: :thumbsup: :sparkles:
:star: 18 | @joshmccall221 | http://www.freecodecamp.com/joshmccall221
joshmccall221
@joshmccall221
Sep 22 2015 15:23
great! cheers! :sparkles:
Soumya Rauth
@soumyaRauth
Sep 22 2015 15:25
How do I check whether an array is empty or not? is there any function to check it/
joshmccall221
@joshmccall221
Sep 22 2015 15:26
@soumyaRauth if (array.length === 0)
there is one way
Soumya Rauth
@soumyaRauth
Sep 22 2015 15:26
@joshmccall221 yap... thanks.
CamperBot
@camperbot
Sep 22 2015 15:26
soumyarauth sends brownie points to @joshmccall221 :sparkles: :thumbsup: :sparkles:
:star: 19 | @joshmccall221 | http://www.freecodecamp.com/joshmccall221
joshmccall221
@joshmccall221
Sep 22 2015 15:26
@Zunior do you have a link to the challenge?
joshmccall221
@joshmccall221
Sep 22 2015 15:39

@Zunior you if statement needs parens :
if (true){}; // true

If cg.indexOf(splitted[1])===0 gives true, why if(cg.indexOf(splitted[1])===0) gives false?

Boris
@boris-in-london
Sep 22 2015 15:54
how to post code
@hot to post code
camerbot how do i post code
Does anyone have five mins to spare
joshmccall221
@joshmccall221
Sep 22 2015 15:56
Screen Shot 2015-09-22 at 10.55.43 AM.png
Mateja Trifunovski
@Matko95
Sep 22 2015 15:56
explain formatting
CamperBot
@camperbot
Sep 22 2015 15:56

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Mateja Trifunovski
@Matko95
Sep 22 2015 15:56
@boris-in-london shoot
Jason Wood
@catapixel
Sep 22 2015 15:56
@boris-in-london what do you need?
Boris
@boris-in-london
Sep 22 2015 15:57
I'm on the factorializing number bonfire, i've got code but i don't understand why it wont work
here it is

<function factorialize(num) { for (var sup = num; sup > 0; sup - 1) {
var num = num * sup;
}
return num;
}

factorialize(5, '');
>

Mateja Trifunovski
@Matko95
Sep 22 2015 15:58
function factorialize(num) { for (var sup = num; sup > 0; sup - 1) {
var num = num * sup;
}
return num;
}
factorialize(5, '');
Boris
@boris-in-london
Sep 22 2015 15:58
thank you
CamperBot
@camperbot
Sep 22 2015 15:58
if you want to thank someone, put an @ before their name!
Jason Wood
@catapixel
Sep 22 2015 15:59
@boris-in-london one problem is that your var num inside your for loop is resetting your variable every time it goes around the loop.
Boris
@boris-in-london
Sep 22 2015 15:59
@Matko95 thanks
CamperBot
@camperbot
Sep 22 2015 15:59
boris-in-london sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 344 | @matko95 | http://www.freecodecamp.com/matko95
Boris
@boris-in-london
Sep 22 2015 16:00
@catapixal thanks
CamperBot
@camperbot
Sep 22 2015 16:00
boris-in-london sends brownie points to @catapixal :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for catapixal
Mateja Trifunovski
@Matko95
Sep 22 2015 16:00
@boris-in-london ok so this will work
function factorialize(num) { 
  for (var sup = num-1; sup > 0; sup=sup - 1) {
    var num = num * sup;
    }
  return num;
  }
factorialize(5, '');
azazel913
@azazel913
Sep 22 2015 16:00
  div

  {background-color: gray;}
</style>
Mateja Trifunovski
@Matko95
Sep 22 2015 16:01
@boris-in-london so when you try to decrement a loop, you must put sup=sup-1 or sup--
azazel913
@azazel913
Sep 22 2015 16:01
I have this code for my back ground AND IT WORKS BUT CODE CAMP IS TELLING ME IS WRONG CAN SOME ONE PLEASE TELLL ME WHY

```<style>
div

{background-color: gray;}
</style>

joshmccall221
@joshmccall221
Sep 22 2015 16:01
@azazel913 may need to delete and retype …
Mateja Trifunovski
@Matko95
Sep 22 2015 16:01
@boris-in-london and you made your sup variable equal to num, when it should be 1 less
joshmccall221
@joshmccall221
Sep 22 2015 16:01
the code checking bot can be pretty picky
Boris
@boris-in-london
Sep 22 2015 16:02
@Matko95 You made my day buddy. i've been rattling my mind over this for an hour.
joshmccall221
@joshmccall221
Sep 22 2015 16:02
what challenge?
azazel913
@azazel913
Sep 22 2015 16:02
@joshmccall221 okay ill try but don't think it will
Mateja Trifunovski
@Matko95
Sep 22 2015 16:02
@boris-in-london np :)
Boris
@boris-in-london
Sep 22 2015 16:02
:)
azazel913
@azazel913
Sep 22 2015 16:02
@joshmccall221 challenge div back ground color element
gregorysl
@gregorysl
Sep 22 2015 16:02
link?
Mateja Trifunovski
@Matko95
Sep 22 2015 16:03
@azazel913 you need to do this
<style>
.gray-background{
    background-color: gray;
  }
</stlye>
// and then add the class to the div
<div class="gray-background">
azazel913
@azazel913
Sep 22 2015 16:04
okay thanks and why did the other way work
CamperBot
@camperbot
Sep 22 2015 16:04
if you want to thank someone, put an @ before their name!
Kevin Rogers
@kevintrogers
Sep 22 2015 16:04
I am trying to build the weather app, but I don't understand how to use API's. Can anyone suggest a good online tutorial.
Mateja Trifunovski
@Matko95
Sep 22 2015 16:05
@azazel913 your way worked, but it targets all the divs, this applies only to 1, with the correct class
azazel913
@azazel913
Sep 22 2015 16:06
@Matko95 o okay thanks
CamperBot
@camperbot
Sep 22 2015 16:06
azazel913 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 345 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Sep 22 2015 16:06
@kevintrogers https://www.youtube.com/watch?v=fEYx8dQr_cQ this might help
Kevin Rogers
@kevintrogers
Sep 22 2015 16:07
@Matko95. I'll take a look at that. Should be very helpful. Thanks.
CamperBot
@camperbot
Sep 22 2015 16:07
kevintrogers sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 346 | @matko95 | http://www.freecodecamp.com/matko95
ProSerg
@ProSerg
Sep 22 2015 16:10
Hello, i have porblem with http://www.freecodecamp.com/challenges/bonfire-check-for-palindromes. My test http://codepen.io/ProSerg/pen/WQxWxr. I dont undertstand why test on FreeCodeCamp don't work?
"0_0 (: /-\ :) 0-0" should return true.
gregorysl
@gregorysl
Sep 22 2015 16:11
Test you provided shouldn't work
/-\
x34passenger
@x34passenger
Sep 22 2015 16:11
I am able to get the latitude and longitude but I am still not getting the correct temperature to display. http://codepen.io/x34passenger/pen/OyXLOz
Emily
@emvertes8711
Sep 22 2015 16:11
I am stuck on a style class question.
.gray-background {
background-colour = gray;
}
</style>
It isn't going fray?
gray not fray
gee-oge
@gee-oge
Sep 22 2015 16:12
@emvertes8711 color not colour
ProSerg
@ProSerg
Sep 22 2015 16:12
No, assert(palindrome("0_0 (: /-\ :) 0-0") === true, '"0_0 (: /-\ :) 0-0" should return true.');"0_0 (: /-\ :) 0-0" should return true.
Emily
@emvertes8711
Sep 22 2015 16:12
thanks
CamperBot
@camperbot
Sep 22 2015 16:12
if you want to thank someone, put an @ before their name!
Emily
@emvertes8711
Sep 22 2015 16:13
@gee-oge thanks, I have changed that and still not working?
CamperBot
@camperbot
Sep 22 2015 16:13
emvertes8711 sends brownie points to @gee-oge :sparkles: :thumbsup: :sparkles:
:star: 188 | @gee-oge | http://www.freecodecamp.com/gee-oge
Reggie
@Reggie01
Sep 22 2015 16:13
@emvertes8711
background-color: gray;  // remove equal sign
CamperBot
@camperbot
Sep 22 2015 16:14
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
gee-oge
@gee-oge
Sep 22 2015 16:14
@emvertes8711 so you changed background-colour to background-color?
Emily
@emvertes8711
Sep 22 2015 16:14
yes
x34passenger
@x34passenger
Sep 22 2015 16:14
thanks @SojournerOctocat
CamperBot
@camperbot
Sep 22 2015 16:14
x34passenger sends brownie points to @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:star: 318 | @sojourneroctocat | http://www.freecodecamp.com/sojourneroctocat
Emily
@emvertes8711
Sep 22 2015 16:15
@Reggie01 thanks, it is working now
CamperBot
@camperbot
Sep 22 2015 16:15
emvertes8711 sends brownie points to @reggie01 :sparkles: :thumbsup: :sparkles:
:star: 194 | @reggie01 | http://www.freecodecamp.com/reggie01
gee-oge
@gee-oge
Sep 22 2015 16:15
@emvertes8711 hmmm hard to figure out (especially when without context)
ProSerg
@ProSerg
Sep 22 2015 16:17
This text (("0_0 ( : /-\ : ) 0-0")) is palindrome! My test http://codepen.io/ProSerg/pen/WQxWxr confirms it. Why http://www.freecodecamp.com/challenges/bonfire-check-for-palindromes i have error?
Emily
@emvertes8711
Sep 22 2015 16:17
How do you get the hashtag symbol? On my computer there isn't one?
joshmccall221
@joshmccall221
Sep 22 2015 16:17
shitf + 3
#
@emvertes8711 make sense?
Emily
@emvertes8711
Sep 22 2015 16:19
yesthanks
I meant yes thanks @joshmccall221
CamperBot
@camperbot
Sep 22 2015 16:19
emvertes8711 sends brownie points to @joshmccall221 :sparkles: :thumbsup: :sparkles:
:star: 20 | @joshmccall221 | http://www.freecodecamp.com/joshmccall221
x34passenger
@x34passenger
Sep 22 2015 16:21
I am able to get the latitude and longitude but I am still not getting the correct temperature to display. http://codepen.io/x34passenger/pen/OyXLOz
gee-oge
@gee-oge
Sep 22 2015 16:21
Anyone free to help/pair on Zipline: Build a Personal Portfolio Webpage
Mateja Trifunovski
@Matko95
Sep 22 2015 16:25
@x34passenger as i told you yesterday, wrapped your ajax call for weather with a function containing lat and lon, and then called it in the get location with the correct parameters, and i changed your ajax url to this 'http://api.openweathermap.org/data/2.5/weather?lat="'+lat+'"&lon="'+lon+'&units=metric', note that i added units to equal metric
x34passenger
@x34passenger
Sep 22 2015 16:27
thanks @Matko95
CamperBot
@camperbot
Sep 22 2015 16:27
x34passenger sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 347 | @matko95 | http://www.freecodecamp.com/matko95
alfa0
@alfa0
Sep 22 2015 16:38
hey there i need help!!
how to add a class to an h2 tag in order to change it's color
Mateja Trifunovski
@Matko95
Sep 22 2015 16:47
@alfa0
<style>
.color{
 color: red;
}
</style>

<h2 class="color">Text</h2>
azazel913
@azazel913
Sep 22 2015 16:49
how do I make my form element back ground green```<form action="/submit-cat-photo" id="cat-photo-form">
alfa0
@alfa0
Sep 22 2015 16:49
got it!! (y)
azazel913
@azazel913
Sep 22 2015 16:51
can some one help plz :(
Mateja Trifunovski
@Matko95
Sep 22 2015 16:51
@azazel913 what do you mean?
lamarpierce
@lamarpierce
Sep 22 2015 16:53
In this excercise, http://freecodecamp.com/challenges/waypoint-condense-arrays-with-reduce, I'm not clear as to where the "previousVal" and "currentVal" come into play? Any insight is appreciated.
Mateja Trifunovski
@Matko95
Sep 22 2015 16:54
@lamarpierce it's just a descriptive name, you can use a and b
@lamarpierce it will take the first and second element, then second and third.. and so on
azazel913
@azazel913
Sep 22 2015 16:55
@Matko95 it wants me to give the id attribute of cat-photo and give it a green back ground in my style element
Mateja Trifunovski
@Matko95
Sep 22 2015 16:56
@azazel913 could you tell me what waypoint is that?
Luis Felipe López G.
@luishendrix92
Sep 22 2015 16:56
@lamarpierce Previous value, during the first iteration is the element at index 0, and current is the element at index 1;
during the next iterations, Previous will be equal to your return value.
azazel913
@azazel913
Sep 22 2015 16:59
@Matko95 Waypoint: Use an ID Attribute to Style an Element number 40 in html5 and css
lamarpierce
@lamarpierce
Sep 22 2015 17:00
@luishendrix92 are the elements you're referring to talking about the values in the array (var array = [4,5,6,7,8];)
Mateja Trifunovski
@Matko95
Sep 22 2015 17:00
@azazel913 oh add this in your style element
<style>
 #cat-photo-form {
    background-color: green;
  }
</style>
Luis Felipe López G.
@luishendrix92
Sep 22 2015 17:01

Let's say you have this array:
["banana", "pear", "apple", "cherry"]

First Iteration

previousValue --> "banana"
currentValue --> "pear"
When it finishes, the return value will be (see code below) --> "banana pear"

Second Iteration

If your code is, let's say, this:

["banana", "pear", "apple", "cherry"].reduce(function(prevFruit, currFruit) {
  return prevFruit+ " " + currFruit;
});

previousValue --> "banana pear"
currentValue --> "apple"
return value after it finishes the 2nd iteration --> "BPA"

Mateja Trifunovski
@Matko95
Sep 22 2015 17:01
@lamarpierce yep, it adds every consecutive element
Luis Felipe López G.
@luishendrix92
Sep 22 2015 17:01
@lamarpierce Are you seeing the pattern here?
azazel913
@azazel913
Sep 22 2015 17:01
@Matko95 that is it and it will work
Luis Felipe López G.
@luishendrix92
Sep 22 2015 17:01
Sorry if I put previousValue and prevFruit, you give the names you want.
Mateja Trifunovski
@Matko95
Sep 22 2015 17:02
@azazel913 yep, you are targetting an id, and giving it a background of green
azazel913
@azazel913
Sep 22 2015 17:02
@Matko95 thanks a lot
CamperBot
@camperbot
Sep 22 2015 17:02
azazel913 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:warning: azazel913 already gave matko95 points
lamarpierce
@lamarpierce
Sep 22 2015 17:03
@luishendrix92 Yes. I do see the pattern
This message was deleted
Geoorge94
@Geoorge94
Sep 22 2015 17:03
http://freecodecamp.com/challenges/waypoint-use-bracket-notation-to-find-the-last-character-in-a-string
What am I doing wrong? :worried: can you guys help me?
var firstName = "Ada";

var lastLetterOfFirstName = firstName[firstName.length - 1];

var lastName = "Lovelace";

var lastLetterOfLastName = lastName[lastName.length - 1 ];
lamarpierce
@lamarpierce
Sep 22 2015 17:04
@luishendrix92 In your example, it's pulling the the letter of each fruit because your bracket notation [0]...correct?
Luis Felipe López G.
@luishendrix92
Sep 22 2015 17:04
@lamarpierce Sorry I changed the example, it's somehow broken
It's now concatenating each fruit names with a space
LKian
@LKian
Sep 22 2015 17:05
hi all. does anyone have time to talk me through waypoint Make Object Properties Private
Luis Felipe López G.
@luishendrix92
Sep 22 2015 17:06
first, it sees the 2nd item as current and the 1st as previous, then it returns the previous + the current separated by a space.
now in the 2nd and the rest of iterations (until it reaches the end of the array), previous will be equal to what we returned in the previous iteration
metalek
@metalek
Sep 22 2015 17:06
thanks @Rafase282 @guyjoseph @jjmax75
CamperBot
@camperbot
Sep 22 2015 17:06
metalek sends brownie points to @rafase282 and @guyjoseph and @jjmax75 :sparkles: :thumbsup: :sparkles:
:star: 263 | @jjmax75 | http://www.freecodecamp.com/jjmax75
:star: 476 | @rafase282 | http://www.freecodecamp.com/rafase282
:star: 294 | @guyjoseph | http://www.freecodecamp.com/guyjoseph
Mateja Trifunovski
@Matko95
Sep 22 2015 17:06
@Geoorge94 seems good, try refreshing or something
Luis Felipe López G.
@luishendrix92
Sep 22 2015 17:06
banana pear
banana pear apple
banana pear apple cherry
lamarpierce
@lamarpierce
Sep 22 2015 17:08
@luishendrix92 I get it now. Thanks!
CamperBot
@camperbot
Sep 22 2015 17:08
lamarpierce sends brownie points to @luishendrix92 :sparkles: :thumbsup: :sparkles:
:star: 372 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
Geoorge94
@Geoorge94
Sep 22 2015 17:09
I'm trying for the last half an hour. Thx for answering tought @Matko95
CamperBot
@camperbot
Sep 22 2015 17:09
geoorge94 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 348 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Sep 22 2015 17:10
@Geoorge94 it could be a browser issue of some sort
Geoorge94
@Geoorge94
Sep 22 2015 17:13
@Matko95 you're right, it's the browser. Thx :smile:
CamperBot
@camperbot
Sep 22 2015 17:13
geoorge94 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:warning: geoorge94 already gave matko95 points
x34passenger
@x34passenger
Sep 22 2015 17:15
I've created the pomodoro timer interface and I've noticed that the buttons are referred to as angular items. I'm not sure how to reference the buttons since they are not referred to by ID. http://codepen.io/x34passenger/pen/jbrRpm
TeeReggz
@TeeReggz
Sep 22 2015 17:35

Hey I'm stuck with this Waypoint challange:" Give your form's text input field a class of form-control. Give your form's submit button the classes btn btn-primary. Also give this button the Font Awesome icon of fa-paper-plane." Here is my Code, Please help!!! <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<style>
h2 {
font-family: Lobster, Monospace;
}

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

</style>

<div class="container-fluid">
<div class="row">
<div class="col-xs-8">
<h2 class="text-primary text-center">CatPhotoApp</h2>
</div>
<div class="col-xs-4">
<a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
</div>
</div>
<img src="http://bit.ly/fcc-running-cats" class="img-responsive">
<div class="row">
<div class="col-xs-4">
<button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button>
</div>
</div>
<p>Things cats <span class="text-danger">love:</span></p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<div class="row">
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
</div>
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
</div>
</div>
<div class="row">
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Loving</label>
</div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Lazy</label>
</div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Crazy</label>
</div>
</div>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit<i class="fa fa-paper-plane"></i></button>
</form>
</div>

Avil
@Avil172
Sep 22 2015 17:48

hi, i have a question about html and css. its about setting up ids for elements.

1)can you give multiple elements the same id? lets say i am trying to give more than two elements the color "pink" by using id attribute[#pink-text{color:pink;}], rather than setting up a .pink-text class,

so what's wrong in giving two elements the same id, in the case i mentioned above?
is it even possible to give them the same id?

2)can you set up more than one ids for a single element?

Joshua Abu
@Absolutestunna
Sep 22 2015 17:51
If I have an image saved locally on my pc and I need to use the image on codepen.io. How does it work? How does file directory work on codepen.io
Avil
@Avil172
Sep 22 2015 17:57
@kirah1314 thanks :+1:
CamperBot
@camperbot
Sep 22 2015 17:57
avil172 sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 252 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Sep 22 2015 17:58
@Avil172 did you take a look? Basically you can use the same ID but only the first ID will do something so it's suggested to have unique ID's
if you want to do something to multiple elements (like all buttons) then use class
@Absolutestunna I don't think you could use a file saved on your local PC with codepen, if you have an image then I suggest to load it to imgur then use the link on copepen
Avil
@Avil172
Sep 22 2015 18:03
@kirah1314 yep.. i read that one.
thank you very much for the explanation..
CamperBot
@camperbot
Sep 22 2015 18:03
avil172 sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: avil172 already gave kirah1314 points
Bill
@kirah1314
Sep 22 2015 18:04
@Absolutestunna if you upgrade codepen to Pro then you can save your image to codepen and load it from there
@Avil172 np, glad to help
x34passenger
@x34passenger
Sep 22 2015 18:06
I'm having trouble making the person - Bonfire: Make a Person
var Person = function(firstAndLast) {
  nameArr = firstAndLast.split(" ");

  function getFirstName()
  {
    return nameArr[0];
  }

  function getLastName()
  {
    return nameArr[1];
  }

  function setFirstName(first)
  {
    nameArr[0] = first;
  }   

  function setLastName(last)
  {
    nameArr[1] = last;
  }

  function setFullName(firstAndLast)
  {
    firstAndLast = firstAndLast;
  }

  this.getFullName = function()
  {
    return firstAndLast;
  }

  //return firstAndLast;
};

var bob = new Person('Bob Ross');
bob.getFullName();
Jeremy Talavera
@jtalaver
Sep 22 2015 18:07
Hi everyone! I am having a really tough time understanding JavaScript. I know absolutely nothing about it and I feel I need to gain a general understanding of the language and structure before i continue on to the Bonfires. Does anyone have any literature I can study?
joshmccall221
@joshmccall221
Sep 22 2015 18:09
@jtalaver for a history of, doug crockford is my hero :
https://www.youtube.com/watch?v=JxAXlJEmNMg&list=PLK2r_jmNshM9o-62zTR2toxyRlzrBsSL2
Chahan Shah
@Chahanshah
Sep 22 2015 18:09
@jtalaver Do you have any previous programming experience (at any level) and want to learn JavaScript syntax or is this all fairly new?
joshmccall221
@joshmccall221
Sep 22 2015 18:09
he also wrote Javascript, the good parts
Jeremy Talavera
@jtalaver
Sep 22 2015 18:10
Thanks @joshmccall221 @Chahanshah, I do not have any previous experience whatsoever. All of this is fairly new.
CamperBot
@camperbot
Sep 22 2015 18:10
jtalaver sends brownie points to @joshmccall221 and @chahanshah :sparkles: :thumbsup: :sparkles:
:star: 21 | @joshmccall221 | http://www.freecodecamp.com/joshmccall221
:star: 257 | @chahanshah | http://www.freecodecamp.com/chahanshah
Elizabeth Hatleli
@TheHighPriestess
Sep 22 2015 18:10
@jtalaver Try Codeacademy
Joshua Abu
@Absolutestunna
Sep 22 2015 18:10
@kirah1314 can you point me to a link that'll teach me how to load files to imgur? Thanks @kirah1314
CamperBot
@camperbot
Sep 22 2015 18:10
absolutestunna sends brownie points to @kirah1314 and @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 253 | @kirah1314 | http://www.freecodecamp.com/kirah1314
:star: 253 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Jeremy Talavera
@jtalaver
Sep 22 2015 18:10
Thanks @TheHighPriestess
CamperBot
@camperbot
Sep 22 2015 18:10
jtalaver sends brownie points to @thehighpriestess :sparkles: :thumbsup: :sparkles:
:star: 266 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
Bill
@kirah1314
Sep 22 2015 18:11
@Absolutestunna http://imgur.com/ just create a free account
joshmccall221
@joshmccall221
Sep 22 2015 18:11
@TheHighPriestess ha.. is there a reason you dont suggest the freecodecamp for JS?
Elizabeth Hatleli
@TheHighPriestess
Sep 22 2015 18:11
@jtalaver Go through their Javascript course and then come back to the Bonfires.
@joshmccall221 I think Codeacademy's course is more in depth
Bill
@kirah1314
Sep 22 2015 18:12
@Absolutestunna imgur is a popular image uploading site and many people use it :thumbsup:
Chahan Shah
@Chahanshah
Sep 22 2015 18:12
@jtalaver Do not worry about not understanding everything in the beginning. It is expected. The JavaScript waypoints are basic introductions, but the real learning happens with trying to solve the Bonfires, by failing and reading a lot. The codeacademy course is a good place to get more guided practice in small chunks to help develop understanding
joshmccall221
@joshmccall221
Sep 22 2015 18:13
@jtalaver @TheHighPriestess , I started with code academy and then came over here… I like both… :)
Elizabeth Hatleli
@TheHighPriestess
Sep 22 2015 18:13
@jtalaver Codeacademy's course is not in depth. It will give a basic intro though.
@joshmccall221 Yeah....I would just do it all.
I did have some basic programming knowledge though when I started. At least...I had taken a couple of programming classes years ago.
Jeremy Talavera
@jtalaver
Sep 22 2015 18:13
@TheHighPriestess @Chahanshah @joshmccall221 Thanks for the support guys!
CamperBot
@camperbot
Sep 22 2015 18:13
jtalaver sends brownie points to @thehighpriestess and @chahanshah and @joshmccall221 :sparkles: :thumbsup: :sparkles:
:warning: jtalaver already gave chahanshah points
:warning: jtalaver already gave thehighpriestess points
:warning: jtalaver already gave joshmccall221 points
Bill
@kirah1314
Sep 22 2015 18:14
@jtalaver if you want to do some reading reading then http://eloquentjavascript.net/
Jeremy Talavera
@jtalaver
Sep 22 2015 18:14
Thanks @kirah1314 !
CamperBot
@camperbot
Sep 22 2015 18:14
jtalaver sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 254 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Chahan Shah
@Chahanshah
Sep 22 2015 18:15
You're welcome @jtalaver Just keep practicing and good luck.
Elizabeth Hatleli
@TheHighPriestess
Sep 22 2015 18:15
Can someone tell me why...when I tried to pass in something that's NOT a number...like the letter f for example...it comes back with "f is not defined"?
function add() {

    numarg = arguments.length; //num arguments passed to function

    if (numarg == 1){
        firstarg = arguments[0];
    }
    else{
        firstarg = arguments[0];
        secondarg = arguments[1];
    }

    isNumeric(firstarg);

    function isNumeric(arg){
        if (typeof(arg) !== 'number'){
            console.log("this is not a number");
            return;
        }
        else{
            console.log("this is a number");
        }
       }
    console.log('program end');

  //return false;


}

add(2,3);
Chahan Shah
@Chahanshah
Sep 22 2015 18:17
@TheHighPriestess try passing "f" instead of f
The quotes mean that you are passing a string "f", but by passing f, it is expecting a variable f that has not been defined
Hugo
@hugoender
Sep 22 2015 18:22

Can someone help me understand something with Waypoint 40 in Basic Javascript?

I am trying to understand how the following line works:

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

More specifically, why is the img src:

' +images[...]+ '

What do the plus signs do and why do i need an apostrophe when I already have quotation marks?

I would have thought that doing:

.html(<img src = "images[slotOne-1]">)

should have worked.

Chahan Shah
@Chahanshah
Sep 22 2015 18:27
@hugoender There are multiple parts to this. I will try to explain them. first, the argument in the .html() needs to be a string. Therefore The suggestion you mentioned does not work. it would have to be .html('stuff here')
That explains the outer quotes required.
Hugo
@hugoender
Sep 22 2015 18:28
@Chahanshah stopo right there...
@Chahanshah lets focus on this part right now
Chahan Shah
@Chahanshah
Sep 22 2015 18:28
Okay
x34passenger
@x34passenger
Sep 22 2015 18:28
for Bonfire: Missing letters, do you use a regular expression?
Chahan Shah
@Chahanshah
Sep 22 2015 18:28
@hugoender questions?
ranjith23
@ranjith23
Sep 22 2015 18:29
can someone please help me why I am failing to pass this test (item #7 in Object Oriented and Functional Programming) ? Below is the code I have written to clear this test. Not sure, what am I missing here.
array = array.filter(function(val){
  return val > 5;
});
azazel913
@azazel913
Sep 22 2015 18:29

how to get my text pink <style>
body {
background-color: black;
font-family: Monospace;
color: green;
}
</style>

<h1>Hello World!
{
class=:"pink-text";}

Hugo
@hugoender
Sep 22 2015 18:29
@Chahanshah okay... so i was not aware that .html () required strings only. I thought it could use html elements like <img>
since its called .html after all
lol
Chahan Shah
@Chahanshah
Sep 22 2015 18:30
The entire argument must be placed in a string. Yes you can use elements like <img>, but all of it must be a string
Hugo
@hugoender
Sep 22 2015 18:30
okay so the .html argument always needs to be a string..
Chahan Shah
@Chahanshah
Sep 22 2015 18:30
Yes
Hugo
@hugoender
Sep 22 2015 18:30
oka now you can continue :)
@azazel913 I think I can help you with that...
@azazel913 you want the <h1> text to be pink?
azazel913
@azazel913
Sep 22 2015 18:32
yes
Hugo
@hugoender
Sep 22 2015 18:32
@azazel913 get rid of
```
{
class=:"pink-text";}
azazel913
@azazel913
Sep 22 2015 18:32
okay then what
Hugo
@hugoender
Sep 22 2015 18:32
and change the color propery to pink
in the body css style
<h1> element is a "child" of the "parent" element <body>
so any property that is applied to the <body> element will be "inheritted" by the <h1> element
azazel913
@azazel913
Sep 22 2015 18:34
but it wants the body element to stay green
Chahan Shah
@Chahanshah
Sep 22 2015 18:34
@hugoender Second part of the multiple quotes and + has to deal with concatenating strings with variables. For example can you tell what the following lines of code will return?
var i = 'five';

console.log('I have i cats');

console.log('i have '+i+' cats');
Hugo
@hugoender
Sep 22 2015 18:35
if you wanted to ONLY change the text of the <h1> element to pink, you would create another... style (not sure what the proper name is) for the <h1> element like so:
h1 {
color: pink;
}
joshmccall221
@joshmccall221
Sep 22 2015 18:35

@jtalaver thanks for the link.

another resource(s) : https://leanpub.com/book_search?search=javascript

CamperBot
@camperbot
Sep 22 2015 18:35
joshmccall221 sends brownie points to @jtalaver :sparkles: :thumbsup: :sparkles:
:star: 174 | @jtalaver | http://www.freecodecamp.com/jtalaver
x34passenger
@x34passenger
Sep 22 2015 18:35
what is a boolean primitive?
azazel913
@azazel913
Sep 22 2015 18:35
@hugoender o okay thanks
CamperBot
@camperbot
Sep 22 2015 18:35
azazel913 sends brownie points to @hugoender :sparkles: :thumbsup: :sparkles:
:star: 159 | @hugoender | http://www.freecodecamp.com/hugoender
Hugo
@hugoender
Sep 22 2015 18:36
@azazel913 no problem! let me know if you need more help.
TeeReggz
@TeeReggz
Sep 22 2015 18:36
waypoint.jpg
Hey folks, can someone help me please? I'm stuck on the waypoint challenge "Give the submit button in your form the classes btn btn-primary.
Give the text input in your form the class form-control."
Hugo
@hugoender
Sep 22 2015 18:36
@Chahanshah ahhh isee
@Chahanshah now give me a sec to see how it applies to my waypoint
Samantha North
@sjnorth
Sep 22 2015 18:36
@tva10 thanks!
CamperBot
@camperbot
Sep 22 2015 18:36
sjnorth sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 243 | @tva10 | http://www.freecodecamp.com/tva10
Elizabeth Hatleli
@TheHighPriestess
Sep 22 2015 18:37
@Chahanshah Ok..that works. I don't know why I didn't think of it. Thank you.
CamperBot
@camperbot
Sep 22 2015 18:37
thehighpriestess sends brownie points to @chahanshah :sparkles: :thumbsup: :sparkles:
:star: 258 | @chahanshah | http://www.freecodecamp.com/chahanshah
Chahan Shah
@Chahanshah
Sep 22 2015 18:37
With that knowledge, try playing around with it, and see how it works and figure out on your own. If still stuck, ask for more help @hugoender
Hugo
@hugoender
Sep 22 2015 18:38

@Chahanshah so basically:

' +images[...]+ '

is just adding space to the right and left of image?

no wait
thats wrong
Lanie Molinar
@LivingForGod1991
Sep 22 2015 18:39
Can someone help me here? I'm totally confused. I'm working on learning how to change the color of an HTML element and I'm pretty sure I'm doing it right but it's not working. I'm trying to change the color of this element to red. This is what I have so far. <h2 style="color: red">CatPhotoApp</h2>
Chahan Shah
@Chahanshah
Sep 22 2015 18:40
@hugoender not quite. In this case, images[...] is a variable that contains a string and you are adding it to the rest of the string with the + signs
Hugo
@hugoender
Sep 22 2015 18:40
@Chahanshah yeah i see that but why? why do I need to add a string to a string in the img src?
that doesnt make sense to me
@TeeReggz what do you need help with?
@LivingForGod1991 that looks good to me
Chahan Shah
@Chahanshah
Sep 22 2015 18:43
The image tag looks something like this:
<img src="link" />
Notice how the link is a string? with the "" around it?
The .html in your jquery requires an argument that is a string.
'<img src = "link" />
This is straightforward if you have a static link. just replace link with the url you want
TeeReggz
@TeeReggz
Sep 22 2015 18:43
I'm stuck here Give the text input in your form the class form-control @hugoender
azazel913
@azazel913
Sep 22 2015 18:44
@hugoender I did it the way you told me to and it still didn't work
Chahan Shah
@Chahanshah
Sep 22 2015 18:45
@hugoender what you are trying to do is get the link url from a varaible (the images array). So writing <img src="images[0]"/>' will not work because the code thinks that the link url is "images0" which is not valid. The actual url is inside images0.
Hugo
@hugoender
Sep 22 2015 18:46
@Chahanshah I fully understand all of that. my issue is that instead of replacing link with images[...], the correct code replaces link with ' +images[..]+ '. In other words, I have two quotes...
<img src=" ' +images[...]+ ' ">
@Chahanshah ohhh
Chahan Shah
@Chahanshah
Sep 22 2015 18:46
@hugoender did that just make ssnse?
azazel913
@azazel913
Sep 22 2015 18:46
need help
Hugo
@hugoender
Sep 22 2015 18:47
so by having src="images0" it is treating images0 and a string and not a call to the array.
Chahan Shah
@Chahanshah
Sep 22 2015 18:47
Yes exactly
azazel913
@azazel913
Sep 22 2015 18:47

<style>
body {
background-color: black;
font-family: Monospace;
color: green;
}
</style>

h1 {
color:pink;
} <h1>hello world !</h1>
need my h1 element to be pink

Hugo
@hugoender
Sep 22 2015 18:47
@Chahanshah and by putting it in ' ' it treats it as a call first and them puts in in quotation marks. right?
Chahan Shah
@Chahanshah
Sep 22 2015 18:48
Yes, something like that
Hugo
@hugoender
Sep 22 2015 18:48
@azazel913 the h1 style needs to go INSIDE the <style> element
azazel913
@azazel913
Sep 22 2015 18:48
I did that it didn't work
Joshua Abu
@Absolutestunna
Sep 22 2015 18:48
@kirah1314 Thanks again
CamperBot
@camperbot
Sep 22 2015 18:48
absolutestunna sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: absolutestunna already gave kirah1314 points
Hugo
@hugoender
Sep 22 2015 18:49
@azazel913
This should work:
<style>
body {
background-color: black;
font-family: Monospace;
color: green;
}

h1 {
color:pink;
} 
</style>
<h1>hello world !</h1>
azazel913
@azazel913
Sep 22 2015 18:49
okay ill try it
Chahan Shah
@Chahanshah
Sep 22 2015 18:49
It is actually putting it outside the ' ' quotes if you read it carefully. You start the ' quote first, end it after the first " quote arfter src. Then end the ' quote. call the images array since it is outside the ' ' quotes. Then you restart the rest of the string with another ' quote. And all of this is combined togehter with the + + signs. @hugoender I hope that makes more sense
Hugo
@hugoender
Sep 22 2015 18:50
@TeeReggz add class = "form-control" to the input element
Chahan Shah
@Chahanshah
Sep 22 2015 18:51
$($('.slot')[0]).html('(start quote)<img src = "(start of src link quote)'(end outer quote) + images[slotOne-1] + '(restart outer quote)"(end of inner link quote)>'(end outer quote);
azazel913
@azazel913
Sep 22 2015 18:51
@hugoender now how do I add the h1 class pink part
Hugo
@hugoender
Sep 22 2015 18:56
you specify classes INSIDE of the element brackets
@Chahanshah alright let me try to internalize this for a bit :D
@azazel913 you specify classes INSIDE of the element brackets
Chahan Shah
@Chahanshah
Sep 22 2015 18:58
@hugoender no worries.
azazel913
@azazel913
Sep 22 2015 18:58
@hugoender okay can you give me an example my brain is stuck
Hugo
@hugoender
Sep 22 2015 19:00
@azazel913
<style>
.new-class {
color:purple;
}
</style>
<h1 class="new-class">Header text</h1>
Avil
@Avil172
Sep 22 2015 19:01
@azazel913 which waypoint? you need to follow the objectives for that specific waypoint for it to accept.
Hugo
@hugoender
Sep 22 2015 19:01
@Chahanshah AHHH makes sense now!! It's like a cube drawing... you can either see it going into the paper or popping out of the paper.
@Chahanshah its not until you TRY to see it the other way that you see it :D
@Chahanshah thank you very much for your time and help
CamperBot
@camperbot
Sep 22 2015 19:01
hugoender sends brownie points to @chahanshah :sparkles: :thumbsup: :sparkles:
:star: 259 | @chahanshah | http://www.freecodecamp.com/chahanshah
Chahan Shah
@Chahanshah
Sep 22 2015 19:01
@hugoender Glad to be of help. Yes, it is hard to visualize first, but once seen cannot be unseen
Hugo
@hugoender
Sep 22 2015 19:02
what do these brownie points do? and where do you see how many you have? or is it all imaginary?
Chahan Shah
@Chahanshah
Sep 22 2015 19:02
It is the number next to your profile pic
Bill
@kirah1314
Sep 22 2015 19:02
help brownie
CamperBot
@camperbot
Sep 22 2015 19:02

:point_right: brownie points [wiki]

The number beside your picture on Free Code Camp tells you how many Brownie Points you have.

A user profile picture next to a with Brownie Points score

There are three ways you can get Brownie Points:

  1. Complete challenges - you get one point per challenge you complete
  2. Post relevant links on Camper News - you get 1 point for posting a link, and another point for each upvote your link gets
  3. Help other campers in chat - each time you help another camper and they thank you (by typing "thanks @yourname"), you will get a point

Brownie Points help you look like the kind of person who codes a lot, shares relevant links, and helps people.

They also add to your Streak.
:pencil: read more about brownie points on the FCC Wiki

Chahan Shah
@Chahanshah
Sep 22 2015 19:02
I don't know what they do or mean
Nicholas
@nick88p
Sep 22 2015 19:02
Can anyone tell me why this is not correct? I need to output the some of my console input. First node.js challenge:
var sum = 0; for (var i=2; i<process.argv.length-2; i++) { sum += Number(process.argv[i]); } console.log(sum);
Chahan Shah
@Chahanshah
Sep 22 2015 19:02
Ah! that makes more sense. Thanks @kirah1314
CamperBot
@camperbot
Sep 22 2015 19:03
chahanshah sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 255 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Sep 22 2015 19:03
:thumbsup: @Chahanshah
Hugo
@hugoender
Sep 22 2015 19:03
what does the number next to the star in the brownie point text mean?
Chahan Shah
@Chahanshah
Sep 22 2015 19:04
@hugoender that is how many points the user currently has
DJ Runas
@djrunas
Sep 22 2015 19:04
The number of brownie points you have @hugoender
Hugo
@hugoender
Sep 22 2015 19:04
ahh i see.. thank you
CamperBot
@camperbot
Sep 22 2015 19:04
if you want to thank someone, put an @ before their name!
Hugo
@hugoender
Sep 22 2015 19:04
@djrunas @kirah1314 @Chahanshah thank you ;)
CamperBot
@camperbot
Sep 22 2015 19:04
hugoender sends brownie points to @djrunas and @kirah1314 and @chahanshah :sparkles: :thumbsup: :sparkles:
:warning: hugoender already gave chahanshah points
:star: 204 | @djrunas | http://www.freecodecamp.com/djrunas
:star: 256 | @kirah1314 | http://www.freecodecamp.com/kirah1314
DJ Runas
@djrunas
Sep 22 2015 19:05
Yumbers.
I love brownies!~
thnaks @hugoender :P
thanks @hugoender *
CamperBot
@camperbot
Sep 22 2015 19:05
djrunas sends brownie points to @hugoender :sparkles: :thumbsup: :sparkles:
Hugo
@hugoender
Sep 22 2015 19:05
lol
CamperBot
@camperbot
Sep 22 2015 19:05
:star: 160 | @hugoender | http://www.freecodecamp.com/hugoender
Hugo
@hugoender
Sep 22 2015 19:05
alright back to the waypoints... i cant help people if I am not advanced enough
DJ Runas
@djrunas
Sep 22 2015 19:05
And vice versa!
If you ever need help with something on FCC, feel free to ask a question here :)
Robert Richey
@0x0936
Sep 22 2015 19:06
$($) is the answer to all questions
DJ Runas
@djrunas
Sep 22 2015 19:06
There’s almost always someone here that can provide you with some tips.
Patrick Kennedy
@pkennedy89
Sep 22 2015 19:15
help seek and destroy
CamperBot
@camperbot
Sep 22 2015 19:15

:point_right: bonfire seek and destroy [wiki]

Explanation:

This problem is a bit tricky because you have to familiarize yourself with Arguments, as you will have to work with two or more but on the script you only see two. Many people hardcode this program for three arguments. You will remove any number from the first argument that is the same as any other other arguments.

:pencil: read more about bonfire seek and destroy on the FCC Wiki

lamarpierce
@lamarpierce
Sep 22 2015 19:20
In this Bonfire exercise, it's showing that I have everyting correct, but I didn't get the last two requirements. Why? http://freecodecamp.com/challenges/bonfire-reverse-a-string
Will Moody
@willmoody
Sep 22 2015 19:25
Hey guys! The following code is returning callback.apply is not a function, any idea why this might be?
Array.prototype.not = function(callback)
   { //polyfill, adds .not()
      return this.filter(function () 
        {
          return !callback.apply(this, arguments);
        });
   };
function diff(arr1, arr2) {

  var base = this;
  base.arr1 = arr1;
  base.arr2 = arr2;
  base.longArr = [];
  base.shortArr = [];
  base.output = [];
  (function(arr1, arr2) 
   { //sets variables longArr and shortArr when invoked
      if (base.arr1.length > base.arr2.length) 
        {
          base.longArr = base.arr1;
          base.shortArr = base.arr2;
        }
      else 
        {
          base.longArr = base.arr2;
          base.shortArr = base.arr1;
        };
   })();
  var evaluate = function(arr1, arr2)
   { //runs .not() on longArr and shortArr, producing the output
      base.output = base.longArr.not(base.shortArr);
   };
 evaluate(base.longArr, base.shortArr);
 return base.output; 
};

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Rex Schrader
@SaintPeter
Sep 22 2015 19:28
@fractal-mind ok, you've blown my mind.
Bill
@kirah1314
Sep 22 2015 19:28
@lamarpierce paste your codes?
Will Moody
@willmoody
Sep 22 2015 19:28
@SaintPeter Bahaha, is my code that bad?
Rex Schrader
@SaintPeter
Sep 22 2015 19:29
@fractal-mind I am not sure I understand the purpose of your nested filter in the not
@fractal-mind What is your expected result from a not operation on an array?
Will Moody
@willmoody
Sep 22 2015 19:31
I grabbed it from here, it's meant to do the opposite of .filter(), and return all the values that return false as opposed to true
the objective of the bonfire is to return all values that are not present in both arrays
Rex Schrader
@SaintPeter
Sep 22 2015 19:32

@fractal-mind Yeah, I understand the bonfire. I'm just trying to wrap my head around this function. it kinda makes sense . . . except that you're not passing a callback function into not are you?

 base.output = base.longArr.not(base.shortArr);

You're only passing an array in.

Will Moody
@willmoody
Sep 22 2015 19:34
Hmm, the more I look at the polyfill, the more I realize I don't understand how it's supposed to work haha
Rex Schrader
@SaintPeter
Sep 22 2015 19:34
@fractal-mind Ok, to answer your question, yes, your code is that bad. I can't even follow your logic.
@fractal-mind Can you explain, at a high level, your logic? Like . . . how do you take into account multiple parameters? Because there is one with 3 arrays, not just 2.
@fractal-mind This is definitely one of the harder problems.
Step 1: Write a function that will create the symmetric difference between two arbitrary arrays. You can use indexOf to great effect here.
Step 2: Figure out how to apply that function against multiple inputs.
@fractal-mind Are you testing your code on a site like http://repl.it ?
Will Moody
@willmoody
Sep 22 2015 19:38
@SaintPeter Well, to begin with, I guess I didn't realize I would need to handle three arrays, because the instructions of the bonfire and the function it initially sets you up with only indicate two arrays will be passed, so if that's true I'm obviously going to need to go back to the drawing board for that alone, but
lamarpierce
@lamarpierce
Sep 22 2015 19:39
@kirah1314 Here is my code.

function reverseString(str) {
return str.split('').reverse().join('');
}

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

Rex Schrader
@SaintPeter
Sep 22 2015 19:39
@fractal-mind Oh, wait, this is "Diff two arrays", not "Symettric Difference"
@fractal-mind So you are correct, sorry.
Bill
@kirah1314
Sep 22 2015 19:40
@lamarpierce your code looks good, it works for me
@lamarpierce I mean your codes passed all the tests
Will Moody
@willmoody
Sep 22 2015 19:41
@SaintPeter My intent was to determine which array is longer, because it has all the possible values, and then filter out the ones that are present in both. .filter(), however, returns the stuff that IS present in both, not the stuff that's NOT, so I got it in my head that if I could just do a reverse filter of sorts, it would accomplish what I need to accomplish
Rex Schrader
@SaintPeter
Sep 22 2015 19:41
@fractal-mind My thought is this: You can solve this with just two loops, indexOf, and push. You could also solve it with two loops and filter and indexOf. You might ALSO be able to somehow use splice, but I'm not sure.
@fractal-mind The length of the arrays doesn't matter. You have to compare A against B and THEN B against A, because something can be present in A and not in B and something can be present in B but not in A. Or you could concat A and B and remove anything that appears twice.
Will Moody
@willmoody
Sep 22 2015 19:43
@SaintPeter I need to refresh my knowledge of indexOf, I suppose! Yeah, my initial plan was to do two for loops, but I got kinda stuck so I started looking for another solution
Rex Schrader
@SaintPeter
Sep 22 2015 19:44
@fractal-mind Consider:
var a = [ 1, 2, 3, 4];
var b = [ 3, 4, 5, 6];
diff(a,b) ;  // [1, 2, 5, 6]
lamarpierce
@lamarpierce
Sep 22 2015 19:44
@kirah1314 The problem is when I delete this a string like "Greeting from Earth" is still passes.
Rex Schrader
@SaintPeter
Sep 22 2015 19:44
@fractal-mind You can't just search b for values in a. You have to ALSO search a for values in b.
Will Moody
@willmoody
Sep 22 2015 19:44
@SaintPeter Ah, true. True.
@SaintPeter Thanks for your help! You've given me much to think about, haha.
CamperBot
@camperbot
Sep 22 2015 19:45
fractal-mind sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 683 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 22 2015 19:45
@fractal-mind :D :D
Mission: Accomplished!
Bill
@kirah1314
Sep 22 2015 19:45
@lamarpierce the codes are correct, so why shouldn't it pass the tests?
you can use reverseString(""); and it'll pass all the tests because the tests are checking for the scenarios and not just your input
@lamarpierce I'm not certain what issues you're having...
lamarpierce
@lamarpierce
Sep 22 2015 19:47
@kirah1314 OK. Your last explanation answers my question. Thanks
CamperBot
@camperbot
Sep 22 2015 19:47
lamarpierce sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 258 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Sep 22 2015 19:48
ok great!
Boris
@boris-in-london
Sep 22 2015 20:12
This message was deleted
CamperBot
@camperbot
Sep 22 2015 20:12
:bulb: to format code use backticks! ``` more info
Boris
@boris-in-london
Sep 22 2015 20:12
dang...
function palindrome(str) {
  // Good luck!
  str = str.toLowerCase();
  array = str.split("");
  array = array.filter(function(val){
    return val == " ";
  });
  originalStr = array;
  array = array.reverse();
  array = array.join();
  originalStr = originalStr.join();

  if(array !== originalStr) {
    return false;} else {
      return true;
    } 
}



palindrome("eye");
can't get it to work? anyone have an idea why?
Jared Abel
@jaredabel
Sep 22 2015 20:21
hmm, copy pasting code from the chat into a problem doesnt break lines
dont you need to do join("") or join(" ")
Boris
@boris-in-london
Sep 22 2015 20:23
i'll give it a try @jaredabel00
Jared Abel
@jaredabel
Sep 22 2015 20:23
my solution was a bit different but that is one thing standing out
Boris
@boris-in-london
Sep 22 2015 20:24
no change @jaredabel00
Jared Abel
@jaredabel
Sep 22 2015 20:24
function palindrome(str) { var lower = str.toLowerCase(); var pless = lower.replace(/[/\s+/\.,-\/#!$%\^&\*;:{}=\-_`~()]/g,""); var splitted = pless.split(''); var rev = splitted.reverse(); var flipped = rev.join('');
Hugo
@hugoender
Sep 22 2015 20:24

I need some clarification on this code:

var array = [1,2,3,4,5,6,7,8,9,10];
  // Only change code below this line.

array = array.filter(function(val){
  return val <=5;
});

This basically filters out the values in the array that are greater than 5. My issue with it is that the

return val <= 5;

seems like it should return a boolean value even though it obviously doesn't.

Jared Abel
@jaredabel
Sep 22 2015 20:24
how do you markup code
Hugo
@hugoender
Sep 22 2015 20:24
type ```
Jared Abel
@jaredabel
Sep 22 2015 20:25
``function palindrome(str) { var lower = str.toLowerCase(); var pless = lower.replace(/[/\s+/\.,-\/#!$%\^&\*;:{}=\-_~()]/g,"");
var splitted = pless.split('');
var rev = splitted.reverse();
var flipped = rev.join('');
Hugo
@hugoender
Sep 22 2015 20:25
help ```
CamperBot
@camperbot
Sep 22 2015 20:25

Hi, I'm CamperBot! I can help you in this chatroom :smile:

Basic Commands:

  • find TOPIC find all entries about topic. ex: find js
  • wiki TOPIC show contents of topic page
  • thanks @username send brownie points to another user
  • about @username shows info on that user
  • bonfire BONFIRENAME info on a bonfire

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

Boris
@boris-in-london
Sep 22 2015 20:25
explain formating
CamperBot
@camperbot
Sep 22 2015 20:25
no wiki entry for: formating
:pencil: click here to create one now!after creating your page type update to reload it here
Jared Abel
@jaredabel
Sep 22 2015 20:25
``function palindrome(str) { var lower = str.toLowerCase(); var pless = lower.replace(/[/\s+/\.,-\/#!$%\^&\*;:{}=\-_~()]/g,"");
var splitted = pless.split('');
var rev = splitted.reverse();
var flipped = rev.join('');
``function palindrome(str) { var lower = str.toLowerCase(); var pless = lower.replace(/[/\s+/\.,-\/#!$%\^&\*;:{}=\-_~()]/g,"");
var splitted = pless.split('');
var rev = splitted.reverse();
var flipped = rev.join('');
ugh
function palindrome(str) { var lower = str.toLowerCase(); var pless = lower.replace(/[/\s+/\.,-\/#!$%\^&\*;:{}=\-_~()]/g,"");
var splitted = pless.split('');
var rev = splitted.reverse();
var flipped = rev.join('');
lol
Hugo
@hugoender
Sep 22 2015 20:25
explain markup for html
CamperBot
@camperbot
Sep 22 2015 20:25
no wiki entry for: markup for html
:pencil: click here to create one now!after creating your page type update to reload it here
Hugo
@hugoender
Sep 22 2015 20:25
hmm
Jared Abel
@jaredabel
Sep 22 2015 20:25
function palindrome(str) { var lower = str.toLowerCase(); var pless = lower.replace(/[/\s+/\.,-\/#!$%\^&\*;:{}=\-_~()]/g,"");
var splitted = pless.split('');
var rev = splitted.reverse();
var flipped = rev.join('');`
/facepalm
Boris
@boris-in-london
Sep 22 2015 20:25
lol no prob
try again

Hugo
@hugoender
Sep 22 2015 20:26
type then hit Shift+Enter then paste code then hit Shift+Enter and then type and then hit Enter to send
Boris
@boris-in-london
Sep 22 2015 20:26
```js
Jared Abel
@jaredabel
Sep 22 2015 20:26
function palindrome(str) {
  var lower = str.toLowerCase();
  var pless = lower.replace(/[/\s+/\.,-\/#!$%\^&\*;:{}=\-_`~()]/g,"");
  var splitted = pless.split('');
  var rev = splitted.reverse();
  var flipped = rev.join('');
Boris
@boris-in-london
Sep 22 2015 20:26
then close with ```
Hugo
@hugoender
Sep 22 2015 20:26
there you go
Boris
@boris-in-london
Sep 22 2015 20:26
good job
Jared Abel
@jaredabel
Sep 22 2015 20:26
that is how i started mine
Boris
@boris-in-london
Sep 22 2015 20:27
@jaredabel00 thanks
CamperBot
@camperbot
Sep 22 2015 20:27
boris-in-london sends brownie points to @jaredabel00 :sparkles: :thumbsup: :sparkles:
:star: 105 | @jaredabel00 | http://www.freecodecamp.com/jaredabel00
Jared Abel
@jaredabel
Sep 22 2015 20:27
2 months of no coding, i only finished the first 40 bonfires
21 bonfires rather
Hugo
@hugoender
Sep 22 2015 20:28

I need some clarification on this code:

var array = [1,2,3,4,5,6,7,8,9,10];
  // Only change code below this line.

array = array.filter(function(val){
  return val <=5;
});

This basically filters out the values in the array that are greater than 5. My issue with it is that the

return val <= 5;

seems like it should return a boolean value even though it obviously doesn't.

Boris
@boris-in-london
Sep 22 2015 20:29
Boolean is === or !== right?
true or false
Hugo
@hugoender
Sep 22 2015 20:29
no its == and !==
oops
!= and ==
and <= >=
i think
Boris
@boris-in-london
Sep 22 2015 20:30
oh ok i see
Jared Abel
@jaredabel
Sep 22 2015 20:30
I've had the same problem before but i forget what the explanation was
Boris
@boris-in-london
Sep 22 2015 20:30
someone correct me if im wrong but the filter method probably uses the boolean in it's own code
Hugo
@hugoender
Sep 22 2015 20:30
i mean the code works its just i don't like the convention used...maybe i used need to accept it as is and keep moving
maybe i just *
Boris
@boris-in-london
Sep 22 2015 20:31
so you're right @hugoender it does return a bool
but within the built in method <filter>
Hugo
@hugoender
Sep 22 2015 20:31
oh so it returns a bool and then based on that decides whether the value at that index is kept or ont?
not*
Boris
@boris-in-london
Sep 22 2015 20:31
yes
Hugo
@hugoender
Sep 22 2015 20:32
that makes sense...thank you @boris-in-london
CamperBot
@camperbot
Sep 22 2015 20:32
hugoender sends brownie points to @boris-in-london :sparkles: :thumbsup: :sparkles:
:star: 174 | @boris-in-london | http://www.freecodecamp.com/boris-in-london
Boris
@boris-in-london
Sep 22 2015 20:32
i bet if you looked at the filter method that is exaclty what it will show
the code of the filter methdod
np :)
Hugo
@hugoender
Sep 22 2015 20:32
where is the best way to look at the filter method?
best place*
man my typing is off today
Boris
@boris-in-london
Sep 22 2015 20:33
lol that's a great question @hugoender , i dont know to be honest.
lol WHY IS MY TYPING SO OFF TODAY!?!?!
Boris
@boris-in-london
Sep 22 2015 20:35
@hugoender wow it's a lot more complicated than i imagined
Hugo
@hugoender
Sep 22 2015 20:35
@boris-in-london nah its basically what you said
Boris
@boris-in-london
Sep 22 2015 20:35
there is a lot of action going on under the hood of these things
Hugo
@hugoender
Sep 22 2015 20:35
depending on the boolean value that the function returns, it decides whether to keep the value or not
Boris
@boris-in-london
Sep 22 2015 20:36
oh ok
Hugo
@hugoender
Sep 22 2015 20:38
ill stick around in case someone else needs help and I can help them
gotta pay it forward :)
Avil
@Avil172
Sep 22 2015 20:40

hi.. i just completed html/css section and doing the first exercise of bootstrap, i.e.
http://freecodecamp.com/challenges/waypoint-use-responsive-design-with-bootstrap-fluid-containers
i completed the challenge by following the instructions, but i have some doubts..

1-the bootstrap link code, that is said to automatically added, why can't i see that?
2-the class container-fluid, why doesn't it need to be declared like other classes?

Hugo
@hugoender
Sep 22 2015 20:41
@Avil172
  1. This is a known issue. I brought it up as well.
  2. because it is already declared in the bootstrap css file that you loaded with the link code
@Avil172 I suggest you click on the Bug button and then click on "Browse other issues with this challenge" and find the issue that is already posted about the missing link and comment
@Avil172 It will give FCC another person/data point to contact if they need help reproducing the issue
Rex Schrader
@SaintPeter
Sep 22 2015 20:44
@Avil172 You can't see it because it is included/used on every page in FCC. as for container-fluid, remember that Bootstrap is a giant collection of css classes. The whole point of using bootstrap is that it has defined all these classes for you to use. So as long as bootstrap is inlucded in the page, you have access to that class and many many more.
Avil
@Avil172
Sep 22 2015 20:45
@hugoender thanks
1- i thought there was something wrong, so i manually copied it from the instruction and pasted it in my code. the output was same in both cases.
2- oh, so will i be facing similar exercises later?(where the class won't need to be declared/loaded from the link)
CamperBot
@camperbot
Sep 22 2015 20:45
avil172 sends brownie points to @hugoender :sparkles: :thumbsup: :sparkles:
:star: 174 | @hugoender | http://www.freecodecamp.com/hugoender
Hugo
@hugoender
Sep 22 2015 20:46
@Avil172
  1. Correct. If the description of the waypoint says that you will be using a bootstrap class... you don't need to declare it
2*
Avil
@Avil172
Sep 22 2015 20:47
@SaintPeter thank you.
every page in FCC means the exercise(waypoint challenges) or in all of the pages in FCC? is it something that's widely used in websites?
so bootstrap already contains a lot of css classes.. hmm.
CamperBot
@camperbot
Sep 22 2015 20:47
avil172 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 687 | @saintpeter | http://www.freecodecamp.com/saintpeter
Hugo
@hugoender
Sep 22 2015 20:47
@Avil172 bootstrap is indeed widely used in websites. Some companies will even require you to have knowledge in using bootstrap in their job descriptions
Rex Schrader
@SaintPeter
Sep 22 2015 20:48
@Avil172 Both: The FCC website uses it and it is widely used in many websites. Here is the documentation for bootstrap. It has hundreds of pre-defined clsses for your use. It is almost entirely CSS based.
Hugo
@hugoender
Sep 22 2015 20:48
so now that you have used bootstrap.. you can say you have experience using bootstrap ;)
Avil
@Avil172
Sep 22 2015 20:51
@hugoender but i have just only completed the first exercise:-)
Rex Schrader
@SaintPeter
Sep 22 2015 20:51
@Avil172 That practically makes you an expert! ;) :)
Hugo
@hugoender
Sep 22 2015 20:52
lol that exercise plus my and @SaintPeter 's response along with his link.... you are ready for th ebig leagues
Rex Schrader
@SaintPeter
Sep 22 2015 20:52
@hugoender Look at how awesome we are. We're like the best teachers ever!
SaintPeter @SaintPeter dances
Avil
@Avil172
Sep 22 2015 20:53
@SaintPeter checked the site, i am not sure i understand those meta elements. should i check the link after completing the exercises from FCC?
me? expert? haha
Rex Schrader
@SaintPeter
Sep 22 2015 20:55
@Avil172 I'm just teasing - FCC is just giving you an intro on how to use some of bootstrap's basic features. There is a LOT to learn. You can certainly browse the Bootstrap site, but I tend to only go to it when I have a specific problem to solve. It's really almost too much for one person to learn. Just learn the bits you need, when you need them, and be broadly familiar with the overall capabilities.
Avil
@Avil172
Sep 22 2015 21:00
@SaintPeter i couldnt understand almost the entire front page, but i have bookmarked it for future. thank you both again for the help.
CamperBot
@camperbot
Sep 22 2015 21:00
avil172 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: avil172 already gave saintpeter points
Hugo
@hugoender
Sep 22 2015 21:06
@Avil172 Yeah don't worry about understanding the documentation of any programming language. It's there for when you need help in which case you will know what you are looking for and can focus on that. Otherwise it's a lot of abstracted information
Rex Schrader
@SaintPeter
Sep 22 2015 21:07
@Avil172 @hugoender I would say not to worry about it now, but ultimately you will learn to read them. It's a bit of a skill.
Will Moody
@willmoody
Sep 22 2015 21:09
Okay! Made another run at the Diff Two Arrays Bonfire, and while I feel like this should work, I'm getting hung up because for some reason, my ifs don't seem to be triggering their callbacks? I feel like I've overlooked something...
function diff(arr1, arr2) {
  //var test = function(arr1, arr2)
  var base = this;
  base.arr1 = arr1;
  base.arr2 = arr2;
  base.output = [];


  for (var i = 0; i < base.arr1.length; i++) 
    { 
      //console.log("Index of " + base.arr1[i] + " in " + base.arr2 + ": " + arr2.indexOf(base.arr1[i]));
      //console.log((arr2.indexOf(base.arr1[i]) === -1));
      if (arr2.indexOf(base.arr1[i]) == -1)
        {
          base.output.push(base.arr1[i]);
          console.log("Pushed: " + base.arr1[i]);
        };
    };
  for (var i2 = 0; i2 < base.arr2.length; i2++) 
    {
      //console.log("Index of " + base.arr2[i2] + " in " + base.arr1 + ": " + arr1.indexOf(base.arr2[i2]));
      //console.log((arr1.indexOf(base.arr2[i2]) === -1));
      if (arr2.indexOf(base.arr2[i2]) === -1)
        {
          base.output.push(base.arr2[i2]);
          console.log("Caught one: " + base.output);
        };
    };
  console.log("Output: " + output);
  return base.output;
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Even the logs don't go off :\
Rex Schrader
@SaintPeter
Sep 22 2015 21:11
@fractal-mind Well, that looks WAY better. However . . . all that base stuff is totally unnneded and possibly bad and wrong.
Will Moody
@willmoody
Sep 22 2015 21:13
@SaintPeter I do feel kind of weird using it, but it seemed an easy way to make the stuff I needed reliably globally accessible, where I would previously have problems with vars not being updated or properly pulled into functions for some reason
Rex Schrader
@SaintPeter
Sep 22 2015 21:15
@fractal-mind You can just say var arr1 and arr1 will be available anywhere in your function.
@fractal-mind Anyway, your logic looks good. Does it not work?
Will Moody
@willmoody
Sep 22 2015 21:16
@SaintPeter Well, that's even easier, haha, thanks. It doesn't! When I run it, regardless of the test logs returning everything I want to see (including a true when the if should be seeing true), the code inside the if doesn't seem to want to run
CamperBot
@camperbot
Sep 22 2015 21:16
fractal-mind sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 689 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 22 2015 21:16
@fractal-mind ok, lemme poke at it
Will Moody
@willmoody
Sep 22 2015 21:17
@SaintPeter as a sidebar, I didn't know if var i from the first loop would be in the same execution context as the var i from the second one, which is why it is i2 instead. I'm not sure whether this is necessary or not, haha
Rex Schrader
@SaintPeter
Sep 22 2015 21:18
@fractal-mind It would not - but you can define them in the function scope and they're avalilbe anywhere in the funciton.
@fractal-mind ok, 90% sure that your base is breaking everything. I think what is happening is that you're overwriting arr1 in your local scope
Will Moody
@willmoody
Sep 22 2015 21:20
@SaintPeter currently removing it, haha, will get back to you with results
Rex Schrader
@SaintPeter
Sep 22 2015 21:22
@fractal-mind found a logic error:
if (arr2.indexOf(base.arr2[i2]) === -1)
@fractal-mind in your second loop, you're looking for arr2 inside arr2, not arr1
@fractal-mind Your code, cleaned:
https://repl.it/BKFl
Will Moody
@willmoody
Sep 22 2015 21:23
@SaintPeter That was it, haha
This is what I get for copy pasting!
Rex Schrader
@SaintPeter
Sep 22 2015 21:23
@fractal-mind LOL, copy paste bugs are the WORST.
I make them all the time, too.
Will Moody
@willmoody
Sep 22 2015 21:24
I have only myself to blame, haha
@SaintPeter Thanks so much for your help! I don't think I can give you more brownie points, but you sure deserve them.
CamperBot
@camperbot
Sep 22 2015 21:24
fractal-mind sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: fractal-mind already gave saintpeter points
Rex Schrader
@SaintPeter
Sep 22 2015 21:25
@fractal-mind I keep telling them that they need "super brownies" or something ;)
Will Moody
@willmoody
Sep 22 2015 21:25
@SaintPeter Hey, you start the petition, I'll sign it
Rex Schrader
@SaintPeter
Sep 22 2015 21:25
@fractal-mind Anyway, no problem, I enjoy this stuff. Glad we could track down your problem.
"Helping is it's own reward"
Will Moody
@willmoody
Sep 22 2015 21:25
Now I am off to look into this intriguing repl.it business
Rex Schrader
@SaintPeter
Sep 22 2015 21:25
Seriously, I learn stuff every day helping folks out.
@fractal-mind oh, yeah, super helpful site - I used it to develop all my bonfires
CamperBot
@camperbot
Sep 22 2015 21:26
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Ben84
@Ben84
Sep 22 2015 21:26
Hi, I'm new to Code Camp and was just wondering where I could my code editor for the Waypoint: Import a Google Font challenge.
Rex Schrader
@SaintPeter
Sep 22 2015 21:26
@Ben84 I tihnk you're missing a word
"where I could my code editor for the "
Ben84
@Ben84
Sep 22 2015 21:26
Yeah my bad I'm eating
where I could find my code editor
Rex Schrader
@SaintPeter
Sep 22 2015 21:27
@Ben84 The "Code Editor" is the black area to the right of the instructions that has all your code in it.
@Ben84 just paste the provided code at the very top of the editor window and then you can add a reference to the lobster font in the style section
Ben84
@Ben84
Sep 22 2015 21:30
Thanks for the help @SaintPeter
CamperBot
@camperbot
Sep 22 2015 21:30
ben84 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 690 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 22 2015 21:30
NP
William French
@bob9867
Sep 22 2015 22:59
where are some good resources to learn the fundamentals?
William French
@bob9867
Sep 22 2015 23:01
thanks @wico216 but it seems like more of a reference than tutorial or school.
CamperBot
@camperbot
Sep 22 2015 23:01
bob9867 sends brownie points to @wico216 :sparkles: :thumbsup: :sparkles:
:star: 19 | @wico216 | http://www.freecodecamp.com/wico216
Roberto Galindo
@galinro
Sep 22 2015 23:05
@bob9867 Lynda.com is great. It's a premium service, but they'll give you a 7 day free trial. Microsoftvirtualacademy.com covers html, CSS, angular, and it's free.
Wiko
@wico216
Sep 22 2015 23:06
@bob9867 i used codeacademy and codeschool for the fundamentals, personally I like codeschool videos but it isn't free
Rafael J. Rodriguez
@Rafase282
Sep 22 2015 23:07

Now all bonfires have hints and solutions on the official wiki, enjoy campers!

William French
@bob9867
Sep 22 2015 23:08
are there any books that might be helpful @wico216
Wiko
@wico216
Sep 22 2015 23:10
@bob9867 Haven't used a book to be honest but a friend of mine loves this book and highly recommends it: http://www.amazon.com/dp/1118531647/ref=cm_sw_r_tw_dp_C-Dawb0K8B6YZ
they have another version for html and css too
William French
@bob9867
Sep 22 2015 23:15
thanks @wico216 I read a couple of days ago that this book is good for visual learners so I might try it out.
CamperBot
@camperbot
Sep 22 2015 23:15
bob9867 sends brownie points to @wico216 :sparkles: :thumbsup: :sparkles:
:warning: bob9867 already gave wico216 points
Wiko
@wico216
Sep 22 2015 23:18
@bob9867 check this bundle out http://www.amazon.com/dp/1119038634/ref=cm_sw_r_tw_dp_2fEawb156XSV4 , I'm going to pick them up too, the reviews on amazon are really good
@bob9867 for what i read, pick them up hardcover if you can
Will Moody
@willmoody
Sep 22 2015 23:19
Guys, I'm confused. Why does my log return undefined in a situation like this?
function convert(num) {
 (function(num)
   {
     console.log(num);
   }
 )();
}

convert(36);
I thought maybe it was the fault of making it an IIFE, but it does the same thing if I declare the function as a var and then invoke it.
Phillip Kneeland
@pkneeland78
Sep 22 2015 23:21

Hello @SaintPeter I'm stuck on the same issue as ben84 was. I pasted the link at the top of the page, but where am I going wrong with my reference.

<h2 font-family="Lobster">CatPhotoApp</h2>
Can you assist me, please?

Wiko
@wico216
Sep 22 2015 23:24
@pkneeland78
font-family: Lobster;
that would be inside style
Phillip Kneeland
@pkneeland78
Sep 22 2015 23:27
Awesome, thanks bro! How do I send a Brownie point for that?
CamperBot
@camperbot
Sep 22 2015 23:27
if you want to thank someone, put an @ before their name!
Phillip Kneeland
@pkneeland78
Sep 22 2015 23:27
thanks @wico216
CamperBot
@camperbot
Sep 22 2015 23:27
pkneeland78 sends brownie points to @wico216 :sparkles: :thumbsup: :sparkles:
:star: 20 | @wico216 | http://www.freecodecamp.com/wico216
Phillip Kneeland
@pkneeland78
Sep 22 2015 23:27
there we go!
Wiko
@wico216
Sep 22 2015 23:27
@pkneeland78 thanks and np
CamperBot
@camperbot
Sep 22 2015 23:27
wico216 sends brownie points to @pkneeland78 :sparkles: :thumbsup: :sparkles:
:star: 16 | @pkneeland78 | http://www.freecodecamp.com/pkneeland78
Michael Green
@MichaelGreenNZ
Sep 22 2015 23:32
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.


// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
Huh? What the heck am I supposed to be doing?
Boris
@boris-in-london
Sep 22 2015 23:33
@MichaelGreenNZ you've got to add a property name called an 'engine' to your object instance myCar
if you look at the example of 'this.wheels = 4;'
Will Moody
@willmoody
Sep 22 2015 23:34
@MichaelGreenNZ this.wheels is a property on your Car function
Michael Green
@MichaelGreenNZ
Sep 22 2015 23:34
@boris-in-london @fractal-mind Thanks, I’ll go back and look at it.
CamperBot
@camperbot
Sep 22 2015 23:34
michaelgreennz sends brownie points to @boris-in-london and @fractal-mind :sparkles: :thumbsup: :sparkles:
:star: 175 | @boris-in-london | http://www.freecodecamp.com/boris-in-london
:star: 223 | @fractal-mind | http://www.freecodecamp.com/fractal-mind
Jelani Thompson
@JelaniThompson
Sep 22 2015 23:41
Hey guys, anyone here handy with CSS?
azazel913
@azazel913
Sep 22 2015 23:45

<style>
body {
background-color: black;
font-family: Monospace;
color: green;
}
.pink-text {
color: pink;
}
</style>[

<h1 class="pink-text">Hello World!</h1> need to add .blue-text{color:blue;} to h1 element and keep the pink one how must I do that cant figure it out

Mateja Trifunovski
@Matko95
Sep 22 2015 23:46
@JelaniThompson what's up?
azazel913
@azazel913
Sep 22 2015 23:46
can any one help
Mateja Trifunovski
@Matko95
Sep 22 2015 23:46
@azazel913 what's the waypoint?
Matt Anderson
@MDAWebDev
Sep 22 2015 23:46

I'm stuck on part 4 of the NPM tutorial. I keep getting an error here:

npm helps you build projects, but for npm to be able to do that, you need
to tell npm a little bit about your project. You can tell npm about your
project in a file called package.json.

Run npm init --scope=<username>, and replace <username> with the user
you created in the last lesson. This will create a package.json file.
(For extra credit, set the project up with a git repo as well.)

Run how-to-npm verify once you're done.
mdawebdev@free-code-camp-npm:~/workspace $ npm init --scope=<mdawebdev>
bash: syntax error near unexpected token newline' mdawebdev@free-code-camp-npm:~/workspace $ npm init --scope=<mdawebdev> bash: syntax error near unexpected tokennewline'
mdawebdev@free-code-camp-npm:~/workspace $ npm init --scope=<mdawebdev>

azazel913
@azazel913
Sep 22 2015 23:47
@Matko95 Waypoint: Override Styles in Subsequent CSS
Jelani Thompson
@JelaniThompson
Sep 22 2015 23:47
I was just wondering why the HTML5, JS and CSS3 buttons aren't being centered even thought I'm using margin-left: auto; margin-right: auto; and display: block; http://codepen.io/Jelani/pen/jbboQE?editors=110
It seemed to work with the social buttons
But not the ones for the programming languages, haha
Mateja Trifunovski
@Matko95
Sep 22 2015 23:48
@azazel913 so make another style called .blue-text{color:blue;} below your red text and then just add it as "pink-text blue-text"
@JelaniThompson gonna take a look, btw. love your animations on the social media buttons :)
azazel913
@azazel913
Sep 22 2015 23:48
o okay try everything but the "pink-text blue-text"
Jelani Thompson
@JelaniThompson
Sep 22 2015 23:49
@Matko95 Oh, thanks :D
CamperBot
@camperbot
Sep 22 2015 23:49
jelanithompson sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 349 | @matko95 | http://www.freecodecamp.com/matko95
azazel913
@azazel913
Sep 22 2015 23:52
@Matko95 I did what you said but it want h1 to be blue and its not
Matt Anderson
@MDAWebDev
Sep 22 2015 23:52
Figured it out, had to delete the < > around the username. I always read these tutorials too literally.
azazel913
@azazel913
Sep 22 2015 23:53
@Matko95 so what do I need to fix
Mateja Trifunovski
@Matko95
Sep 22 2015 23:53
@azazel913 could you post the full code?