These are chat archives for FreeCodeCamp/Help

13th
Sep 2015
Nathan Wind
@Nathan-Wind
Sep 13 2015 00:00
so first time it sucessfully wrote
but I can't see the screen to see if all the green checkmarks are cleared
Mateja Trifunovski
@Matko95
Sep 13 2015 00:00
@Nathan-Wind add another "}" after your else statement
Nathan Wind
@Nathan-Wind
Sep 13 2015 00:01
didn't work still same error
Rory Smith
@alanbuchanan
Sep 13 2015 00:01
it's not just that
Nathan Wind
@Nathan-Wind
Sep 13 2015 00:01
@alanbuchanan what you find?
Rory Smith
@alanbuchanan
Sep 13 2015 00:02
your method calls are in {} but they shouldn't be
Mateja Trifunovski
@Matko95
Sep 13 2015 00:02
true
Rory Smith
@alanbuchanan
Sep 13 2015 00:03
@Nathan-Wind if you put your closing } on the same line as other code it can be seriously confusing to read
Nathan Wind
@Nathan-Wind
Sep 13 2015 00:04
wait I'm getting fuzzy on ther method call terminology... where are you talking about?
oh the palindromes calls
Rory Smith
@alanbuchanan
Sep 13 2015 00:04
{
palindrome('"eye"')
palindrome('"not a palindrome"')
palindrome('"Nope"')
palindrome('"almostomla"')
palindrome('"1 eye for 1 eye"')}
}
Nathan Wind
@Nathan-Wind
Sep 13 2015 00:04
ok one sec
Rory Smith
@alanbuchanan
Sep 13 2015 00:05

whenever your write a function, start it like this

function something(){

}

and then by default you will never miss a closing bracket, and it's nice and neat. also, make sure you indent your code properly

Binny Kim
@removed~BinnyK
Sep 13 2015 00:06
Hey guys I'm having trouble passing the final test of this bonfire... Everything seems to be meeting the test conditions, but not sure why the last one isn't passing. I can't seem to get any more information either

function drawer(price, cash, cid) {

  var diff = cash - price;
  var cidArr = [];
  var totalChange = 0;

  var coinWorth = [
    100,
    20,
    10,
    5,
    1,
    0.25,
    0.10,
    0.05,
    0.01
  ];
  var resultArr = [
    ['ONE HUNDRED', 0],
    ['TWENTY', 0],  
    ['TEN', 0],
    ['FIVE', 0],
    ['ONE', 0],    
    ['QUARTER', 0],
    ['DIME', 0],
    ['NICKEL', 0],
    ['PENNY', 0]
  ];

  // push arrays into cidArr;
  for (var i = cid.length -1; i >= 0; i--) {
    cidArr.push(cid[i][1]);
    totalChange += cid[i][1];
  };
  console.log(totalChange);
  console.log(cidArr);

  // conditions for insufficient funds and closed.
  if (diff > totalChange) return "Insufficient Funds"
  else if (totalChange === diff) return "Closed"

  // Loop each element of coinWorth Array.
  for (var i = 0; i < coinWorth.length; i++) {

    // WHILE coinWorth[i] is smaller or equal to change given (diff),
    while (coinWorth[i] <= diff) {

      // deduct coinWorth[i] from change.
      diff = diff - coinWorth[i];

      // add value to the resultArr corresponding currency value
      resultArr[i][1] += (coinWorth[i]);

    };  
  };

  // before returning the resultArr... sift through to make sure each value is > 0. If so push to another result array.

  //final result var
  var result = [];

  // for each element in resultArr, check it has a value of > 0. If so push to result arr.
  for (var i in resultArr) {

    if (resultArr[i][1] > 0) {

      result.push(resultArr[i]);

    };
  };

  return result;

}


drawer(3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);
any chance someone can copy paste that code into their bonfire and check? sorry for the wall of text
Nathan Wind
@Nathan-Wind
Sep 13 2015 00:07
ok this is what I have now

function palindrome(str) {
/ remove special characters, spaces and make lowercase/
var removeChar = str.replace(/[^A-Z0-9]/ig, "").toLowerCase();
/ reverse removeChar for comparison/
var checkPalindrome = removeChar.split('').reverse().join('');}

if (removeChar === checkPalindrome)
{
return true;}

else {
return false;}
}

palindrome('"eye"')
palindrome('"not a palindrome"')
palindrome('"Nope"')
palindrome('"almostomla"')
palindrome('"1 eye for 1 eye"')

sorry looks like the indents aren;t popping up when I paste
Mateja Trifunovski
@Matko95
Sep 13 2015 00:07
explain formatting
CamperBot
@camperbot
Sep 13 2015 00:07

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Mateja Trifunovski
@Matko95
Sep 13 2015 00:08
@Nathan-Wind could you format the code like it was explained above?
@Nathan-Wind i see that in this line var checkPalindrome = removeChar.split('').reverse().join('');} you have a "}" at the end, remove it
Nathan Wind
@Nathan-Wind
Sep 13 2015 00:09
YES! GREAT SUCCESS
thanks for the code past info @Matko95
CamperBot
@camperbot
Sep 13 2015 00:10
nathan-wind sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 263 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Sep 13 2015 00:11
Np :) you could thank alan aswell
CamperBot
@camperbot
Sep 13 2015 00:11
if you want to thank someone, put an @ before their name!
Nathan Wind
@Nathan-Wind
Sep 13 2015 00:11
Yes thanks @alanbuchanan
CamperBot
@camperbot
Sep 13 2015 00:11
nathan-wind sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 331 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Binny Kim
@removed~BinnyK
Sep 13 2015 00:12
Hey guys just wondering if you can have a quick look at the code i posted above ?
Rory Smith
@alanbuchanan
Sep 13 2015 00:15
@BinnyK can you link the bonfire please?
Nathan Wind
@Nathan-Wind
Sep 13 2015 00:15
last thing gents... @Matko95 @alanbuchanan so previously I wrote instead of just returned but now when i look at my other browser I still can't see my screen since it wrote to the screen... even after I did the exercise on my other browser
Mateja Trifunovski
@Matko95
Sep 13 2015 00:15
@BinnyK Didn't do that one, but could take a look
Mateja Trifunovski
@Matko95
Sep 13 2015 00:16
@Nathan-Wind you could use console.log(); for testing purposes
Nathan Wind
@Nathan-Wind
Sep 13 2015 00:16
yes but right now I can't see the screen when I'm in my first browser I can;t change anything @Matko95
Binny Kim
@removed~BinnyK
Sep 13 2015 00:16
@alanbuchanan @Matko95 Its the test number 5 that seems to be the issue. Yeah Ive been using console log throughout, but been deleting after things start working
hm
Nathan Wind
@Nathan-Wind
Sep 13 2015 00:17
@Matko95 it shows free code camp for like split second then writes to the screen
Rory Smith
@alanbuchanan
Sep 13 2015 00:17
Screen Shot 2015-09-13 at 01.17.21.png
@BinnyK two problems there
@BinnyK
  • shouldn't push 0 values to the result
  • there isn't $80 in 20 dollar bills in the register
Binny Kim
@removed~BinnyK
Sep 13 2015 00:19
@alanbuchanan thanks i'll look into that. How are you able to look at those results? whenever i console log them it gives me arrays i cant seem to access?
CamperBot
@camperbot
Sep 13 2015 00:19
binnyk sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 332 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Rory Smith
@alanbuchanan
Sep 13 2015 00:19
Screen Shot 2015-09-13 at 01.19.12.png
you might wanna look at that as well!
@BinnyK if you use a debugging tool you can see values change line by line. it's like console logging every line as it changes
Binny Kim
@removed~BinnyK
Sep 13 2015 00:21
@alanbuchanan oh... what debugging tool is that you're using? is there an extension to chrome or anythin?
thanks amazing
CamperBot
@camperbot
Sep 13 2015 00:21
if you want to thank someone, put an @ before their name!
Rory Smith
@alanbuchanan
Sep 13 2015 00:21
@BinnyK i use google dev tools debugger. your algorithm is better than mine for that solution but just has an issue or two
Binny Kim
@removed~BinnyK
Sep 13 2015 00:21
thats*
@alanbuchanan I've been stuck on this thing for a while.. been avoiding it like the plague. Do I need to install the dev tools?
jonocosa
@jonocosa
Sep 13 2015 00:23

```function findLongestWord(str) {

var strArray = str.split(' ');
str=''

for( i=0; i<=strArray.length; i++){

if (str<=strArray[i]){
  str=strArray[i]
}

}

return str;
}

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

Aniruddh Agarwal
@anrddh
Sep 13 2015 00:23
@BinnyK It's pre-installed on Chrome
Press F12
jonocosa
@jonocosa
Sep 13 2015 00:25
does anyone know wy my longest number not work ?
Rory Smith
@alanbuchanan
Sep 13 2015 00:25
or alt + super + i on a mac, i believe
Aniruddh Agarwal
@anrddh
Sep 13 2015 00:25
that's because you are not accounting for sentences @jonocosa
Binny Kim
@removed~BinnyK
Sep 13 2015 00:25
and do u paste in the code u want to analyse?
Aniruddh Agarwal
@anrddh
Sep 13 2015 00:26
is it not working for the last two tests only?
jonocosa
@jonocosa
Sep 13 2015 00:28
hmm I dont get it @awesomeaniruddh I think I am looping through all the word in the sentence
Aniruddh Agarwal
@anrddh
Sep 13 2015 00:28
@jonocosa you are looping through all the characters
Not the words
There's a subtle difference
Rory Smith
@alanbuchanan
Sep 13 2015 00:29
@BinnyK
  • you open a .js file or html linked to js in chrome
  • dev tools > sources
  • make sure you have your js code in front of you
  • set a breakpoint by clicking a line number on a function call
  • refresh page
  • use arrows on right hand side (or f11) to go through line by line
Aniruddh Agarwal
@anrddh
Sep 13 2015 00:29
Oh wait, sorry
Shit, which bf is this?
jonocosa
@jonocosa
Sep 13 2015 00:29
oh I get it !!! thanks @awesomeaniruddh
CamperBot
@camperbot
Sep 13 2015 00:29
jonocosa sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 419 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Aniruddh Agarwal
@anrddh
Sep 13 2015 00:29
I was thinking of another one
Rory Smith
@alanbuchanan
Sep 13 2015 00:29
@awesomeaniruddh and somehow you still gave good advice. bravo :clap:
Aniruddh Agarwal
@anrddh
Sep 13 2015 00:30
nonono @jonocosa you are looping through words!
bf find longest word
CamperBot
@camperbot
Sep 13 2015 00:30
Sorry, can't find a bonfire called find longest word. [ Check the map? ]
Aniruddh Agarwal
@anrddh
Sep 13 2015 00:30
You have to return the length of the longest word
Not the longest word itself
Rory Smith
@alanbuchanan
Sep 13 2015 00:30
@jonocosa your looping mechanism is good, but you want to return the length of the longest word, as in, a number
Aniruddh Agarwal
@anrddh
Sep 13 2015 00:30
@jonocosa ^
Binny Kim
@removed~BinnyK
Sep 13 2015 00:31
@alanbuchanan ok thanks for that! will def have a look at the debugging... Ive just been looking at the console + console.logging everything. I think that will be much more efficient.
CamperBot
@camperbot
Sep 13 2015 00:31
binnyk sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:warning: binnyk already gave alanbuchanan points
a1rr0wh3ad
@a1rr0wh3ad
Sep 13 2015 00:32
@jonocosa also, you should also be comparing the lengths instead of this str<=strArray[i]
Rory Smith
@alanbuchanan
Sep 13 2015 00:32
@BinnyK no worries. after i started using it i never used console log again (at least for my own projects) :)
jonocosa
@jonocosa
Sep 13 2015 00:33
I have done that by changing the last line from "return str" to return str.length but I still dont pass all the test
Binny Kim
@removed~BinnyK
Sep 13 2015 00:33
@alanbuchanan ah thats insanely awesome.
Mateja Trifunovski
@Matko95
Sep 13 2015 00:35
@jonocosa "2"<"3" doesn't actually return true, you need the str.length <=strArray[i].length
Rory Smith
@alanbuchanan
Sep 13 2015 00:35
@BinnyK sorry, not quite true, i still need console logging for using callback functions cos it works differently
Binny Kim
@removed~BinnyK
Sep 13 2015 00:36
@alanbuchanan haha no worries. Its definitely gonna help me out with all of these tricky algorithms + projects
Rory Smith
@alanbuchanan
Sep 13 2015 00:36
@awesomeaniruddh are you using ES6 much? and have you finished the map?
jonocosa
@jonocosa
Sep 13 2015 00:37
wen I do that @Matko95 I get "Cannot read property 'length' of undefined " error
Mateja Trifunovski
@Matko95
Sep 13 2015 00:38
@jonocosa can you post your code again?
Nathan Wind
@Nathan-Wind
Sep 13 2015 00:38

```js function palindrome(str) {
/ remove special characters, spaces and make lowercase/
var removeChar = str.replace(/[^A-Z0-9]/ig, "").toLowerCase();
/ reverse removeChar for comparison/
var checkPalindrome = removeChar.split('').reverse().join('');

if (removeChar === checkPalindrome)
{
return true;}

else {
return false;}
}

palindrome('"eye"')
palindrome('"not a palindrome"')
palindrome('"Nope"')
palindrome('"almostomla"')
palindrome('"1 eye for 1 eye"')

ignore the second one...
jonocosa
@jonocosa
Sep 13 2015 00:38

`function findLongestWord(str) {

var strArray = str.split(' ');

for( i=0; i<=strArray.length; i++){

if (strArray[i].length<=strArray[i+1].length){
  str=strArray[i]
}

}

return str.length;
}

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

dam the formating is not working but hir you have it @Matko95 thanks for the help :)
CamperBot
@camperbot
Sep 13 2015 00:39
jonocosa sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 264 | @matko95 | http://www.freecodecamp.com/matko95
wontoan
@wontoan
Sep 13 2015 00:41
@jonocosa strArray[i+1].length will return undefined at the last index
Mateja Trifunovski
@Matko95
Sep 13 2015 00:41
@jonocosa i<=strArray.length should be i<strArray.length if i'm not wrong
Batman
@complexsion
Sep 13 2015 00:41

var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
function myFunction(){
// Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".

// Only change code below this line.

// Only change code above this line.
}

// We use this function to show you the value of your variable in your output box.
var result = myFunction();if(typeof(flip) !== "undefined" && typeof(flip) === "number" && typeof(result) !== "undefined" && typeof(result) === "string"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}
Doesn't explain enough to a beginner to be able to figure this out and nothing on google that I could find that would help me enough to figure it out.

Mateja Trifunovski
@Matko95
Sep 13 2015 00:42
@complexsion what's wrong
Batman
@complexsion
Sep 13 2015 00:43
Idk man I post what was explained for an if else but I guess I am giving it the wrong labels or something
wontoan
@wontoan
Sep 13 2015 00:43
@complexsion paste your if/else statement here
Batman
@complexsion
Sep 13 2015 00:44
if (flip ==0 ){
return true;
}
else{
return false;
}
wontoan
@wontoan
Sep 13 2015 00:44
change true and false
to heads and tails
Batman
@complexsion
Sep 13 2015 00:44
I know there isnt a heads or a tails to call it so there is something I am missing
ok that explains it I will give it a try
Mateja Trifunovski
@Matko95
Sep 13 2015 00:45
@complexsion and you should use === when comparing
@complexsion and make sure you put heads and tails inside ""
Batman
@complexsion
Sep 13 2015 00:47
@wontoan & @Matko95 thank you that helped. Just don't know enough about javascript to know when something is wrong
CamperBot
@camperbot
Sep 13 2015 00:47
complexsion sends brownie points to @wontoan and @matko95 :sparkles: :thumbsup: :sparkles:
:star: 304 | @wontoan | http://www.freecodecamp.com/wontoan
:star: 265 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Sep 13 2015 00:48
@complexsion you might want to check out a quick course on codecademy for javascript or something, to pick up some basics
Batman
@complexsion
Sep 13 2015 00:49
@Matko95 then what is the point of these course on here? Or do we have to research all over the internet instead of a one stop learning shop?
Mateja Trifunovski
@Matko95
Sep 13 2015 00:51
@complexsion No source in programming is a one stop learning shop my friend :)
Batman
@complexsion
Sep 13 2015 00:52
Thats too bad, it seems like it would be a smart thing to do.
Rory Smith
@alanbuchanan
Sep 13 2015 00:53
what's wrong with researching things?
Mateja Trifunovski
@Matko95
Sep 13 2015 00:53
True, but the idea here is to learn through projects and examples, picking up knowledge from the chatroom,MDN and other sources
Batman
@complexsion
Sep 13 2015 00:55
I find that researching different things especially since I have started learning coding, you go to one site, it has certain types of form and tricks in which it does it. Then go to another site, and they say that way is wrong and their way is better. Which causes confusion and frustration
There is nothing wrong with research when the research is exact, but when its conflicting it turns to confusion. For the beginner
Mateja Trifunovski
@Matko95
Sep 13 2015 00:56
Listen to yourself, there are many opinions in programming, if something suits you, go with it
Rory Smith
@alanbuchanan
Sep 13 2015 00:57
well, javascript has official documentation, so if someone is saying to do something wrongly, you can refer them accordingly
jonocosa
@jonocosa
Sep 13 2015 00:57

function findLongestWord(str) {
var strArray = str.split(' ');

for( i=0; i<=strArray.length; i++){

if( strArray[i]>=strArray[i+1] ){
  str=strArray[i];
}

}

return str.length;;
}

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

@Matko95 the code works without any errors but I don't get the right values to past the test :/
insted of the value 6 I get the val 4
DJ
@qualitymanifest
Sep 13 2015 00:59
@jonocosa that's because you're only comparing the current value with the next value
"lazy" is greater than "dog"
jonocosa
@jonocosa
Sep 13 2015 01:00
I see
Jimmy
@Nerdherdx
Sep 13 2015 01:01
I keep getting errors..the output isn't changing
using firefox
jonocosa
@jonocosa
Sep 13 2015 01:02
@qualitymanifest so basicly I have to keep one value and compare it to the rest and change it wen I find a bigger one ?
Jimmy
@Nerdherdx
Sep 13 2015 01:03
"resetting on fatal plugin error"
Mateja Trifunovski
@Matko95
Sep 13 2015 01:03
@jonocosa there are several things wrong

@jonocosa

function findLongestWord(str) {
var strArray = str.split(' ');
str=strArray[0]
for( i=1; i<strArray.length; i++){
if( str.length<=strArray[i].length ){
  str=strArray[i];
}
}
return str.length;
}
findLongestWord('The quick brown fox jumped over the lazy dog');

I tried modifying it, and hope you understand why

jonocosa
@jonocosa
Sep 13 2015 01:04
ok I will have to figure it out tomorrow its late here in Portugal thanks for the help campers!
CamperBot
@camperbot
Sep 13 2015 01:04
if you want to thank someone, put an @ before their name!
Binny Kim
@removed~BinnyK
Sep 13 2015 01:06
@alanbuchanan hey alan sent u a PM regarding the bonfire I was on earlier. Just wondering if you can take another quick look? super confused
gentianNYC
@gentianNYC
Sep 13 2015 01:13
i need some help please.
<style> .larger-image { width: 500px; } </style>
how do i make a copy of the image of my exercise?
SojournerOctocat
@SojournerOctocat
Sep 13 2015 01:14
Which exercise are you working on? What's the link?
@gentianNYC
SojournerOctocat
@SojournerOctocat
Sep 13 2015 01:17

@gentianNYC The instructions say to use a smaller image class, as in

  .smaller-image {
    width: 100px; 
  }

which should be in your style section.

Then, in the body, <img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat">
gentianNYC
@gentianNYC
Sep 13 2015 01:18
@SojournerOctocat :smile: thx so much man
CamperBot
@camperbot
Sep 13 2015 01:18
gentiannyc sends brownie points to @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:star: 283 | @sojourneroctocat | http://www.freecodecamp.com/sojourneroctocat
raouftiliouine
@raouftiliouine
Sep 13 2015 01:21
Hey everyone.
I was wondering how to convert second to HR:MIN:SEC format
Mateja Trifunovski
@Matko95
Sep 13 2015 01:22
@raouftiliouine try using some math :)
@raouftiliouine start from seconds, then work your way to the bottom
raouftiliouine
@raouftiliouine
Sep 13 2015 01:24
weirdly enough, I didn't think about that (I only think of libraries that do stuff for you). thanks
CamperBot
@camperbot
Sep 13 2015 01:24
if you want to thank someone, put an @ before their name!
Aniruddh Agarwal
@anrddh
Sep 13 2015 01:29
@alanbuchanan finished the map. Not using ES6 so much, but FCC supports it!
Rory Smith
@alanbuchanan
Sep 13 2015 01:30
@awesomeaniruddh since when?!
@awesomeaniruddh nice for finishing the map, are you onto non-profits?
Aniruddh Agarwal
@anrddh
Sep 13 2015 01:30
Not sure since when, but I recently QAed a PR for BerkelyTrue, and that had Babel!
'Applied' for a non-profit, still waiting for response :)
Mateja Trifunovski
@Matko95
Sep 13 2015 01:33
Good to hear :)
Rory Smith
@alanbuchanan
Sep 13 2015 01:33
awesome :stuck_out_tongue:
Mateja Trifunovski
@Matko95
Sep 13 2015 01:37
function find(arr, func) {
  for(var i=0;i<arr.length;i++)
    {
      console.log(func(8))
      if(func(arr[i])===true)
        {
          return arr[i];
          break;
        }
      else 
        {
          return undefined;
        }
    }

  //return arr.some(func);
}

find([1, 2, 3, 4], function(num){ return num % 2 === 0; });
Why doesn't it enter the if statement even if console .log displays true, the bonfire is Finders Keepers
Figured it out, nvm :)
Rory Smith
@alanbuchanan
Sep 13 2015 01:39
@Matko95 is it because you were testing the number 8?
Mateja Trifunovski
@Matko95
Sep 13 2015 01:40
@alanbuchanan when i removed the returns from the loop, and stored the value in num, then returned it, then it worked
and removed the else afterwards since it does nothing
Rory Smith
@alanbuchanan
Sep 13 2015 01:40
@Matko95 i see
Mateja Trifunovski
@Matko95
Sep 13 2015 01:43
funny how the next bonfire is the same..
DavidThms
@DavidThms
Sep 13 2015 01:49
Bonfire: Check for Palindromes
CamperBot
@camperbot
Sep 13 2015 01:49

:fire:Bonfire: Check for Palindromes :link:

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



palindrome("eye");

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

more info:  bf details | bf links | hint

DavidThms
@DavidThms
Sep 13 2015 01:49
hint
CamperBot
@camperbot
Sep 13 2015 01:49
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Mateja Trifunovski
@Matko95
Sep 13 2015 01:49
bonfire steamroller
CamperBot
@camperbot
Sep 13 2015 01:49

:fire:Bonfire: Steamroller :link:

function steamroller(arr) {
  // I'm a steamroller, baby
  return arr;
}

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

Flatten a nested array. You must account for varying levels of nesting.

more info:  bf details | bf links | hint

Mateja Trifunovski
@Matko95
Sep 13 2015 01:49
hint
CamperBot
@camperbot
Sep 13 2015 01:49
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Mateja Trifunovski
@Matko95
Sep 13 2015 01:50
damn, the hint contains a solution
could anyone push me in some direction for Bonfire: Steamroller
javathehut
@javathehut
Sep 13 2015 01:50

Hi everyone! I've just started working through the HTML5 and CSS waypoints and I'm stuck. I'm on waypoint: size your images. What I've done just won't take and I'm not sure why. Can anyone help?

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

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}
.smaller-image {
width: 100px;
}
</style>

Oh nvm I saw help further up!!
gentianNYC
@gentianNYC
Sep 13 2015 02:00

<style>
.red-text {
color: red;
}
.thick-green-border {
border-color: green; border-width: 10px; border-style: solid;
}

.smaller-image {
width: 100px;
}

h2 {
font-family: Lobster, Monospace;
}

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

</style>

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

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

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

Waypoint: Add Borders Around your Elements
Luis Felipe López G.
@luishendrix92
Sep 13 2015 02:00
This message was deleted
CamperBot
@camperbot
Sep 13 2015 02:00
no wiki entry for: js format
:pencil: click here to create one now!after creating your page type update to reload it here
Luis Felipe López G.
@luishendrix92
Sep 13 2015 02:00
wiki format
CamperBot
@camperbot
Sep 13 2015 02:00

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

gentianNYC
@gentianNYC
Sep 13 2015 02:02
what
im doing wrong guys?
DJ
@qualitymanifest
Sep 13 2015 02:03
@gentianNYC you need to copy and paste your code. that link doesn't let us see what you did.
Mateja Trifunovski
@Matko95
Sep 13 2015 02:03
@gentianNYC can you copy the code where you added the class
that's where usually people mess up
DJ
@qualitymanifest
Sep 13 2015 02:04
see above for how to format it
Todd Loiselle
@loiselt1
Sep 13 2015 02:09

Hey all, new to this and trying to go through the HTML5 & CSS lesson, and I'm stuck on "Waypoint: Add borders around your elements". I'm doing exactly what it's telling me and I can't get it to accept my work and move on. The class I've written is:

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

And the element I've written is:

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

I don't know what I'm doing wrong. Can anyone help point me in the correct direction? Thanks in advance!

CamperBot
@camperbot
Sep 13 2015 02:09
if you want to thank someone, put an @ before their name!
Mateja Trifunovski
@Matko95
Sep 13 2015 02:10
@loiselt1 class="smaller-image thick-green border" multiple classes are added like this, with a space
Todd Loiselle
@loiselt1
Sep 13 2015 02:11
@Matko95 that did it, thank you for the help
CamperBot
@camperbot
Sep 13 2015 02:11
loiselt1 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 269 | @matko95 | http://www.freecodecamp.com/matko95
JeremyWBean
@JeremyWBean
Sep 13 2015 02:36
If you guys have a sec, throw some criticism at my Calculator app. Thanks in advance! http://codepen.io/JeremyWBean/full/ojjQNM
CamperBot
@camperbot
Sep 13 2015 02:36
if you want to thank someone, put an @ before their name!
Stefan Stokic
@StefanStokic
Sep 13 2015 02:44
Hi guys..Am stuck on Waypoint: Make Object Properties Private
The method getSpeed of myBike should be accessible outside the object..can't get that to work
Chocobowings
@chocobowings
Sep 13 2015 02:45
@JeremyWBean It looks good ! .
The only thing that you are missing is the CE button :)
Risle
@Risle
Sep 13 2015 02:46
@JeremyWBean It failed to break when I tried it. Works great! I haven't got there yet so I don't know the reqs, but it would be nice if the individual operand buttons had a display change like the number buttons (not just the overall graying out). But good work.
Aniruddha Barapatre
@aniruddhabarapatre
Sep 13 2015 02:48
@KingInTheNorth How do you make any property or function accessible outside the object? Hint: using this
Stefan Stokic
@StefanStokic
Sep 13 2015 02:49
@aniruddhabarapatre Going to reset editor and try again. Thanks.
CamperBot
@camperbot
Sep 13 2015 02:49
kinginthenorth sends brownie points to @aniruddhabarapatre :sparkles: :thumbsup: :sparkles:
:star: 153 | @aniruddhabarapatre | http://www.freecodecamp.com/aniruddhabarapatre
steven
@hungrysteven
Sep 13 2015 02:50
blob
blob
blob

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

.smaller-image {
width: 100px;
}
.green-background {
background-color: green;
}


</style>

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

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

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

<div class="green-background" >
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>

<form action="/submit-cat-photo" id="cat-photo-form" >

<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>

Give your form element the id of cat-photo-form.
Your form element should have the background-color of green.
Make sure your form element has an id attribute.
Do not give your form any class or style attributes.
if i give it "Your form element should have the background-color of green." it says "Do not give your form any class or style attributes." fails
how do i give it a background color with out it being in the form?
Chocobowings
@chocobowings
Sep 13 2015 02:52
@hungrysteven use the ID that you gave it before to style it
steven
@hungrysteven
Sep 13 2015 02:53
.green-background
Chocobowings
@chocobowings
Sep 13 2015 02:53
@hungrysteven
#yourID { 
    background-color: somecolor;
}
JeremyWBean
@JeremyWBean
Sep 13 2015 02:54
@Risle Making that change now. Thanks!
CamperBot
@camperbot
Sep 13 2015 02:54
jeremywbean sends brownie points to @risle :sparkles: :thumbsup: :sparkles:
:star: 178 | @risle | http://www.freecodecamp.com/risle
JeremyWBean
@JeremyWBean
Sep 13 2015 02:54
@chocobowings I guess I need to add that in. Thanks!
CamperBot
@camperbot
Sep 13 2015 02:54
jeremywbean sends brownie points to @chocobowings :sparkles: :thumbsup: :sparkles:
:star: 281 | @chocobowings | http://www.freecodecamp.com/chocobowings
Chocobowings
@chocobowings
Sep 13 2015 02:54
@hungrysteven That's how you target an ID from css.
steven
@hungrysteven
Sep 13 2015 02:55
<form action="/submit-cat-photo" id="cat-photo-form" #cat-photo-form{background-color: green;} >
Chocobowings
@chocobowings
Sep 13 2015 02:56
@hungrysteven nope.
<form action="/submit-cat-photo" id="cat-photo-form" >
Aniruddha Barapatre
@aniruddhabarapatre
Sep 13 2015 02:56
@hungrysteven you should write css between <style> tags
steven
@hungrysteven
Sep 13 2015 02:56
ok
Chocobowings
@chocobowings
Sep 13 2015 02:56
now inside your style tags
#yourID { 
    background-color: somecolor;
}
steven
@hungrysteven
Sep 13 2015 02:57
uhhh hum
Aniruddha Barapatre
@aniruddhabarapatre
Sep 13 2015 02:57
@hungrysteven so something like how @chocobowings mentioned above. CSS should be separated from HTML to keep code readable and clean.
Chocobowings
@chocobowings
Sep 13 2015 02:57
@hungrysteven
<style>
#yourID { 
    background-color: somecolor;
}
</style>
Stefan Stokic
@StefanStokic
Sep 13 2015 02:58
This message was deleted
Chocobowings
@chocobowings
Sep 13 2015 02:58
@KingInTheNorth
//Let's create an object with a two functions. One attached as a property and one not.
var Car = function() {
this.gear = 1;
function addStyle(styleMe){
return 'The Current Gear Is: ' + styleMe;
}
this.getGear = function() {
return addStyle(this.gear);
};
};
var Bike = function() {
// Only change code below this line.
this.speed;
function addUnit(value) {
return value + "KM/H";
}
getSpeed = function () {
return addUnit(speed);
};
};
// Only change code above this line.
var myCar = new Car();
var myBike = new Bike();
if(myBike.hasOwnProperty('getSpeed')){(function() {return JSON.stringify(myBike.getSpeed());})();};
Aniruddha Barapatre
@aniruddhabarapatre
Sep 13 2015 02:58
@hungrysteven you already have <style> tags. Just add that remaining code in there
Stefan Stokic
@StefanStokic
Sep 13 2015 02:59
Thanks.. @chocobowings
CamperBot
@camperbot
Sep 13 2015 02:59
kinginthenorth sends brownie points to @chocobowings :sparkles: :thumbsup: :sparkles:
:star: 282 | @chocobowings | http://www.freecodecamp.com/chocobowings
Stefan Stokic
@StefanStokic
Sep 13 2015 02:59
So yeah, that code ^^ assert(typeof(myBike.getSpeed)!=='undefined' && typeof(myBike.getSpeed) === 'function', 'The method getSpeed of myBike should be accessible outside the object');The method getSpeed of myBike should be accessible outside the object
i really can't figure it out
steven
@hungrysteven
Sep 13 2015 02:59

<form action="/submit-cat-photo" id="cat-photo-form" >
<style>

#cat-photo-form {background-color: green;}

</style>

Chocobowings
@chocobowings
Sep 13 2015 03:00
@KingInTheNorth np
this.getSpeed
Aniruddha Barapatre
@aniruddhabarapatre
Sep 13 2015 03:00
@KingInTheNorth Ok, not a prob. So we need to make getSpeed accessible. This can be done by just adding this to it. so change to this.getSpeed
@hungrysteven Awesome. you got it.
Stefan Stokic
@StefanStokic
Sep 13 2015 03:01
@aniruddhabarapatre I do that, this.getSpeed, but I get Program Execution FailureNo user tests were run.
Aniruddha Barapatre
@aniruddhabarapatre
Sep 13 2015 03:02
@KingInTheNorth
var Bike = function() {
  // Only change code below this line.
  speed = 100;
  function addUnit(value) {
    return value + "KM/H";
  }

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

};
Stefan Stokic
@StefanStokic
Sep 13 2015 03:04
@aniruddhabarapatre That worked!! so did you make speed private?
Aniruddha Barapatre
@aniruddhabarapatre
Sep 13 2015 03:04
@KingInTheNorth Yes, as that was another requirement for test to pass. Always keep an eye on requirement too to see what they're checking for in some cases when you're stuck.
Also, the waypoint wanted speed to be inaccessible.
Jalita
@UsefulPixels
Sep 13 2015 03:10
Hi all, I'm a bit stuck with this waypoint where I try to add a border in my css...
Screen Shot 2015-09-13 at 11.10.44 am.png
I have added this to the style
Screen Shot 2015-09-13 at 11.10.44 am.png
Sorry wrong screenshot
Screen Shot 2015-09-13 at 11.11.43 am.png
Stefan Stokic
@StefanStokic
Sep 13 2015 03:12
Which screenshot?
Jalita
@UsefulPixels
Sep 13 2015 03:13
And this for class but it doesn't work
DJ
@qualitymanifest
Sep 13 2015 03:13
you don't need the . before thick-green-border
Jalita
@UsefulPixels
Sep 13 2015 03:13
Aha
DJ
@qualitymanifest
Sep 13 2015 03:13
in the HTML screenshot
also
Aniruddha Barapatre
@aniruddhabarapatre
Sep 13 2015 03:14
@UsefulPixels What's the error?
Stefan Stokic
@StefanStokic
Sep 13 2015 03:14
Any reason why you close img with /> instead of </img>
Jalita
@UsefulPixels
Sep 13 2015 03:14
I don't know whether I should apply the class to the already existing one in the image or if I have to create a new? Can I build on the last <img class="smaller-image"".thick-green-border" />?
Stefan Stokic
@StefanStokic
Sep 13 2015 03:14
and @aniruddhabarapatre no error probably, it just doesn't pick up
DJ
@qualitymanifest
Sep 13 2015 03:14
you don't need to make a second html element to hold that class, you can do multiple classes like so
```
<img class="classOne classTwo">
Stefan Stokic
@StefanStokic
Sep 13 2015 03:15
@UsefulPixels For multiple classes do <img class="smaller-image thick-green-border" />
Jalita
@UsefulPixels
Sep 13 2015 03:16
@KingInTheNorth & @qualitymanifest Ok, thanks, I'll try that
CamperBot
@camperbot
Sep 13 2015 03:16
usefulpixels sends brownie points to @kinginthenorth and @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 162 | @kinginthenorth | http://www.freecodecamp.com/kinginthenorth
:star: 202 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Cong Li
@lee5214
Sep 13 2015 03:16
you should justput the code inside the place you need a border. your code means that your .thick-green-border class has this border, but not others
oh i see the second pic
remove the "." in <img> i guess?
Jalita
@UsefulPixels
Sep 13 2015 03:17
@KingInTheNorth to your previous question I think I read somewhere that image tags closed themselves.
Stefan Stokic
@StefanStokic
Sep 13 2015 03:17
@UsefulPixels They don't close themselves, but that works too I guess.
Closing themselves would mean not ending with />, but like <input type="text">
Christian Neeley
@Chris6312
Sep 13 2015 03:20
img tags can be closed with either > or />...html5 allows the first where you don't need the /
Jalita
@UsefulPixels
Sep 13 2015 03:20
Ok, so one error gone. But still can't see the border, that's strange.
Ok, got it now, , thanks @Chris6312 @KingInTheNorth @lee5214 @qualitymanifest for your help!
CamperBot
@camperbot
Sep 13 2015 03:22
usefulpixels sends brownie points to @chris6312 and @kinginthenorth and @lee5214 and @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: usefulpixels already gave qualitymanifest points
:warning: could not find receiver for chris6312
:warning: usefulpixels already gave kinginthenorth points
:star: 202 | @lee5214 | http://www.freecodecamp.com/lee5214
Christian Neeley
@Chris6312
Sep 13 2015 03:24
@UsefulPixels you can also type border: green 10px solid; as a shortcut for border-color:, border-style:, and border-width:
Cong Li
@lee5214
Sep 13 2015 03:24
ur welcome, next time maybe you could copy the code here, so we can just test it fast to see wats going wrong
Jalita
@UsefulPixels
Sep 13 2015 03:27
Sure, quite new to this but appreciate your help
Steven Parker
@Philosophist
Sep 13 2015 03:30
Camper News 1.png
Hi help room!
I'm tiptoeing my way through the first zipline on front end development projects to make sure that I understand, and I came across this trouble establishing some angular code for it. Shouldn't it be leaving out the brackets, quotes and plus sign?
<html ng-app="newslist">

  <head>
    <link rel="stylesheet" type="text/css" href="bootstrap.min.css" 
    <script type="text/javascript" src="angular.min.js"></script>
    <script type="text/javascript" src="app.js"></script>
  </head>

  <body>
    <h1>{{"Hello"+ "Angular!"}}</h1>
  </body>

</html>
a1rr0wh3ad
@a1rr0wh3ad
Sep 13 2015 03:33
@Philosophist did you add jquery and angular scripts?
Bin Ury
@teddy-error
Sep 13 2015 03:33
You forgot to load in the Angular library
Well, you missed a bracket
So it isnt loading
<link rel="stylesheet" type="text/css" href="bootstrap.min.css"
Take notice of how the syntax highlighting on codepen looks funky
@Philosophist
Steven Parker
@Philosophist
Sep 13 2015 03:37
@teddy-error Thanks. Nice catch. But with the ">" added it's still not working.
CamperBot
@camperbot
Sep 13 2015 03:37
philosophist sends brownie points to @teddy-error :sparkles: :thumbsup: :sparkles:
:star: 69 | @teddy-error | http://www.freecodecamp.com/teddy-error
Steven Parker
@Philosophist
Sep 13 2015 03:38
<html ng-app="newslist">

  <head>
    <link rel="stylesheet" type="text/css" href="bootstrap.min.css"> 
    <script type="text/javascript" src="angular.min.js"></script>
    <script type="text/javascript" src="app.js"></script>
  </head>

  <body>
    <h1>{{"Hello"+ "Angular!"}}</h1>
  </body>

</html>
Bin Ury
@teddy-error
Sep 13 2015 03:39
Okay, you are missing also missing the ng-app declaration Steven
See here for reference: https://docs.angularjs.org/guide/module

 <body>
    <div ng-app="app">
      <h1>{{"Hello"+ "Angular!"}}</h1>
   </div>
</body>
Steven Parker
@Philosophist
Sep 13 2015 03:42
You mean the ng-app="newslist" in the html? also, the js:
var app = angular.module('newslist', []);
ohhhh.... hold on...
Christian Neeley
@Chris6312
Sep 13 2015 03:43

Having issues solving the ifelse flip game. My code looks like '''js var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
function myFunction(){
// Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".

// Only change code below this line.

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

// Only change code above this line.
}

// We use this function to show you the value of your variable in your output box.
var result = myFunction();if(typeof(flip) !== "undefined" && typeof(flip) === "number" && typeof(result) !== "undefined" && typeof(result) === "string"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}
'''

CamperBot
@camperbot
Sep 13 2015 03:43
:bulb: to format code use backticks! ``` more info
Bin Ury
@teddy-error
Sep 13 2015 03:44
@Philosophist yeah you have to define the range of your module
a1rr0wh3ad
@a1rr0wh3ad
Sep 13 2015 03:46
@Chris6312 just return 'heads' or 'tails', don't assign it to result,
Christian Neeley
@Chris6312
Sep 13 2015 03:48
tried that before and got Program Execution Error
drk7891
@drk7891
Sep 13 2015 03:48
Hey all, I'm stuck on 'Basic JavaScript
Hey all, I'm stuck on 'Basic JavaScript' number 40, its saying 'Use the provided code three times. One for each slot' but I have all three and the slot machine is working perfectly
And this is the three lines I had put:
$($(".slot")[0]).html("<img src=" + images[slotOne-1] + ">");
$($(".slot")[1]).html("<img src=" + images[slotTwo-1] + ">");
$($(".slot")[2]).html("<img src=" + images[slotThree-1] + ">");
a1rr0wh3ad
@a1rr0wh3ad
Sep 13 2015 03:49
@Chris6312 can you post what you did before? you could just be missing something like semicolon or brackets
Mateja Trifunovski
@Matko95
Sep 13 2015 03:49
@drk7891 You have to do it their way :)
drk7891
@drk7891
Sep 13 2015 03:49
@Matko95 Isn't that 'their way'? lol
Mateja Trifunovski
@Matko95
Sep 13 2015 03:50
@drk7891 you are using jquery
Cong Li
@lee5214
Sep 13 2015 03:50
<script>
  function runSlots(){
    var slotOne;
    var slotTwo;
    var slotThree;

    var images = ["http://i.imgur.com/9H17QFk.png", "http://i.imgur.com/9RmpXTy.png", "http://i.imgur.com/VJnmtt5.png"];

    slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
    slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
    slotThree = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
Mateja Trifunovski
@Matko95
Sep 13 2015 03:50
@drk7891 as @lee5214 showed you
drk7891
@drk7891
Sep 13 2015 03:50

@Matko95 Yeah, it says this though:
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');

Set up all three slots like this, then click the "Go" button to play the slot machine.

Im on the part where you are adding images to the slot machine
Steven Parker
@Philosophist
Sep 13 2015 03:51
@teddy-error ...still not getting it... I put it up top in the <html ng-app="newslist"> and tried it your way too. It's still not working.
Mateja Trifunovski
@Matko95
Sep 13 2015 03:51
@drk7891 what is the name of the waypoint?
Christian Neeley
@Chris6312
Sep 13 2015 03:51
if (flip === 0) {
 return 'heads'
} else {
return 'tails'
}
drk7891
@drk7891
Sep 13 2015 03:51
@Matko95 Number 40 under 'Basic Javascript', It's called "Waypoint: Give your JavaScript Slot Machine some stylish images
"
Cong Li
@lee5214
Sep 13 2015 03:51
oh sry i copy the wrong part lol
Luis Felipe López G.
@luishendrix92
Sep 13 2015 03:52
wiki js ternary
CamperBot
@camperbot
Sep 13 2015 03:52

:point_right: js ternary [wiki]

The Ternary operator replaces an if/then block.
It's mostly used in one liners for simple tests and replacements, like this:

var x = false;
var s = x ? "yes" : "no";
console.log(s);  //→ "no"

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

Cong Li
@lee5214
Sep 13 2015 03:52
 $($(".slot")[0]).html('<img src = "' + images[slotOne-1] + '">');
    $($(".slot")[1]).html('<img src = "' + images[slotTwo-1] + '">');
    $($(".slot")[2]).html('<img src = "' + images[slotThree-1] + '">');
here's it
@drk7891
drk7891
@drk7891
Sep 13 2015 03:52
ohhhhhhhhhhhhhh
I think i see it! let me try quick
Christian Neeley
@Chris6312
Sep 13 2015 03:53
and i have ; after 'heads' and 'tails' just didn't post it in the code
drk7891
@drk7891
Sep 13 2015 03:53
@lee5214 yes thanks! it I was using the " instead of using both " and '
CamperBot
@camperbot
Sep 13 2015 03:53
drk7891 sends brownie points to @lee5214 :sparkles: :thumbsup: :sparkles:
:star: 203 | @lee5214 | http://www.freecodecamp.com/lee5214
Bin Ury
@teddy-error
Sep 13 2015 03:53
@Philosophist I'm not familiar with codepen so I could be wrong, but i think your links for the scripts are missing the full URL paths
drk7891
@drk7891
Sep 13 2015 03:54
@Matko95 @lee5214 thank you both very much! :D
CamperBot
@camperbot
Sep 13 2015 03:54
drk7891 sends brownie points to @matko95 and @lee5214 :sparkles: :thumbsup: :sparkles:
:warning: drk7891 already gave lee5214 points
:star: 275 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Sep 13 2015 03:54
@drk7891 np :) good job for spotting your own mistake
@Chris6312 what's wrong?
Bin Ury
@teddy-error
Sep 13 2015 03:55
his goldfish died.
Christian Neeley
@Chris6312
Sep 13 2015 03:55
solving flip game if/else
Tommy Izen
@TommyIzen
Sep 13 2015 03:56
@Matko95 I've got the loop running, if I add more if statements it will take care of replacing lower case with Upper case. Now I just need to figure out how I'm going to put it together with the unsplit string.
Cong Li
@lee5214
Sep 13 2015 03:56
@drk7891 ur welcome. typo is very common, just be careful
Tommy Izen
@TommyIzen
Sep 13 2015 03:56
function titleCase(str) 
{
  str = str.split(" ")
  for (var i = 0; i < str.length; i++)
  {
    str2 = str[i][0]
    if (str2 === "a")
    {
      str2 = "A" 
    }  

    console.log(str2); 
  }


  return str;
}

titleCase("apple little tea pot");
Bin Ury
@teddy-error
Sep 13 2015 03:56
var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
function myFunction(){
// Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".
// Only change code below this line.
    if(flip == 0) {
        return'heads';
    } else {
        return'tails';
    }
// Only change code above this line.
}
// We use this function to show you the value of your variable in your output box.
var result = myFunction();if(typeof(flip) !== "undefined" && typeof(flip) === "number" && typeof(result) !== "undefined" && typeof(result) === "string"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}

console.log(result);
@Chris6312
Mateja Trifunovski
@Matko95
Sep 13 2015 03:57
@TommyIzen In JavaScript, strings are immutable, which means the best you can do is create a new string with the changed content, and assign the variable to point to it. you must remember that
Christian Neeley
@Chris6312
Sep 13 2015 03:58
@teddy-error Thanks!!! I put return = "heads" not return "heads"
CamperBot
@camperbot
Sep 13 2015 03:58
chris6312 sends brownie points to @teddy-error :sparkles: :thumbsup: :sparkles:
:star: 70 | @teddy-error | http://www.freecodecamp.com/teddy-error
Bin Ury
@teddy-error
Sep 13 2015 03:58
You're welcome. You actually put result = heads. Woops!
Mateja Trifunovski
@Matko95
Sep 13 2015 03:58
@TommyIzen what you can do is remember the first letter var firstLetter=str[i].charAt(0).toUpperCase(0) then play around with the rest, slice it, then concat it :)
Cong Li
@lee5214
Sep 13 2015 03:59
@TommyIzen I think this is not the right way to code, it supposes to run all the test case automatically
Tommy Izen
@TommyIzen
Sep 13 2015 03:59
@Matko95 much appreciated
Mateja Trifunovski
@Matko95
Sep 13 2015 03:59
@lee5214 i think he is just testing it
Tommy Izen
@TommyIzen
Sep 13 2015 03:59
so darn embarrassing
yeah no this isn't anywhere near finished
lol
Mateja Trifunovski
@Matko95
Sep 13 2015 04:00
they could've added a description that strings are immutable in javascript
Cong Li
@lee5214
Sep 13 2015 04:00
lol i just saw that if loop
Bin Ury
@teddy-error
Sep 13 2015 04:00
You shouldn't be embarrassed. It's totally logical to assume that would work that way.
Mateja Trifunovski
@Matko95
Sep 13 2015 04:00
in that particular bonfire
Tommy Izen
@TommyIzen
Sep 13 2015 04:00
@teddy-error thanks
CamperBot
@camperbot
Sep 13 2015 04:00
tommyizen sends brownie points to @teddy-error :sparkles: :thumbsup: :sparkles:
:star: 71 | @teddy-error | http://www.freecodecamp.com/teddy-error
Mateja Trifunovski
@Matko95
Sep 13 2015 04:00
yep i tried something like that myself :D
Cong Li
@lee5214
Sep 13 2015 04:01
its fun, the purpose is mean to learn
Mateja Trifunovski
@Matko95
Sep 13 2015 04:01
Would that work in python actually?
Tommy Izen
@TommyIzen
Sep 13 2015 04:01
yep, bang your head for awhile, do some research, more headbanging, then ask for help lol
Bin Ury
@teddy-error
Sep 13 2015 04:02
No, you can't assign values to char index(es) in a string in Py
I think it is important to understand why, and not just accept it
Cong Li
@lee5214
Sep 13 2015 04:03
@TommyIzen you can use str.splite(" ") function, so it will break the words in string and put them into an array
break the sentence into words*
Mateja Trifunovski
@Matko95
Sep 13 2015 04:04
@teddy-error thanks for the info
CamperBot
@camperbot
Sep 13 2015 04:04
matko95 sends brownie points to @teddy-error :sparkles: :thumbsup: :sparkles:
:star: 72 | @teddy-error | http://www.freecodecamp.com/teddy-error
Tommy Izen
@TommyIzen
Sep 13 2015 04:04
@lee5214 yep, you're right
except it's .splice(" ") : )
Cong Li
@lee5214
Sep 13 2015 04:06
errr no actually
Tommy Izen
@TommyIzen
Sep 13 2015 04:06
?
Cong Li
@lee5214
Sep 13 2015 04:06
splice is used like this way
arr.splice(0,0,"something")
Mateja Trifunovski
@Matko95
Sep 13 2015 04:06
@TommyIzen he meant .split(" ");
Cong Li
@lee5214
Sep 13 2015 04:06
it's replace or add something into the array
Tommy Izen
@TommyIzen
Sep 13 2015 04:07
ohhh
I see, I see
Tommy Izen
@TommyIzen
Sep 13 2015 04:07
I meant .split
Cong Li
@lee5214
Sep 13 2015 04:07
lol right split, i always try to add the "e"
sry for my typo
Mateja Trifunovski
@Matko95
Sep 13 2015 04:07
:D
Tommy Izen
@TommyIzen
Sep 13 2015 04:07
not .splice wtf
sorry hahaha
string.sprite("Why, cuz I like the Sprite in you")
Jimmy
@Nerdherdx
Sep 13 2015 04:10
Bonfire: Where do I belong
CamperBot
@camperbot
Sep 13 2015 04:10

:fire:Bonfire: Where do I belong :link:

function where(arr, num) {
  // Find my place in this sorted array.
  return num;
}

where([40, 60], 50);

Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument).

more info:  bf details | bf links | hint

Jimmy
@Nerdherdx
Sep 13 2015 04:10
can anyone help with it?
Bin Ury
@teddy-error
Sep 13 2015 04:10
Where are you stuck?
Mateja Trifunovski
@Matko95
Sep 13 2015 04:10
@Nerdherdx sure, did you start?
Jimmy
@Nerdherdx
Sep 13 2015 04:11

function where(arr, num) {
// Find my place in this sorted array.

arr.push(num);
arr.sort();
for(var i = 0; i < arr.length;i++){
arr = arr.indexOf(num);

if(arr > 1)

}

return arr;
}

where([40, 60], 50);

function where(arr, num) {
// Find my place in this sorted array.

arr.push(num);
arr.sort();
for(var i = 0; i < arr.length;i++){
arr = arr.indexOf(num);

if(arr > 1)

}

return arr;
}

where([40, 60], 50);

Mateja Trifunovski
@Matko95
Sep 13 2015 04:11
explain formatting
CamperBot
@camperbot
Sep 13 2015 04:11

: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

Jimmy
@Nerdherdx
Sep 13 2015 04:11

function where(arr, num) {

// Find my place in this sorted array.

arr.push(num);

arr.sort();

for(var i = 0; i < arr.length;i++){

arr = arr.indexOf(num);


if(arr > 1)

}

return arr;

}

where([40, 60], 50);

Bin Ury
@teddy-error
Sep 13 2015 04:11
function where(arr, num) {


  // Find my place in this sorted array.



  arr.push(num);


  arr.sort();

  for(var i = 0; i < arr.length;i++){

    arr = arr.indexOf(num);


    if(arr > 1)

  }


  return arr;

}


where([40, 60], 50);
Jimmy
@Nerdherdx
Sep 13 2015 04:11
thank you
CamperBot
@camperbot
Sep 13 2015 04:11
if you want to thank someone, put an @ before their name!
Jimmy
@Nerdherdx
Sep 13 2015 04:12
@teddy-error thank you
CamperBot
@camperbot
Sep 13 2015 04:12
nerdherdx sends brownie points to @teddy-error :sparkles: :thumbsup: :sparkles:
:star: 73 | @teddy-error | http://www.freecodecamp.com/teddy-error
Mateja Trifunovski
@Matko95
Sep 13 2015 04:12
@Nerdherdx your .sort(); function doesn't actually sort the numbers well
@Nerdherdx you need to create a compare function
Cong Li
@lee5214
Sep 13 2015 04:13
you dont need to put the one num into an array
Mateja Trifunovski
@Matko95
Sep 13 2015 04:14
function compareNumbers(a, b) {
  return a - b;
}
something like this
@Nerdherdx
Cong Li
@lee5214
Sep 13 2015 04:14
oh nvm i got wrong
Jimmy
@Nerdherdx
Sep 13 2015 04:14
@Matko95 to find if the number is a decimal ?
Mateja Trifunovski
@Matko95
Sep 13 2015 04:15
@Nerdherdx sort of.. when you use .sort(); it sorts the values of an array by unicode value, not decimal
Bin Ury
@teddy-error
Sep 13 2015 04:16
@nerdherdx @Matko95 is talking about the array method sort which takes a function as its parameter : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
Cong Li
@lee5214
Sep 13 2015 04:18
@Nerdherdx
i think a way to do it may be easier, use a for loop check every elem in arr
something like this
if(num<=arr[0]){
return 0; }
if(num>arr[i] && num<=arr[i+1]){
return i+1;}
Bin Ury
@teddy-error
Sep 13 2015 04:18
You should take from the article that the built-in sort logic is stupid and that you'll need to pass your own into sort.
Mateja Trifunovski
@Matko95
Sep 13 2015 04:19
@lee5214 it can't be easier.. you just need to use .sort and return .indexOf(num), 3 lines of code
Bin Ury
@teddy-error
Sep 13 2015 04:20
1) Sort array in ascending order
2) Traverse array
3) ???
4) Return (lowest) index of where the num would go
Cong Li
@lee5214
Sep 13 2015 04:20
@Matko95 i mean easier to understand, for me at least since i just start learning js 3 days ago
KristyCat
@KristyCat
Sep 13 2015 04:24

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);})();

i dont understand what it wants from me
Todd Loiselle
@loiselt1
Sep 13 2015 04:25

Hello all again, this time I'm stuck on CSS "Create a Form Element. This is what I got so far:

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

And the one thing I'm missing is "nest your text input element within a form element"

Mateja Trifunovski
@Matko95
Sep 13 2015 04:26

@loiselt1

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

try something like that

Steven Parker
@Philosophist
Sep 13 2015 04:27
@teddy-error Is there any way to check? I visually copied straight from the angular course site's example. Also, one step that was confusing was when it told us to download angular. I downloaded as they said to, but it wasn't clear how to use it from there. No specification of where to store or how to install.
Todd Loiselle
@loiselt1
Sep 13 2015 04:27
Thanks again Matko95. It's those simple things that I keep missing. :S
CamperBot
@camperbot
Sep 13 2015 04:27
if you want to thank someone, put an @ before their name!
Todd Loiselle
@loiselt1
Sep 13 2015 04:28
@Matko95 thanks again
CamperBot
@camperbot
Sep 13 2015 04:28
loiselt1 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 277 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Sep 13 2015 04:28
@loiselt1 actually remove the </input> closing tag, it's not necessary :)
it's self closing
Bin Ury
@teddy-error
Sep 13 2015 04:29
@Philosophist Yeah, it's just a really basic thing so they're using a placeholder as an example. It's not meant to be copied exactly
You need to use the hosted libraries of jquery and angular. See here: https://developers.google.com/speed/libraries/
Steven Parker
@Philosophist
Sep 13 2015 04:34
@teddy-error thanks! That did it!
CamperBot
@camperbot
Sep 13 2015 04:34
philosophist sends brownie points to @teddy-error :sparkles: :thumbsup: :sparkles:
:warning: philosophist already gave teddy-error points
1ilya0
@1ilya0
Sep 13 2015 04:51

Please, guys help me! Can't add a dead link. Where I made a mistake? Thanks in advance! <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
<p>cat <a #>cat photos</a> photos</p>

CamperBot
@camperbot
Sep 13 2015 04:51
if you want to thank someone, put an @ before their name!
Bryan Sweeney
@neskowinstump
Sep 13 2015 04:55
thanks @camperbot
CamperBot
@camperbot
Sep 13 2015 04:55
neskowinstump sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 210 | @camperbot | http://www.freecodecamp.com/camperbot
DJ
@qualitymanifest
Sep 13 2015 04:56
@1ilya0 <a href="#"></a>
1ilya0
@1ilya0
Sep 13 2015 04:57
@qualitymanifest Oh, man I'm so damn thank you.
CamperBot
@camperbot
Sep 13 2015 04:57
1ilya0 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 203 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Mohsin Mumtaz
@mohmum
Sep 13 2015 05:29
I'm stuck in Javascript if else waypoint.. Can someone please help me

var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
function myFunction(){
// Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".
if(flip == 0)
// Only change code below this line.
{

return heads;
}
else {
return tails;
}

// Only change code above this line.
}
myFunction();
// We use this function to show you the value of your variable in your output box.
var result = myFunction();if(typeof(flip) !== "undefined" && typeof(flip) === "number" && typeof(result) !== "undefined" && typeof(result) === "string"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}

Binny Kim
@removed~BinnyK
Sep 13 2015 05:30
@mohmum put your code between ```
Christian Neeley
@Chris6312
Sep 13 2015 05:30
include ' ' around heads and tails
Binny Kim
@removed~BinnyK
Sep 13 2015 05:30
This message was deleted
Mohsin Mumtaz
@mohmum
Sep 13 2015 05:31
yeah it worked
@BinnyK By the way why do we need to include ' '?? It was not shown in examples
Binny Kim
@removed~BinnyK
Sep 13 2015 05:32
var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
function myFunction(){
  // Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".
if(flip == 0)
  // Only change code below this line.
{

return heads;
}
  else { 
    return tails; 
 }

  // Only change code above this line.
}
myFunction();
// We use this function to show you the value of your variable in your output box.
var result = myFunction();if(typeof(flip) !== "undefined" && typeof(flip) === "number" && typeof(result) !== "undefined" && typeof(result) === "string"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}
I meant ``` so that your code will come up like this
making it easier for people to help read your code
Christian Neeley
@Chris6312
Sep 13 2015 05:33
by typing js shift+enter <insert code here> then alt+enter you get BinnyK's example
Hans van Riet
@hansinla
Sep 13 2015 05:34
@mohmum because you’re returning the string ‘heads’ and ‘tails’. As a variable they’re undefined.
Mohsin Mumtaz
@mohmum
Sep 13 2015 05:35
@hansinla ok so you mean whenever i return something that's undefined i have to include ' '. Correct?
Binny Kim
@removed~BinnyK
Sep 13 2015 05:35

@mohmum Hansinla is correct

either create new variables with "heads" or "tails"... OR just return "heads" or "tails" as a string

Christian Neeley
@Chris6312
Sep 13 2015 05:35
3 back ticks then what i wrote the 3 more back ticks which is the same as the ~ button
Binny Kim
@removed~BinnyK
Sep 13 2015 05:37
// either return as variables... E.G
var h = "heads";
var t = "tails";

return h;
//OR
return t;

//Or you can return them as strings inside your if else statement with quotes around it making them strings.
return "heads";
//or
return "tails";
Mohsin Mumtaz
@mohmum
Sep 13 2015 05:38
great smile: thank you
CamperBot
@camperbot
Sep 13 2015 05:38
if you want to thank someone, put an @ before their name!
Cong Li
@lee5214
Sep 13 2015 05:38
@mohmum return "heads" means return the String "heads" back to this; return heads means return the value of a variable called heads
Mohsin Mumtaz
@mohmum
Sep 13 2015 05:39
@BinnyK @lee5214 @camperbot Thank You everyone
CamperBot
@camperbot
Sep 13 2015 05:39
mohmum sends brownie points to @binnyk and @lee5214 and @camperbot :sparkles: :thumbsup: :sparkles:
:star: 123 | @binnyk | http://www.freecodecamp.com/binnyk
:star: 211 | @camperbot | http://www.freecodecamp.com/camperbot
:star: 204 | @lee5214 | http://www.freecodecamp.com/lee5214
Todd Loiselle
@loiselt1
Sep 13 2015 05:52
So ran into another one that I just can't seem to comprehend. "Give a Background Color to a Div Element". From what I understand, I have to create a background-color class within the style element. I do that, and then I'm lost as to how I assign it to my div element.
Raghu Ranganathan
@razetime
Sep 13 2015 05:53
do <div class="classname"></div>
got it?
Todd Loiselle
@loiselt1
Sep 13 2015 05:54
It didn't work
Raghu Ranganathan
@razetime
Sep 13 2015 05:54
how did you define your class?
Cong Li
@lee5214
Sep 13 2015 05:55
there are several ways to change the div's color, like give it an id or class, then change it in css
Todd Loiselle
@loiselt1
Sep 13 2015 05:55
.background-color { background-color: green;
}
Raghu Ranganathan
@razetime
Sep 13 2015 05:56
so you did <div class="background-color"></div> and it didn't work?
Todd Loiselle
@loiselt1
Sep 13 2015 05:56
Correct
Raghu Ranganathan
@razetime
Sep 13 2015 05:56
change the class name and then try
Cong Li
@lee5214
Sep 13 2015 05:57
<head>

<style>
.main{
background:red;
}
</style>

</head>

<body>
<div class="main"></div>
</body>
this should work i guess
Raghu Ranganathan
@razetime
Sep 13 2015 05:57
yeah
Todd Loiselle
@loiselt1
Sep 13 2015 05:58
I tried what lee5214 just posted and it didn't work either.
Cong Li
@lee5214
Sep 13 2015 05:58
ok ill test mine really fast
Raghu Ranganathan
@razetime
Sep 13 2015 05:58
reload the page, and then try.
lee, you div should have a width and height
Cong Li
@lee5214
Sep 13 2015 06:00
lol yeah forget that
Christian Neeley
@Chris6312
Sep 13 2015 06:00
without putting something in the div or what razetime wrote there is nothing to apply the background color to
Cong Li
@lee5214
Sep 13 2015 06:01
<style>
.main{
height:100px;
width:100px;
background:red;
}
</style>
</head>

<body>
</body>
</html>

<body>
<div class="main"></div>
</body>
its just a sample to explain, didn't really wanna run it. this one works
Raghu Ranganathan
@razetime
Sep 13 2015 06:01
bonfire main
CamperBot
@camperbot
Sep 13 2015 06:01
Sorry, can't find a bonfire called main. [ Check the map? ]
Raghu Ranganathan
@razetime
Sep 13 2015 06:02
bonfire truncate a string
CamperBot
@camperbot
Sep 13 2015 06:02

:fire:Bonfire: Truncate a string :link:

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

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

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

more info:  bf details | bf links | hint

Raghu Ranganathan
@razetime
Sep 13 2015 06:02
thanks @camperbot!
CamperBot
@camperbot
Sep 13 2015 06:02
if you want to thank someone, put an @ before their name!
Todd Loiselle
@loiselt1
Sep 13 2015 06:06
I figured it out. Had a </div> hidden that was holding everything up.
Jimmy
@Nerdherdx
Sep 13 2015 06:28
Bonfire: Where do I belong
CamperBot
@camperbot
Sep 13 2015 06:28

:fire:Bonfire: Where do I belong :link:

function where(arr, num) {
  // Find my place in this sorted array.
  return num;
}

where([40, 60], 50);

Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument).

more info:  bf details | bf links | hint

Jimmy
@Nerdherdx
Sep 13 2015 06:29
hint
CamperBot
@camperbot
Sep 13 2015 06:29
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
srishi2110git
@srishi2110git
Sep 13 2015 06:30

var min = 0;
var max = 9;
function myFunction() {
// Make myFunction return a random number between zero and nine instead of a decimal
// Only change code below this line.
Math.floor(Math.random()* (max- min +1)) + min
return Math.random();
}

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return myFunction();})();

where am i wrong with
above code to return only integer value
Cong Li
@lee5214
Sep 13 2015 06:32
Math.floor(Math.random()* (max- min +1)) + min delete
srishi2110git
@srishi2110git
Sep 13 2015 06:32
ok
then
?
Todd Loiselle
@loiselt1
Sep 13 2015 06:34
Stuck on yet another one haha. Setting the ID of an Element. It says to give your form element the id cat-photo-form and I'm confused where it would go.
Cong Li
@lee5214
Sep 13 2015 06:34
oh wait, i misunderstand it
DTing
@dting
Sep 13 2015 06:34
replace that Math.random() with the code from above it. you want to return it
Cong Li
@lee5214
Sep 13 2015 06:34
return Math.floor(Math.random()*10); this
DTing
@dting
Sep 13 2015 06:34
return Math.floor(Math.random()* (max- min +1)) + min;
srishi2110git
@srishi2110git
Sep 13 2015 06:35
got that
thanks
CamperBot
@camperbot
Sep 13 2015 06:35
if you want to thank someone, put an @ before their name!
srishi2110git
@srishi2110git
Sep 13 2015 06:35
@dting
thanks
CamperBot
@camperbot
Sep 13 2015 06:35
if you want to thank someone, put an @ before their name!
DTing
@dting
Sep 13 2015 06:36
np
srishi2110git
@srishi2110git
Sep 13 2015 06:37
:)
Todd Loiselle
@loiselt1
Sep 13 2015 06:39
So I am stuck on another one yet again, how to set the id of an element. It says to give your form element the id cat-photo-form, and I've put this everywhere I could think of and it isn't acepting
Max
@gash83733
Sep 13 2015 06:39
anybody know what is this?
if(typeof(myName) !== "undefined"){(function(v){return v;})(myName);}
DTing
@dting
Sep 13 2015 06:40
thats how they are testing your code.
Max
@gash83733
Sep 13 2015 06:42
Should I fill out my English name of the grid it myName?
Absalon Castañon Avila
@absalnC
Sep 13 2015 06:43
@loiselt1 whats the name of the exercise?
Todd Loiselle
@loiselt1
Sep 13 2015 06:44
@absalnC Set the ID of an Element
Absalon Castañon Avila
@absalnC
Sep 13 2015 06:44
bf Set the ID of an Element
CamperBot
@camperbot
Sep 13 2015 06:44
Sorry, can't find a bonfire called set the id of an element. [ Check the map? ]
Absalon Castañon Avila
@absalnC
Sep 13 2015 06:46
@loiselt1 just insert id="cat-photo-form" anywhere inside the form tag
like this: <form id="cat-photo-form">...content....</form>
Todd Loiselle
@loiselt1
Sep 13 2015 06:50
I was missing some stuff, didn't have the ....content....</form> portion
Absalon Castañon Avila
@absalnC
Sep 13 2015 06:53
There must be a bug
pyramidal-neuron
@pyramidal-neuron
Sep 13 2015 06:54
Hi!
Got some trouble with pig latin. i guess i found some bug

```function translate(str) {
consonantLetters = "BCDFGHJKLMNPQRSTVWXZ".toLowerCase().split("");
if (consonantLetters.indexOf(str[0])!== -1) {
str += str[0];
str = str.substr(1);
} else {
str += "w";
}
if (consonantLetters.indexOf(str[0])!== -1){
translate(str);
} else {
str += "ay";
console.log(str);
return str + "ay";
}
}

translate("california");
```

can anybody test it, maybe it's make troubles only on my computer
Intermediate Algorithm Scripting, 6 bonfire
DTing
@dting
Sep 13 2015 06:56
bf pig
CamperBot
@camperbot
Sep 13 2015 06:56

:fire:Bonfire: Pig Latin :link:

function translate(str) {
 return str;
}

translate("consonant");

Translate the provided string to pig latin.

more info:  bf details | bf links | hint

DTing
@dting
Sep 13 2015 06:57
"aliforniacayay"
that has an extra ay
pyramidal-neuron
@pyramidal-neuron
Sep 13 2015 06:57
yep, but at node js it works fine
and it should
look at the code
DTing
@dting
Sep 13 2015 06:58
no it should have 1 ay not 2
you have aliforniacay+ ay
pyramidal-neuron
@pyramidal-neuron
Sep 13 2015 06:58
yep, if a start it on node js - that have only one "ay"
DTing
@dting
Sep 13 2015 06:59
} else {
str += "ay";
console.log(str);
return str + "ay";
}
this always adds an extra "ay"
pyramidal-neuron
@pyramidal-neuron
Sep 13 2015 06:59
oh
sorry
my bad
thnx
CamperBot
@camperbot
Sep 13 2015 07:00
if you want to thank someone, put an @ before their name!
DTing
@dting
Sep 13 2015 07:01
if (consonantLetters.indexOf(str[0])!== -1){
translate(str);
}
MrZappy
@MrZappy
Sep 13 2015 07:01
bf fing the longest word
CamperBot
@camperbot
Sep 13 2015 07:01
Sorry, can't find a bonfire called fing the longest word. [ Check the map? ]
DTing
@dting
Sep 13 2015 07:01
you also need to return that translate
MrZappy
@MrZappy
Sep 13 2015 07:01
Bonfire: Find the Longest Word in a String
CamperBot
@camperbot
Sep 13 2015 07:01

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

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

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

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

more info:  bf details | bf links | hint

MrZappy
@MrZappy
Sep 13 2015 07:01
hint
CamperBot
@camperbot
Sep 13 2015 07:01
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Rex Schrader
@SaintPeter
Sep 13 2015 07:01
@MrZappy If you need a hand, I can help out
DTing
@dting
Sep 13 2015 07:02
otherwise when you call the recursive function and not return it. your function will just return undefined. @pyramidal-neuron
MrZappy
@MrZappy
Sep 13 2015 07:02
@SaintPeter I have such bad trouble with this that I need someone on skype helping me out, I have been stuck on this stuff for the past week.
Rex Schrader
@SaintPeter
Sep 13 2015 07:03
@MrZappy That particular Bonfire?
MrZappy
@MrZappy
Sep 13 2015 07:03
No all of them lol
@SaintPeter
pyramidal-neuron
@pyramidal-neuron
Sep 13 2015 07:03
@dting thnx again)
CamperBot
@camperbot
Sep 13 2015 07:03
pyramidal-neuron sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
Rex Schrader
@SaintPeter
Sep 13 2015 07:03
@MrZappy I can hop on skype and take a look, sure
CamperBot
@camperbot
Sep 13 2015 07:03
:star: 1157 | @dting | http://www.freecodecamp.com/dting
gts00k
@gts00k
Sep 13 2015 07:03
'morning
MrZappy
@MrZappy
Sep 13 2015 07:04
@SaintPeter sent you my skype
Rex Schrader
@SaintPeter
Sep 13 2015 07:05
@MrZappy got it, added you on Skype
MrZappy
@MrZappy
Sep 13 2015 07:05
Gotcha
Max
@gash83733
Sep 13 2015 07:09
myName should be a string that contains at least one character in it
anynody know what mean
SojournerOctocat
@SojournerOctocat
Sep 13 2015 07:09
@gash83733 Paste your code.
Max
@gash83733
Sep 13 2015 07:10
if(typeof(myFirstname) !== "undefined"){(function(v){return v;})(myFirstname);}
DTing
@dting
Sep 13 2015 07:11
means you need to assign a non empty string to the variable myFirstName
Cong Li
@lee5214
Sep 13 2015 07:14
Bonfire: Spinal Tap Case
CamperBot
@camperbot
Sep 13 2015 07:14

:fire:Bonfire: Spinal Tap Case :link:

function spinalCase(str) {
  // "It's such a fine line between stupid, and clever."
  // --David St. Hubbins
  return str;
}

spinalCase('This Is Spinal Tap');

Convert a string to spinal case. Spinal case is all-lowercase-words-joined-by-dashes.

more info:  bf details | bf links | hint

Cong Li
@lee5214
Sep 13 2015 07:14
hint
CamperBot
@camperbot
Sep 13 2015 07:14
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Max
@gash83733
Sep 13 2015 07:15
let me see see
Matthew Restine
@mattrestine
Sep 13 2015 07:26
Bonfire: Truncate a string, need help understanding the last two errors. The part: assert(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length) === 'A-tisket a-tasket A green and yellow basket', 'should not truncate if string is = length');
should not truncate if string is = length
CamperBot
@camperbot
Sep 13 2015 07:26
Sorry, can't find a bonfire called truncate a string need help understanding the last two errors the part asserttruncatea-tisket a-tasket a green and yellow basket a-tisket a-tasket a green and yellow basketlength a-tisket a-tasket a green and yellow basket should not truncate if string is lengthshould not truncate if string is length. [ Check the map? ]
Matthew Restine
@mattrestine
Sep 13 2015 07:26
I dont understand what that means
Max
@gash83733
Sep 13 2015 07:26
Oh my God I was successful
@dting I love you
SojournerOctocat
@SojournerOctocat
Sep 13 2015 07:27
@Digitalopensky Paste your code.
Matthew Restine
@mattrestine
Sep 13 2015 07:27

function truncate(str, num) {
var temp = str.slice(0,num-3);
temp += "...";
return temp;
}

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

Cong Li
@lee5214
Sep 13 2015 07:29
@Digitalopensky if(str.length>num){
return s = str.slice(0,num-3)+"...";}
else{
return str;
```if(str.length>num){
return s = str.slice(0,num-3)+"...";}
else{
return str;

damn sry

if(str.length>num){
return s = str.slice(0,num-3)+"...";}
else{
return str;

this should work i guess @Digitalopensky

Matthew Restine
@mattrestine
Sep 13 2015 07:30
i see, I need to check if the num is large enough to truncate a str
?
Cong Li
@lee5214
Sep 13 2015 07:31
u need to check if the string is long enough
Matthew Restine
@mattrestine
Sep 13 2015 07:33
That worked, thank you very much.
CamperBot
@camperbot
Sep 13 2015 07:33
if you want to thank someone, put an @ before their name!
Matthew Restine
@mattrestine
Sep 13 2015 07:33
@lee5214 Thank you!
Cong Li
@lee5214
Sep 13 2015 07:34
my pleasure
Matthew Restine
@mattrestine
Sep 13 2015 07:35
How do you paste in snippet format?
SojournerOctocat
@SojournerOctocat
Sep 13 2015 07:35
help format
CamperBot
@camperbot
Sep 13 2015 07:35

: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

Matthew Restine
@mattrestine
Sep 13 2015 07:35
ahh!
@SojournerOctocat thanks!
Cong Li
@lee5214
Sep 13 2015 07:35
put ``` before and after your code, new line
CamperBot
@camperbot
Sep 13 2015 07:35
digitalopensky sends brownie points to @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:star: 285 | @sojourneroctocat | http://www.freecodecamp.com/sojourneroctocat
Matthew Restine
@mattrestine
Sep 13 2015 07:35
@lee5214 got it thanks again
CamperBot
@camperbot
Sep 13 2015 07:35
digitalopensky sends brownie points to @lee5214 :sparkles: :thumbsup: :sparkles:
:star: 207 | @lee5214 | http://www.freecodecamp.com/lee5214
srishi2110git
@srishi2110git
Sep 13 2015 07:45

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);})();

how to do
?
Cong Li
@lee5214
Sep 13 2015 07:46
myCar.engines = 0;
srishi2110git
@srishi2110git
Sep 13 2015 07:47
why not this.engines?
Cong Li
@lee5214
Sep 13 2015 07:48
this is used in the function Car, but the comment says to write the code outside
DTing
@dting
Sep 13 2015 07:49
they want you to add an engines property to the myCar instance of a Car object.
srishi2110git
@srishi2110git
Sep 13 2015 07:49
so we use that got it
thanks @lee5214
CamperBot
@camperbot
Sep 13 2015 07:49
srishi2110git sends brownie points to @lee5214 :sparkles: :thumbsup: :sparkles:
:star: 208 | @lee5214 | http://www.freecodecamp.com/lee5214
srishi2110git
@srishi2110git
Sep 13 2015 07:50
how we do that
?
brownie points
??
DTing
@dting
Sep 13 2015 07:51
wiki brownie
CamperBot
@camperbot
Sep 13 2015 07:51

: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

Cong Li
@lee5214
Sep 13 2015 07:52
i just say it in an easy way fo understanding, actually @dting explained better
srishi2110git
@srishi2110git
Sep 13 2015 07:54
CamperBot
@camperbot
Sep 13 2015 07:54
if you want to thank someone, put an @ before their name!
DTing
@dting
Sep 13 2015 07:55
were you to add this.engines = 1; inside the constructor for Car, every car you made using new Car() would have this property. Instead they want you to add an engines property to the instance of Car that was made and assigned to the myCar variable.
Fahad Uddin
@FahadUddin92
Sep 13 2015 08:14
@enggfahd
I am having trouble understanding this:
Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.
Can we reuse the code in the given example project?
Another rule says,
Rule #1: Don't look at the example project's code on CodePen. Figure it out for yourself.
These rules seem to be against each other.
Zoltan Biber
@zoltanbiber
Sep 13 2015 08:43
Anyone has the bug where completed waypoints show as 'not ticked' and vice versa?
Fahad Uddin
@FahadUddin92
Sep 13 2015 08:55
Where are the quotes coming from in this exercise?
http://codepen.io/AdventureBear/full/vEoVMw
Random Quotes Rewritten
marzelin
@marzelin
Sep 13 2015 08:56
@enggfahd from the array
Fahad Uddin
@FahadUddin92
Sep 13 2015 08:56
@marzelin : Which array?
marzelin
@marzelin
Sep 13 2015 08:57
included in the page called quotes.
Aliaksandr Savitski
@pesokot
Sep 13 2015 09:50
Hi all. I'm working on the first zipline, and create portfolio website. Where can I store images for this website to be accessible from the web if I don't have any hosting / server. Can Anyone help?
Aleksandr Sidorov
@AleksandrSidorov
Sep 13 2015 09:50
@pesokot I'm using Google Drive
Dealga McArdle
@zeffii
Sep 13 2015 09:51
blob
@enggfahd
Aliaksandr Savitski
@pesokot
Sep 13 2015 09:51
@shtil80 I tried to, but when I paste link to google drive, image doesn't show up :(
Aleksandr Sidorov
@AleksandrSidorov
Sep 13 2015 09:51
Aliaksandr Savitski
@pesokot
Sep 13 2015 09:52
@shtil80 Looks great! I'll try immediately! Thank you!
CamperBot
@camperbot
Sep 13 2015 09:52
pesokot sends brownie points to @shtil80 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for shtil80
Aleksandr Sidorov
@AleksandrSidorov
Sep 13 2015 09:53
@pesokot you're welcome
Aliaksandr Savitski
@pesokot
Sep 13 2015 09:53
@shtil80 works! Thanks again :)
CamperBot
@camperbot
Sep 13 2015 09:53
pesokot sends brownie points to @shtil80 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for shtil80
Fahad Uddin
@FahadUddin92
Sep 13 2015 09:57
@zeffii : But we arent allowed to open those files. Are we?
Qirk
@qirkshah
Sep 13 2015 09:57
Hi there,please take a look at my code and why does it return undefined. here is the code

function truncate(str, num) {

var word = "";

if (str.length - num == 11) {

while (num > 0) {

        word += str;     

  num--;

 return word;

    }

}

}
truncate('A-tisket a-tasket A green and yellow basket', 11);
it is meant to truncate the words to 11 characters

Dealga McArdle
@zeffii
Sep 13 2015 10:03
@enggfahd -- you wanted to know where the quotes came from. in the case of that page, it's just a random selection from a large array of quotes.
Coira Ellison
@Coira
Sep 13 2015 10:04
@qirkshah i think you might have a problem here if (str.length - num == 11) {
Aleksandr Sidorov
@AleksandrSidorov
Sep 13 2015 10:11
@qirkshah and while (num > 0) is not suitable here in such way
Gary Wong
@gary-w
Sep 13 2015 10:48
Hi, I’m taking FCC. But I’m also reading Eloquent Javascript on the side. I have a question on one Exercise question. Can I ask it here?
Coira Ellison
@Coira
Sep 13 2015 10:50
yep, go ahead :)
Gary Wong
@gary-w
Sep 13 2015 10:50
test
test
at the very bottom, Bean Counting. for “BBC”, I dont understand why this doesnt work. thanks @Coira
// Create function countBs, 
function countBs(str){
// Loop inside string from 0 to string.length and see if any Bs. If one, +1; if none, move on.
  var count = 0;
    for(var i = 0; i < str.length; i++) {
      if(str.charAt(i) === "B") {
        meter+=;
      };
    };
  return count;
};
CamperBot
@camperbot
Sep 13 2015 10:51
gary-w sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 209 | @coira | http://www.freecodecamp.com/coira
should be count+=
Dealga McArdle
@zeffii
Sep 13 2015 10:52
meter+=1 ?
Coira Ellison
@Coira
Sep 13 2015 10:53
or count++
(or meter?) whichever variable you're using
Gary Wong
@gary-w
Sep 13 2015 10:53
oh!!! it works!!!
++!!! thanks!!
CamperBot
@camperbot
Sep 13 2015 10:53
if you want to thank someone, put an @ before their name!
Coira Ellison
@Coira
Sep 13 2015 10:54
np :)
Gary Wong
@gary-w
Sep 13 2015 10:55
silly me
i find that writing comments on my logic before i code is more efficient… does any of you do that as well? of cos im a beginner haha..
Dealga McArdle
@zeffii
Sep 13 2015 10:57
usually the code editor , codepen / freecodecamp editor, displays a notification to the left of any line with bad code
i imagine the line with meter+= showed some red or yellow indicator
and there's also the browser's console , which often also shows some kind of information when it can't make sense of your code
Gary Wong
@gary-w
Sep 13 2015 10:59
ur right @zeffii it did say unexpected token
Ali-Haider5
@Ali-Haider5
Sep 13 2015 11:07
@zeffi hello I am new to code camp kindly tell me what was your former education before coming to code camp
Brad cox
@bravo1c
Sep 13 2015 11:33
hey guys, i'm having alot of trouble getting my head aroud this, i'm at the bonfires now and i'm struggling rely bad. does anyone have a recomendations?
Mateusz Szymański
@matszym
Sep 13 2015 11:52
@bravo1c That should be good sign. You should be challenged while learning new stuff. If you need help with specific bonfire post your code here and ask question.
CamperBot
@camperbot
Sep 13 2015 11:52
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Brad cox
@bravo1c
Sep 13 2015 11:57
okay thanks man, just feels like i have learned nothing and dont know where to start
CamperBot
@camperbot
Sep 13 2015 11:57
if you want to thank someone, put an @ before their name!
Dealga McArdle
@zeffii
Sep 13 2015 11:57
This message was deleted
APM
@APMerchant
Sep 13 2015 12:31

I am having problem with the waypoint: Making object properties private. Where do you keep myBike.speed in the code to keep it private?

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

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

};

Oleg-docent
@Oleg-docent
Sep 13 2015 12:33
need help for Waypoint: Make Object Properties Private
@APMerchant me too)
APM
@APMerchant
Sep 13 2015 12:34
cool....now I feel better...anyone? senior campers?
Dealga McArdle
@zeffii
Sep 13 2015 12:36
read the instructions carefully @APMerchant @Oleg-docent
This message was deleted
CamperBot
@camperbot
Sep 13 2015 12:37
Sorry, can't find a bonfire called making object properties private. [ Check the map? ]
Fahad Uddin
@FahadUddin92
Sep 13 2015 12:37
@APMerchant : if you want to make an object private, remove this. from it.
Dealga McArdle
@zeffii
Sep 13 2015 12:38
To do this, we omit the word this from the property or method declaration.
that line is in the description.
This message was deleted
CamperBot
@camperbot
Sep 13 2015 12:39
Sorry, can't find a bonfire called private. [ Check the map? ]
Aleksandr Sidorov
@AleksandrSidorov
Sep 13 2015 12:39
Can anybody test my weather zipline?
http://codepen.io/shtil80/full/KdpEpa
Is your location determined correctly?
Coira Ellison
@Coira
Sep 13 2015 12:40
@AleksandrSidorov works well for me
Fahad Uddin
@FahadUddin92
Sep 13 2015 12:40
@AleksandrSidorov : Whoa! Looks awesome and works fine.
Aleksandr Sidorov
@AleksandrSidorov
Sep 13 2015 12:41
@enggfahd @Coira Thank you!
CamperBot
@camperbot
Sep 13 2015 12:41
aleksandrsidorov sends brownie points to @enggfahd and @coira :sparkles: :thumbsup: :sparkles:
:star: 124 | @enggfahd | http://www.freecodecamp.com/enggfahd
:star: 210 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Sep 13 2015 12:41
:)
Aleksandr Sidorov
@AleksandrSidorov
Sep 13 2015 12:42
Anybody from US to check fahrenheit units display?
Bon
@OriBon
Sep 13 2015 12:43
No units show up for me
APM
@APMerchant
Sep 13 2015 12:43
@enggfahd @zeffii thank you worked for speed...working on the other one
CamperBot
@camperbot
Sep 13 2015 12:43
apmerchant sends brownie points to @enggfahd and @zeffii :sparkles: :thumbsup: :sparkles:
:star: 338 | @zeffii | http://www.freecodecamp.com/zeffii
:star: 125 | @enggfahd | http://www.freecodecamp.com/enggfahd
Aleksandr Sidorov
@AleksandrSidorov
Sep 13 2015 12:44
@OriBonTech Is the temperature valuel itself is close to actual?
Bon
@OriBon
Sep 13 2015 12:50
No the value doesnt show up at all. No numbers.
Aleksandr Sidorov
@AleksandrSidorov
Sep 13 2015 12:54
@OriBonTech It is because your location was not correctly detected by http://ip-api.com/. Could you open this link and verify the City field in a result table?
@OriBonTech Is it (City field value) contains bracers?
Brad cox
@bravo1c
Sep 13 2015 13:47
dont know if anyone cares but i just found this and for me this is super useful. i find it hard to remeber all the type of things i need. http://introcs.cs.princeton.edu/java/11cheatsheet/
uking07
@uking07
Sep 13 2015 14:08
This message was deleted
This message was deleted
Lewis Barham
@lewisbarham
Sep 13 2015 14:15
This message was deleted
This message was deleted
uking07
@uking07
Sep 13 2015 14:17
Just add the MyCar.engines = 1;
proJS
@dssorokin
Sep 13 2015 14:31
hi guys. i have a problem with Bonfire: Seek and Destroy.my code doesn't work, it goes in infinity
function destroyer(arr) {
// Remove all the values
var newarr=[];
for(var i=1;arguments.length;i++){
newarr.push(arguments[i]);
}
for(var j=0;j<newarr.length;j++){
arr=arr.filter(function(item){
return item!=newarr[j];
});
}
return arr;
}
Mateja Trifunovski
@Matko95
Sep 13 2015 14:33
@dssorokin for(var i=1;arguments.length;i++){ you have no limit there, put for(var i=1;i<arguments.length;i++){
uking07
@uking07
Sep 13 2015 14:35
blob
proJS
@dssorokin
Sep 13 2015 14:35
@Matko95 thanks)
CamperBot
@camperbot
Sep 13 2015 14:35
dssorokin sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 280 | @matko95 | http://www.freecodecamp.com/matko95
uking07
@uking07
Sep 13 2015 14:37
Hi guys, it says I'm suppose to make "hello" into a string. Can anyone shed some light?
Florian Peninon
@florianpnn
Sep 13 2015 14:37

"As an example, passing 4 to the function should return 5 because all the odd Fibonacci numbers under 4 are 1, 1, and 3. »

This is wrong right? It would be 1,1,2 and 3 ?

uking07
@uking07
Sep 13 2015 14:37

function reverseString(str) {
return str;
}

reverseString('hello');
var array = reverseString;
reverseString.split(" ");

Mateja Trifunovski
@Matko95
Sep 13 2015 14:38
@florianpnn all odd numbers under 5
Florian Peninon
@florianpnn
Sep 13 2015 14:39
@Matko95 Oh! Yeah now I see, time to wake up! Thanks!
CamperBot
@camperbot
Sep 13 2015 14:39
florianpnn sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
proJS
@dssorokin
Sep 13 2015 14:39
@uking07 you need to do it in function. first of all, make string into array, then reverse it and join
CamperBot
@camperbot
Sep 13 2015 14:39
:star: 281 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Sep 13 2015 14:39
@uking07 you are doing it in the reverseString function, not outside
you can't call a .split on a function
@uking07
function reverseString(str) {
  var array = str;
  str.split(" ");
  return str;
}

reverseString('hello');
you should start like that
uking07
@uking07
Sep 13 2015 14:40
Right, thanks!!
CamperBot
@camperbot
Sep 13 2015 14:40
if you want to thank someone, put an @ before their name!
Lewis Barham
@lewisbarham
Sep 13 2015 14:46
var array = [4,5,6,7,8];
var singleVal = 0;
// Only change code below this line.

var singleVal =
    array.reduce(function(previousVal, currentVal) {

      return
    previousVal+currentVal;

});

// Only change code above this line.
(function() {return singleVal;})();
Any one help with this?
Florian Peninon
@florianpnn
Sep 13 2015 14:48
is there a way to reset a Bonfire from outside its page? I did an infinite loop -_-
Paul Simon Ongpin
@mochiii
Sep 13 2015 14:50
This message was deleted
CamperBot
@camperbot
Sep 13 2015 14:50
if you want to thank someone, put an @ before their name!
Mateja Trifunovski
@Matko95
Sep 13 2015 14:58
@florianpnn just refresh, and don't compile until you fix it
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

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

<p>Things cats love:</p>
<ul>
  <li>cat nip</li>
  <li>laser pointers</li>
  <li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
  <li>flea treatment</li>
  <li>thunder</li>
  <li>other cats</li>
</ol>
<form action="/submit-cat-photo">
  <input type="text" placeholder="cat photo URL">
</form>
<button type="submit">submit</button
This could does not generate any error but does not move to the next exercise too.
Mateja Trifunovski
@Matko95
Sep 13 2015 15:05
@enggfahd first your <button type="submit">submit</button button doesn't have a closing tag ">" and it should be in the form like
<form action="/submit-cat-photo">
  <input type="text" placeholder="cat photo URL">
  <button type="submit">submit</button>
</form>
Florian Peninon
@florianpnn
Sep 13 2015 15:09
This message was deleted
Oleg-docent
@Oleg-docent
Sep 13 2015 15:11
help me please with Waypoint: Make Instances of Objects with a Constructor Function
CamperBot
@camperbot
Sep 13 2015 15:11
no wiki entry for: me please with waypoint make instances of objects with a constructor function
:pencil: click here to create one now!after creating your page type update to reload it here
Mateja Trifunovski
@Matko95
Sep 13 2015 15:12
@Oleg-docent What's wrong
Oleg-docent
@Oleg-docent
Sep 13 2015 15:27
@Matko95 i try create a fuction-constructor , but it doesn' work. What should i write after var myCar = new Car(); ?
Mateja Trifunovski
@Matko95
Sep 13 2015 15:28
@Oleg-docent you need to add number of engines to myCar
@Oleg-docent etc. myCar.engines=1;
Fahad Uddin
@FahadUddin92
Sep 13 2015 15:30
Has anyone completed 800 Hours of Practice?
justindobbs
@justindobbs
Sep 13 2015 15:31
need some help deploying to heroku. the only error in the logs has to do with favicon. would that itself cause it to crash?
Mateja Trifunovski
@Matko95
Sep 13 2015 15:31
yes, some people did
justindobbs
@justindobbs
Sep 13 2015 15:33
i'm also trying to set env variables using package config. is there a particular way of doing that with heroku beside heroku set?
heroku config:set
naxty
@naxty
Sep 13 2015 15:34
hey, someone did bonfire-convert-html entities?
Ammar Ali Shah
@AmmarAliShah
Sep 13 2015 15:35
I've got a question
It's about the first Zipline
Zipline: Build a Personal Portfolio Webpage
@enggfahd Yes - many people did
Hans van Riet
@hansinla
Sep 13 2015 15:37
@AmmarAliShah What’s the question?
Ammar Ali Shah
@AmmarAliShah
Sep 13 2015 15:37
@hansinla Does the webpage have to look the same?
It can look completely different, right?
Fahad Uddin
@FahadUddin92
Sep 13 2015 15:38
@AmmarAliShah : Want to pair program for Personal portfolio webpage?
Hans van Riet
@hansinla
Sep 13 2015 15:38
@AmmarAliShah No, you’re free in the design. The only requirement is that all elements are on one page (no linking to other pages) if I remember correctly.
Oleg-docent
@Oleg-docent
Sep 13 2015 15:40
@Matko95 thank you)
Mateja Trifunovski
@Matko95
Sep 13 2015 15:43
@AmmarAliShah Just make sure you complete the user stories, and experiment with the design
James Becker
@james-becker
Sep 13 2015 15:43
I also have a question about Zipline: Build a Personal Portfolio Webpage..
I'm not seeing the icons from Font Awesome
Mateja Trifunovski
@Matko95
Sep 13 2015 15:43
@Nixoxo yes, why?
James Becker
@james-becker
Sep 13 2015 15:43
help?
CamperBot
@camperbot
Sep 13 2015 15:43

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

Mateja Trifunovski
@Matko95
Sep 13 2015 15:43
@james-becker did you import them?
James Becker
@james-becker
Sep 13 2015 15:43
Ah.
How do I do that in CodePen?
Mateja Trifunovski
@Matko95
Sep 13 2015 15:44
@james-becker <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css">
wontoan
@wontoan
Sep 13 2015 15:44
click the settings icon under html or css and paste the source in there
Hans van Riet
@hansinla
Sep 13 2015 15:44
@james-becker or go to the setting tab, csss and import that link there
James Becker
@james-becker
Sep 13 2015 15:44
Done! Thanks tontoan
CamperBot
@camperbot
Sep 13 2015 15:44
if you want to thank someone, put an @ before their name!
James Becker
@james-becker
Sep 13 2015 15:44
thanks wontoan
CamperBot
@camperbot
Sep 13 2015 15:44
if you want to thank someone, put an @ before their name!
Ammar Ali Shah
@AmmarAliShah
Sep 13 2015 15:44
@enggfahd I'm gonna sleep soon
wontoan
@wontoan
Sep 13 2015 15:45
:)
James Becker
@james-becker
Sep 13 2015 15:45
thanks @wontoan
CamperBot
@camperbot
Sep 13 2015 15:45
james-becker sends brownie points to @wontoan :sparkles: :thumbsup: :sparkles:
:star: 305 | @wontoan | http://www.freecodecamp.com/wontoan
James Becker
@james-becker
Sep 13 2015 15:45
@hansinla I think I'll do it that way, it's cleaner
Isn't it kind of a bad practice to depend on externally-hosted libraries and stylesheets?
What if the source server is down, for example
are FA libraries/stylesheets available to host locally?
Mateja Trifunovski
@Matko95
Sep 13 2015 15:48
@james-becker sure, you could probably download them
James Becker
@james-becker
Sep 13 2015 15:48
Ok
Hans van Riet
@hansinla
Sep 13 2015 15:51
@james-becker No, I link to external libraries all the time, you’ll always have the latest bug fixes and you minimize downloading for the user since the file is probably already in cache.
@james-becker If those CDN-servers would be down system-wide, probably half the internet would be down.
erichoonpark
@erichoonpark
Sep 13 2015 16:00
Hi everyone, I was wondering if people had any ideas for pure vanilla javascript project ideas?
Pierre Wizla
@pwizla
Sep 13 2015 16:04
Hi everyone. Hope you're having fun coding. It's been a few days I'm trying to finish the 'Seek & Destroy' bonfire but I don't manage to do it. I know the solution should be simple, but I can't get it to work. Has anyone finished it and would be kind enough to give me a tip?
To be more precise, I can find a solution but it's not an elegant one and it's not "scalable". It's the first time I don't manage to make a loop working.
James Becker
@james-becker
Sep 13 2015 16:23
@pwizla Seek & Destroy is one of the more difficult bonfires... did you try Bonfire-seek-and-destroy hint?
Pierre Wizla
@pwizla
Sep 13 2015 16:25
Thank you for your reply, @james-becker . No I didn't. Where can I get some hint? I can see a 'Help' button but not a 'Hint' one…
Anyway, I'm approaching the problem with another angle, not using array.filter but array.push, I think it might solve the issue ;)
CamperBot
@camperbot
Sep 13 2015 16:25
pwizla sends brownie points to @james-becker :sparkles: :thumbsup: :sparkles:
:star: 184 | @james-becker | http://www.freecodecamp.com/james-becker
Ali-Haider5
@Ali-Haider5
Sep 13 2015 16:25
This message was deleted
This message was deleted
Dealga McArdle
@zeffii
Sep 13 2015 16:27
@erichoonpark
Ali-Haider5
@Ali-Haider5
Sep 13 2015 16:27
can't get the following right:
Your left-well element should have a red background.
The .parent() method should be called on the #target1 element.
Dealga McArdle
@zeffii
Sep 13 2015 16:28

@erichoonpark

Hi everyone, I was wondering if people had any ideas for pure vanilla javascript project ideas?

You could try to implement a masonry plugin..

max77p
@max77p
Sep 13 2015 16:29
can someone help me with this...how do i pick subindex of an array?
Dealga McArdle
@zeffii
Sep 13 2015 16:29
(given an array of rectangle sizes, arrange them in a way that takes up minimal space )
like: http://www.kristianhammerstad.com/
Pierre Wizla
@pwizla
Sep 13 2015 16:30
Oh, I'm sorry @james-becker, you probably meant I should go the the HelpBonfires chat room. Thanks! :-)
CamperBot
@camperbot
Sep 13 2015 16:30
pwizla sends brownie points to @james-becker :sparkles: :thumbsup: :sparkles:
:warning: pwizla already gave james-becker points
James Becker
@james-becker
Sep 13 2015 16:32
@pwizla you shouldnt have to use Push
Pierre Wizla
@pwizla
Sep 13 2015 16:33
I know… I just don't manage to filter more than one element.
Because the 'return' instruction ends the function.
I don't manage to find how to filter an array, get the filtered array, and filter again the filtered array, not the original one.
naxty
@naxty
Sep 13 2015 16:37
Hey guys, I need your help am I not sure what I have to do here. http://www.freecodecamp.com/challenges/bonfire-sum-all-primes
CamperBot
@camperbot
Sep 13 2015 16:37
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
naxty
@naxty
Sep 13 2015 16:38
when I do sumPrimes(10) do I have to sum the first ten prime numbers?
Dealga McArdle
@zeffii
Sep 13 2015 16:39
@Nixoxo no. only all primes in the range 0... 10
1+3+5+7 ?
naxty
@naxty
Sep 13 2015 16:40
ah ok thanks @zeffii
CamperBot
@camperbot
Sep 13 2015 16:40
nixoxo sends brownie points to @zeffii :sparkles: :thumbsup: :sparkles:
:star: 340 | @zeffii | http://www.freecodecamp.com/zeffii
naxty
@naxty
Sep 13 2015 16:40
1+2+3+5+7+9 so?
without the 1
Dealga McArdle
@zeffii
Sep 13 2015 16:40
not 9.. because that divides by 3
(my bad)
but you have to find a way to calculate primes first :)
naxty
@naxty
Sep 13 2015 16:41
yes, know i see that i have a fault in my calculation :D
Pierre Wizla
@pwizla
Sep 13 2015 16:44
This message was deleted
bonfire seek-and-destroy
CamperBot
@camperbot
Sep 13 2015 16:44

:fire:Bonfire: Seek and Destroy :link:

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

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

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

more info:  bf details | bf links | hint

Pierre Wizla
@pwizla
Sep 13 2015 16:45
This message was deleted
CamperBot
@camperbot
Sep 13 2015 16:45
Sorry, can't find a bonfire called seek-and-destroy hint. [ Check the map? ]
Pierre Wizla
@pwizla
Sep 13 2015 16:45
This message was deleted
CamperBot
@camperbot
Sep 13 2015 16:45
Sorry, can't find a bonfire called seek-and-destroy hint. [ Check the map? ]
Crysicia
@Crysicia
Sep 13 2015 16:45
hint
Pierre Wizla
@pwizla
Sep 13 2015 16:45
bonfire seek-and-destroy
CamperBot
@camperbot
Sep 13 2015 16:45
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:

:fire:Bonfire: Seek and Destroy :link:

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

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

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

more info:  bf details | bf links | hint

Pierre Wizla
@pwizla
Sep 13 2015 16:45
This message was deleted
CamperBot
@camperbot
Sep 13 2015 16:45
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
max77p
@max77p
Sep 13 2015 16:48
array[i][k].sort(function(a,b){return b.length-a.length}); would something like this work?
if i wanted to sort lets say arra[0] from {[0,3,1],[3,4,6]}
Pierre Wizla
@pwizla
Sep 13 2015 16:49
OK, @james-becker I've looked at the solution, found it. Sorry for bothering you, I should have know that there are available hints and solutions in this forum. Thanks for your tips, have a nice day :)
CamperBot
@camperbot
Sep 13 2015 16:49
pwizla sends brownie points to @james-becker :sparkles: :thumbsup: :sparkles:
:warning: pwizla already gave james-becker points
Lewis Barham
@lewisbarham
Sep 13 2015 16:50
This message was deleted
function factorialize(num) {
  return num;
}

factorialize(5);
Any idea how to do this Factorialize a number? I'm finding the challenges a little to unrelated.
Ali-Haider5
@Ali-Haider5
Sep 13 2015 16:52
how to paist my code in blakc like the one above
?
@camperbot
Lewis Barham
@lewisbarham
Sep 13 2015 16:57
@Ali-Haider5 Type 3 back arrows on mac its key on right of left shift.
max77p
@max77p
Sep 13 2015 17:15
function largestOfFour(arr) {
2      var results = [];
3      for (var n in arr) {
4          var largestNumber = 0;
5          for (var sb in arr[n]) {
6              if (arr[n][sb] > largestNumber) {
7                  largestNumber = arr[n][sb];
8              }
9          }
10        results[n] = largestNumber;
11    }
12      return results;
13    }
max77p
@max77p
Sep 13 2015 17:32
can someone explain why there is sb++
yet it iterates throughthis code/
is this another way of doing it?
Oleg-docent
@Oleg-docent
Sep 13 2015 17:36
need help for Waypoint: Reverse Arrays with reverse
Luis Felipe López G.
@luishendrix92
Sep 13 2015 17:36
@max77p For In iterates 1 by 1 through each "property name" of an object. Since arrays are objects which index (hence their property names) names are 0, 1, 2... n
no need to specify sb++, but For in loops aren't recommended for arrays, that's why the for loop is there for. Or you could use forEach.
Florian Peninon
@florianpnn
Sep 13 2015 17:45
Someone to pair program on Smallest Common Multiple ?
Oleg-docent
@Oleg-docent
Sep 13 2015 17:52
no more need help for Waypoint: Reverse Arrays with reverse)
Jose M Viloria
@josevill
Sep 13 2015 17:56
@Oleg-docent What do you need about that one? :)
cblauwkamp
@cblauwkamp
Sep 13 2015 17:56
Hopefully this will be the last time I ask about my portfolio page. The last element, where I have my "contact me" links, isn't working. It's far too large, and the buttons don't go anywhere. Here's the page: http://codepen.io/cblauwkamp/full/xwxNpJ/
And here's the html:
<div class="jumbotron" id="tab3" style="background-image:url(http://i.imgur.com/pM7BKD1.jpg)">
  <h2>                        Contact Me                    </h2>
  <p>
    <div class='row'>
      <div class='col-md-3'>
        <button class='btn btn-block' href='https://twitter.com/cablauw' target='_blank'>Twitter</button>
      </div>
      <div class='col-md-3'>
        <button class='btn btn-block' href='https://www.linkedin.com/pub/chris-blauwkamp/2/986/940' target='_blank'>LinkedIn</button>
      </div>
      <div class='col-md-3'>
        <button class='btn btn-block' href='https://github.com/cblauwkamp' target='_blank'>GitHub</button>
      </div>
      <div class='col-md-3'>
        <button class='btn btn-block' href='http://freecodecamp.com/cblauwkamp' target='_blank'>Free Code Camp</button>
      </div>
    </div>
Jose M Viloria
@josevill
Sep 13 2015 17:57
@cblauwkamp Going to check that one out
cblauwkamp
@cblauwkamp
Sep 13 2015 17:58
Thanks @josevill
CamperBot
@camperbot
Sep 13 2015 17:58
cblauwkamp sends brownie points to @josevill :sparkles: :thumbsup: :sparkles:
:star: 325 | @josevill | http://www.freecodecamp.com/josevill
Jose M Viloria
@josevill
Sep 13 2015 17:59
@cblauwkamp I recommend you to make use of your css files.. Don't declare your style within the element's tags.. Make a class in your css file instead and use it on your elements..
cblauwkamp
@cblauwkamp
Sep 13 2015 18:01
Would that help with this issue? I think all the background images I'm using on the page are the same size.
Jose M Viloria
@josevill
Sep 13 2015 18:03
@cblauwkamp First of all, your "Contact Me" div was out of the "Container" div, so if wouldn't stay within the responsive thing.
Also, i feel like buttons won't do what you want them to do if you don't use the proper stuff.
You can use onClick and window.location.assign
naxty
@naxty
Sep 13 2015 18:07
how can I return in javascript "is not a function"
cblauwkamp
@cblauwkamp
Sep 13 2015 18:08
Thanks @josevill. The div issue fixes things in terms of formatting; I'll try the script for the buttons.
CamperBot
@camperbot
Sep 13 2015 18:08
cblauwkamp sends brownie points to @josevill :sparkles: :thumbsup: :sparkles:
:warning: cblauwkamp already gave josevill points
Rory Smith
@alanbuchanan
Sep 13 2015 18:09
@Nixoxo what bonfire are you referring to?
I do not get how I have to solve 2 and 5
Rory Smith
@alanbuchanan
Sep 13 2015 18:12
@Nixoxo this helped me
naxty
@naxty
Sep 13 2015 18:12
@alanbuchanan thanks :)
CamperBot
@camperbot
Sep 13 2015 18:12
nixoxo sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 338 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Jose M Viloria
@josevill
Sep 13 2015 18:27
@cblauwkamp Are you still there?
cblauwkamp
@cblauwkamp
Sep 13 2015 18:29
@josevill, yeah
Lewis Barham
@lewisbarham
Sep 13 2015 18:38
function factorialize(num) {
  return num;
}

factorialize(5);
How do I complete this factorialize?
Jose M Viloria
@josevill
Sep 13 2015 18:41
@cblauwkamp You could instead of creating button elements, create an A element and give them your desired style.
You want them to look like boostrap buttons? Aight style="btn btn-success btn-yourstyle" and so on :p
cblauwkamp
@cblauwkamp
Sep 13 2015 18:43
Thanks, part of me wants to just use icons, but I'm not sure how that'll look against the background.
CamperBot
@camperbot
Sep 13 2015 18:43
if you want to thank someone, put an @ before their name!
Jose M Viloria
@josevill
Sep 13 2015 18:45
@cblauwkamp The only way to know how they'll look is giving it a try :)
Bitra Balachandra Tejaswi
@BalachandraTejas
Sep 13 2015 19:10
hi, i ran into this same issue(FreeCodeCamp/FreeCodeCamp#2759) but it is not getting resolved on my PC. any help please..
oh reset and re doing resolved it. Sorry to bother you guys. ;)
Eric Hartline
@wildlifehexagon
Sep 13 2015 19:35
does anyone know why this isn't passing for the mutation bonfire?

function mutation(arr) {

  for (var i = 0; i < arr[1].length; i++) {
    if (arr[0].toLowerCase().indexOf(arr[1][i].toLowerCase()) === -1) {
      return false;
    } else {
      return true;
    }
  }

}

mutation(['hello', 'hey']);
Rory Smith
@alanbuchanan
Sep 13 2015 19:41
@wildlifehexagon it's because of how you've set up the return
@wildlifehexagon you'll returntrue straightaway when you test any shared letter, but you have to loop through the entire string first before returning true
Eric Hartline
@wildlifehexagon
Sep 13 2015 19:47
@alanbuchanan ahhh ok, so I'm returning too early
Florian Peninon
@florianpnn
Sep 13 2015 19:48
Can someone explain me why my function allSameValues return true when all the values aren’t equal?
function smallestCommons(arr) {
  arr.sort();
  var expRange = [];

  for(var i = arr[1]; i >= arr[0]; i--){
    expRange.push(i);
  }

  var values = expRange.slice();
  var quot = false;

  while(!quot){
    var indexMinVal = expRange.indexOf(Math.min.apply(0,expRange));
    expRange[indexMinVal] += values[indexMinVal];

    quot = allSameValues(expRange);
    console.log(expRange, quot);
  }
}

function allSameValues(arr){
  for(var i = 1; i < this.length; i++){
    if(this[i] !== this[0])
      return false;
  }

  return true;
}

smallestCommons([1,5]);
It’s like the code skip my for loop :/
Eric Hartline
@wildlifehexagon
Sep 13 2015 19:51
@alanbuchanan thanks, gonna tweak it some more
CamperBot
@camperbot
Sep 13 2015 19:51
wildlifehexagon sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 340 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Rory Smith
@alanbuchanan
Sep 13 2015 19:52
Screen Shot 2015-09-13 at 20.50.51.png
@florianpnn it's testing two 2's
might not be the problem though......
Florian Peninon
@florianpnn
Sep 13 2015 19:52
@alanbuchanan It should return false because of the first 5,4
@alanbuchanan If I do a console.log(i) it doesn’t display anything..
It’s like the for loop doesn’t exist in the code
Matt Yamamoto
@MattYamamoto
Sep 13 2015 19:55
@florianpnn I don't think this is doing what you expect. I think you want to just use the arr argument you are passing in.
Florian Peninon
@florianpnn
Sep 13 2015 19:56
@MattYamamoto Oh yeah! It doesn’t work as I was expecting…! Thanks! Same @alanbuchanan !
CamperBot
@camperbot
Sep 13 2015 19:56
florianpnn sends brownie points to @mattyamamoto and @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 341 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
:star: 325 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Alice
@AliceReid
Sep 13 2015 20:23
I'm stuck at Waypoint: Add Borders Around your Elements. Where in the <img> do I put the code for "border"?
Matt Yamamoto
@MattYamamoto
Sep 13 2015 20:24
@AliceReid You're adding the borders via CSS, so you are going to put that code inside your <style> tags
Alice
@AliceReid
Sep 13 2015 20:25
I did that, but now I'm trying to put the class in <img> and it's not working
Matt Yamamoto
@MattYamamoto
Sep 13 2015 20:26
ah... can you paste in your code so I can see?
Aleksander Gębicki
@Takumar
Sep 13 2015 20:26
@AliceReid you have to create a class between <style> tags and then you have to add this class to your <img> tag.
Just like you did with another tags <h2> or so on...
Alice
@AliceReid
Sep 13 2015 20:27

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

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

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

Aleksander Gębicki
@Takumar
Sep 13 2015 20:27
Just type: <img class="your_class_name" src="path_to_img">
Alice
@AliceReid
Sep 13 2015 20:28
but then it conflicts with "smaller-image"
Matt Yamamoto
@MattYamamoto
Sep 13 2015 20:28
@AliceReid you just need to add the thin-green-border class
you can have multiple classes, just seperate them by spaces
Aleksander Gębicki
@Takumar
Sep 13 2015 20:28
exactly.
Matt Yamamoto
@MattYamamoto
Sep 13 2015 20:28
class="class1 class2"
Alice
@AliceReid
Sep 13 2015 20:29
ah, I see. thank you!
CamperBot
@camperbot
Sep 13 2015 20:29
if you want to thank someone, put an @ before their name!
Alice
@AliceReid
Sep 13 2015 20:29
Thank you @MattYamamoto and @Takumar
CamperBot
@camperbot
Sep 13 2015 20:29
alicereid sends brownie points to @mattyamamoto and @takumar :sparkles: :thumbsup: :sparkles:
:star: 326 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
:star: 313 | @takumar | http://www.freecodecamp.com/takumar
abhijats
@abhijats
Sep 13 2015 20:49
Can anyone help me please. I'm struggling on bonfire mutations. Can't get my code to pass the last two tests, and I can't figure out why:
function mutation (arr) {

firstEle = arr[0];
secondEle = arr[1];

for (var i = 0; i < firstEle.length; i++) {

    if (firstEle[i].indexOf(secondEle[i]) !== -1) {
        return false;
    } else {

        return true;
    }
};

}

mutation(['hello', 'hey']);
CamperBot
@camperbot
Sep 13 2015 20:49
:bulb: to format code use backticks! ``` more info
Moisés Man
@moigithub
Sep 13 2015 20:51
@abhijats move return true at the end of ur for/loop
@abhijats u returning "too soon"
return exit the function / loop
abhijats
@abhijats
Sep 13 2015 20:57
@moigithub I'm not sure how I could check the if outside of the for loop, can you give me a hint?
Moisés Man
@moigithub
Sep 13 2015 20:59
u no need to move ur if..
u just move 1 line return true; to the end of ur loop
u need to check if at least 1 character its not in the other word.. to return false
abhijats
@abhijats
Sep 13 2015 21:02
@moigithub Like so? (sorry I'm not getting it).
That doesn't work and also can I then delete the else?
for (var i = 0; i < firstEle.length; i++) {

    if (firstEle[i].indexOf(secondEle[i]) !== -1) {
        return false;
    } else {


    }
} return true;

}
Rory Smith
@alanbuchanan
Sep 13 2015 21:03
@abhijats just drop the else
Moisés Man
@moigithub
Sep 13 2015 21:03
also.. if u checking secondEle[i] secondElement.. then ur for/loop (i variable) should be based on second element
for (var i = 0; i < firstEle.length; i++) {
should be
for (var i = 0; i < secondEle.length; i++) {
Marie Pelletier
@Marie000
Sep 13 2015 21:13
Does anyone know how to access an API's data outside of the success function? I defined by $.ajax call inside my object prototype method (to avoid having to re-do the same code with every object), but then I need do things with the data for each object. Of course with any function outside the success function, I need to make sure it runs only after the API call is done. I tried using jquery's .done method (also tried .then) and it's not working.
//create user prototype
function user(name,logo,status,streamLink,streamViews,streamGame){
  this.name = name;
  this.logo = logo;
  this.status = status;
  this.streamLink = streamLink;
  this.streamViews = streamViews;
  this.streamGame = streamGame;
  this.getUserInfo = function(userName) {
    this.apiCall = $.ajax({
      dataType: "jsonp",
      url:'https://api.twitch.tv/kraken/users/'+userName+'?callback=?',
      success:function(data){
        this.name = data.display_name;
        this.logo = data.logo;
        this.bio = data.bio;
             // test not working 
      $('.test').html(this.logo);

    }        
  })    
  }
}

//create user for each stream
var freeCodeCamp = new user('freeCodeCamp');
var medrybw = new user('medrybw');
//call getUserInfo function
freeCodeCamp.getUserInfo('freeCodeCamp');
medrybw.getUserInfo('medrybw');


//display medrybw status (test) - not working! 
medrybw.apiCall.done(function(){
  alert('test');
  $('.test2').html(medrybw.bio);
});
(the function that is not working is at the end)
the alert('test'); is working, but not the following line.
oops, I might have posted on the wrong forum.
Stefan Stokic
@StefanStokic
Sep 13 2015 21:18
str.split("").reverse().join("").toLowerCase().replace(/gi/|'.',"");
Can't figure out the proper way to replace punctuation?
Matt Yamamoto
@MattYamamoto
Sep 13 2015 21:19
@Marie000 I can't be 100% sure of what I'm saying.... but I think the issue is with the thiskeyword. The this inside your success function is different than the this outside of it. Maybe try defining a variable var that = this at the top of your user function, then use that in your success function.
Matt Yamamoto
@MattYamamoto
Sep 13 2015 21:25
@KingInTheNorth I don't think you can put a regex and a string as the first argument, I think it's one or the other... that is only one thing can be used as the first argument, so choose either a regex or a string. Additionally, your regex is not what you're expecting (at least I don't think). Play around here and see if that helps: http://regexr.com/
Fábio Paraíso Oliveira
@FabioParaiso
Sep 13 2015 21:37
This message was deleted
This message was deleted
metalek
@metalek
Sep 13 2015 21:43
Does anyone who has done the Pig Latin bonfire want to take a look at my code? I'm passing all the tests but 1 and can't figure out why
Moisés Man
@moigithub
Sep 13 2015 21:49
glove => ove + gl + ay
metalek
@metalek
Sep 13 2015 21:51
@moigithub right, I'm getting "vegloay"
Absalon Castañon Avila
@absalnC
Sep 13 2015 21:52
I keep getting an error on waypoint get set for basejumps. Can somebody help me?
Moisés Man
@moigithub
Sep 13 2015 21:54
@metalek u need to move ALL the consonants u find at start.. (till first vowel) to the end
not only the first one
Absalon Castañon Avila
@absalnC
Sep 13 2015 21:56
thanks @moigithub
CamperBot
@camperbot
Sep 13 2015 21:56
absalnc sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 338 | @moigithub | http://www.freecodecamp.com/moigithub
metalek
@metalek
Sep 13 2015 21:58
@moigithub yes, my code removes all the first consonants in "glove" but then also the first vowel, "o", hence, "vegloay", and I have no idea why because it works for words that begin with only one consonant. If I pm you my code, could you maybe take a look at it?
Jeffery Austin
@jeffaustin81
Sep 13 2015 21:59
Can anyone help me with angular
?
'''
CamperBot
@camperbot
Sep 13 2015 22:00
:bulb: to format code use backticks! ``` more info
Jeffery Austin
@jeffaustin81
Sep 13 2015 22:00

'''
var app = angular.module('chirpApp', []);

app.controller('mainController', function($scope) {
$scope.posts = [];
$scope.newPost = {created_by: '', text: '', created_at: ''};

$scope.post = function() {
    $scope.newPost.created_at = Date.now();
    $scope.posts.push($scope.newPost);
    $scope.newPost = {created_by: '', text: '', created_at: ''};
};

});
'''

CamperBot
@camperbot
Sep 13 2015 22:00
:bulb: to format code use backticks! ``` more info
u can use regex to check vowels /[aeiou]/
Jeffery Austin
@jeffaustin81
Sep 13 2015 22:03
var app = angular.module('chirpApp', []);

app.controller('mainController', function($scope) {
    $scope.posts = [];
    $scope.newPost = {created_by: '', text: '', created_at: ''};

    $scope.post = function() {
        $scope.newPost.created_at = Date.now();
        $scope.posts.push($scope.newPost);
        $scope.newPost = {created_by: '', text: '', created_at: ''};
    };
});
CamperBot
@camperbot
Sep 13 2015 22:03
:trollface: troll problems? notify admins here
Jeffery Austin
@jeffaustin81
Sep 13 2015 22:03
<!doctype html>
<html>
<head>
    <title>Chirp</title>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
    <script src="js/chirpApp.js"></script>
</head>

<body>
    <div id='main' ng-controller='mainController'>
        <form ng-Submit="post()">
            <input required type="text" placeholder="Your name" ng-model="newPost.created_by" />
            <textarea required maxlength="200" rows="3" placeholder="Say something" ng-model="newPost.text"></textarea>
            <input class="button" type="submit" value="Chirp!"/>
        </form>
        <div id="post-stream">
        <h4>Chirp Feed</h4>
            <div class='post' ng-repeat="post in posts | orderBy:'created_at':true" ng-class-odd="'odd'" ng-class-even="'even'">
            <p>{{post.created_by}} says {{post.text}} at {{post.created_at}}</p>
            </div>
      </div>
    </div>
</body>

</html>
CamperBot
@camperbot
Sep 13 2015 22:03
:trollface: troll problems? notify admins here
Jeffery Austin
@jeffaustin81
Sep 13 2015 22:04
My html is displaying everything in the {{}}
{{post.created_by}} says {{post.text}} at {{post.created_at}}
Moisés Man
@moigithub
Sep 13 2015 22:05
@jeffaustin81 open dev tools.. --> console
and check if u have any errors
Jeffery Austin
@jeffaustin81
Sep 13 2015 22:06
I did and I don't
Moisés Man
@moigithub
Sep 13 2015 22:06
in network tab.. do u have any red line ?
probably a 500 (server error) or 404 (file not foun ) errors
Jeffery Austin
@jeffaustin81
Sep 13 2015 22:07
no no redline
Moisés Man
@moigithub
Sep 13 2015 22:07
ahh ok..
Jeffery Austin
@jeffaustin81
Sep 13 2015 22:08
@moigithub Does anything look off in my code?
Moisés Man
@moigithub
Sep 13 2015 22:08
u missing ng-app
Fábio Paraíso Oliveira
@FabioParaiso
Sep 13 2015 22:08
Hi all. Anyone had this doubt? Why does the phone number 6505552368 is not a valid one?
Jeffery Austin
@jeffaustin81
Sep 13 2015 22:08
@moigithub ng-app goes in my main div?
Rory Smith
@alanbuchanan
Sep 13 2015 22:09
@FabioParaiso isnt that the one that starts and ends with brackets?
Jeffery Austin
@jeffaustin81
Sep 13 2015 22:09
I thought the file inclusion would be enough
Fábio Paraíso Oliveira
@FabioParaiso
Sep 13 2015 22:09
Ahah!
Jeffery Austin
@jeffaustin81
Sep 13 2015 22:09
so ng-app="chirpApp"
?
abhijats
@abhijats
Sep 13 2015 22:09
bonfire Mutations
CamperBot
@camperbot
Sep 13 2015 22:09

:fire:Bonfire: Mutations :link:

function mutation(arr) {
  return arr;
}

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

Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array.

more info:  bf details | bf links | hint

Moisés Man
@moigithub
Sep 13 2015 22:09
it should go above ur controller
CamperBot
@camperbot
Sep 13 2015 22:09
:trollface: troll problems? notify admins here
Fábio Paraíso Oliveira
@FabioParaiso
Sep 13 2015 22:09
@alanbuchanan thats it...
abhijats
@abhijats
Sep 13 2015 22:09
hint
<