These are chat archives for FreeCodeCamp/Help

26th
Aug 2015
DTing
@dting
Aug 26 2015 00:00
but to get a user location you can use a geoip service or https://developer.mozilla.org/en-US/docs/Web/API/Navigator/geolocation
http://simpleweatherjs.com/ this has some examples including getting user location i believe
Xchel Hernandez
@xchelm
Aug 26 2015 00:00
Hi, will someone help me with Bonfire Mutation
chriscrosscutler
@chriscrosscutler
Aug 26 2015 00:01
@jarisoft i'm still having trouble... it just isn's working right haha
Marie Pelletier
@Marie000
Aug 26 2015 00:01
thanks @dting I will check that out.
CamperBot
@camperbot
Aug 26 2015 00:01
marie000 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 701 | @dting | http://www.freecodecamp.com/dting
chriscrosscutler
@chriscrosscutler
Aug 26 2015 00:01
function largestOfFour(arr) {

  var arrFinal;

  for (i = 0; i < arr.length; i++)
   {
     for (i = 0; i < arr.length; i++)
       {
         var number = 0;
         if (arr[i] > number)
         {
           var temp = arr[i];
           number = temp;

         }
         arrFinal.push(number);
       }
   }

  return arrFinal;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
@jarisoft here it is
Jakob
@jarisoft
Aug 26 2015 00:02
oooo
look at your indices
use j instead of i in second loop
hang on...
you are actually quite close but you need to work on i'th array of arr in second loop
function largestOfFour(arr) {

  var arrFinal;

  for (var i = 0; i < arr.length; i++)
   {
var temp = arr[i];
     for (var j = 0; j < temp.length; j++)
       {
....
DTing
@dting
Aug 26 2015 00:06
@chriscrosscutler you need to make arrFinal an array too
right now its undefined and you are trying to push to it
chriscrosscutler
@chriscrosscutler
Aug 26 2015 00:06
@dting how do I do that?
chriscrosscutler
@chriscrosscutler
Aug 26 2015 00:07
@jarisoft what do you mean by i'th array?
Jakob
@jarisoft
Aug 26 2015 00:08
array at position i
chriscrosscutler
@chriscrosscutler
Aug 26 2015 00:08
now it says I have an unexpected token (.)
Jakob
@jarisoft
Aug 26 2015 00:10
I am not sure if it makes sense to show you the solution
want to see? learning effect might be smal
small
chriscrosscutler
@chriscrosscutler
Aug 26 2015 00:11
what ever you think is best. I'm down to figure this out, it's just hard to debug in this. is there an IDE i could use that would help me step through my code or something?
Jakob
@jarisoft
Aug 26 2015 00:13
function largestOfFour(arr) {

  var tempArray;
  // array that will be returned by this function
  var returnArray = [];

  for (var i = 0; i < arr.length;i++) {
    tempArray = arr[i];
    var max = -1;
    // go through every i'th array of arr and find largest number. 
    for (var j = 0; j < tempArray.length; j++) {
      if (tempArray[j] > max) {
        max = tempArray[j];
      }
    }
    // push largest number of current array into returnArray
    returnArray.push(max);
  }
  return returnArray;
}
DTing
@dting
Aug 26 2015 00:13
function largestOfFour(arr) {
  var arrFinal; // make this an array instead of undefined

  for (i = 0; i < arr.length; i++) // use var here instead of global i
   {
     for (i = 0; i < arr.length; i++) // use a different var here, also change to iterate over the i'th element of arr (arr[i])
       {
         var number = 0; // this is declared inside the inner loop. so for each iteration it gets set to 0. where should this be moved?
         if (arr[i] > number) // arr[i] refers to [4,5,1,3]  you are comparing that to a 0. you want arr[i][<inner looping variable>] to compare to number
         {
           var temp = arr[i]; // this is an unnecessary declared variable inside the loop number = arr[i][<inner looping variable>];
           number = temp;
         }
         arrFinal.push(number); // you are pushing a number here for every single element. where should this be moved?
       }
   }
  return arrFinal;
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Jakob
@jarisoft
Aug 26 2015 00:31
@chriscrosscutler check out dting's documentation out. He pretty much explained what is wrong with your code
Reggie
@Reggie01
Aug 26 2015 01:05

@chriscrosscutler You can debug in chrome browser by typing your function in the console and adding debugger inside of the function.

function someFunction() {
  debugger; // Make sure to add this line
  var greeting = "hello";
  return greeting;
}

After running the method the browser will jump to the debugger. If you look at the right sidebar at the top you will see buttons to step through the code. It should be similar to using a debugger in a typical IDE. A tip, avoid using console statements with debugger because it takes you into the browser code for console methods or step over console statements.

Patrick McWilliams
@patrickmac110
Aug 26 2015 01:14
I'm having some trouble with this
Bonfire: Where art thou
CamperBot
@camperbot
Aug 26 2015 01:14

:fire:Bonfire: Where art thou :link:

function where(collection, source) {
  var arr = [];
  // What's in a name?
  return arr;
}

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

Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).

more info:  bf details | bf links | hint

Patrick McWilliams
@patrickmac110
Aug 26 2015 01:15
function where(collection, source) {
  var arr = [];
  var x = 0;
  // What's in a name?
  for(x in collection){
    if(collection[x].hasOwnProperty("last")){
      if()
    }
  }
  //return arr;
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });
this is what I have so far
PhilJayN
@PhilJayN
Aug 26 2015 01:16

Anyone having problems with this: http://freecodecamp.com/challenges/waypoint-create-a-javascript-slot-machine

The page keeps constantly refreshing, at least 2 times every 1 second. I've tried 3 different browsers.
The iphone on the right also keeps flashing.

DJ
@qualitymanifest
Aug 26 2015 01:18
I've split a sentence into a string of words, and I'm trying to access the first letter. In a for loop iterating over i, I've tried str[i[0]] and str[i].charAt(0); and neither will do it for me. Can anyone point me in the right direction?
@PhilJayN I just tried loading that page, same thing happened for me. try putting a closing bracket after the images variable. that solved it for me
Patrick McWilliams
@patrickmac110
Aug 26 2015 01:20
I ran through and instead of splitting it into words, I split the whole string into characters then checked if the previos character was a space, if so I
had it capitolize the letter, then mashed the whole thing back into a string
@qualitymanifest
DJ
@qualitymanifest
Aug 26 2015 01:21
@patrickmac110 sounds good. so that even works for the first letter?
Patrick McWilliams
@patrickmac110
Aug 26 2015 01:22
well no, I had a separate function previous to the if statement that just capitalized the arr.charAt(0)
DJ
@qualitymanifest
Aug 26 2015 01:22
@patrickmac110 oh, yeah i should have taken a second to think there. thanks
CamperBot
@camperbot
Aug 26 2015 01:22
qualitymanifest sends brownie points to @patrickmac110 :sparkles: :thumbsup: :sparkles:
:star: 205 | @patrickmac110 | http://www.freecodecamp.com/patrickmac110
Patrick McWilliams
@patrickmac110
Aug 26 2015 01:22
no prob
any help with my problem, guys?
DJ
@qualitymanifest
Aug 26 2015 01:23
@PhilJayN did you try it? it looks like they just forgot to close the function
ZeroDay23
@ZeroDay23
Aug 26 2015 01:23
Hello World
CamperBot
@camperbot
Aug 26 2015 01:23

welcome to FreeCodeCamp @ZeroDay23!

ZeroDay23
@ZeroDay23
Aug 26 2015 01:25
I looked through some of what you guys were talking about and I think i may need to do a LOOOOT more research
Patrick McWilliams
@patrickmac110
Aug 26 2015 01:25
We're all here to help
Davis
@ajdavis56
Aug 26 2015 01:26
I've created a collapsable navigation bar and a button to toggle the menu
Rex Schrader
@SaintPeter
Aug 26 2015 01:26
We're here to help, but you have to be willing to do some reading, too :D You'll learn more that way anyway :D
Davis
@ajdavis56
Aug 26 2015 01:26
the button appears but it does not toggle.
can anyone help me out?
Patrick McWilliams
@patrickmac110
Aug 26 2015 01:29
@SaintPeter any suggestions for getting this to work? am I approaching it wrong?:
function where(collection, source) {
  var arr = [];
  var x = 0;
  // What's in a name?
  for(x in collection){
    if(collection[x].hasOwnProperty("last")){
      if()
    }
  }
  //return arr;
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });
@ajdavis56 show us your code using 3 backticks
formatting wiki
Rex Schrader
@SaintPeter
Aug 26 2015 01:30
@patrickmac110 Well, you can't hard code the property names. There is good news, though, if you want to get a list of property names for an object, you can use:
Object.keys(source);  // returns an array of keys
Patrick McWilliams
@patrickmac110
Aug 26 2015 01:30
@camperbot help
Rex Schrader
@SaintPeter
Aug 26 2015 01:30
wiki format
CamperBot
@camperbot
Aug 26 2015 01:30

: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

``` ⇦ Type 3 backticks, 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

Rex Schrader
@SaintPeter
Aug 26 2015 01:30
@patrickmac110 ;)
commands
CamperBot
@camperbot
Aug 26 2015 01:30

commands:

  • isCommand
  • cbot
  • echo
  • echojson
  • whoami
  • botversion
  • botstatus
  • botenv
  • archive
  • init
  • tooNoisy
  • help
  • menu
  • rooms
  • find
  • commands
  • music
  • announce
  • rollem
  • camperCount
  • welcome
  • hello
  • bob
  • wikiFooter
  • wikiUsage
  • wikiCantFind
  • wiki
  • messages
  • thanks
  • about
  • showInfoCallback
  • update
  • bonfire
  • checkBonfireCommands
  • searchBonfire
  • checkHasBonfire
  • inBonfireRoom
  • hint
  • bf
  • explain
  • bot
  • hi
  • index
  • thank
  • log
  • archives
PhilJayN
@PhilJayN
Aug 26 2015 01:34
@qualitymanifest Codecamp has already provided a closing bracket :
    var images = ["http://i.imgur.com/9H17QFk.png", "http://i.imgur.com/9RmpXTy.png", "http://i.imgur.com/VJnmtt5.png"];
Patrick McWilliams
@patrickmac110
Aug 26 2015 01:36
@SaintPeter how can I find the value corresponding to the key
DJ
@qualitymanifest
Aug 26 2015 01:39
@PhilJayN oops i meant a closing semicolon
either way it doesn't need it after all. the bottom portion of code wasnt showing when i said that. and now its okay and not flashing either way??
PhilJayN
@PhilJayN
Aug 26 2015 01:42
@qualitymanifest It's weird because it's not flashing anymore. I'm so curious as to why things don't work sometime lol
Omar
@oab00
Aug 26 2015 01:42
@patrickmac110
object.key => value
or
object[key] => value
JackAcid
@jack-acid
Aug 26 2015 01:48
Basic Algorithm Scripting 16: Bonfire Seek and Destroy refers to Array.filter(), but I am struggling with the optional thisarg parameter. Is that the way to send a value to check against the array?
function destroyer(arr) {

  var arg = Array.prototype.slice.call(arguments);

  function isNotEqual(element, value) {
    return element !== value;
  }


  for (var i = 1; i < arg.length; i++) {
    arg[0] = arg[0].filter(isNotEqual, arg[i]);
  }

  return arg[0];
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Kurt Johnson
@pompan129
Aug 26 2015 01:50
anyone know where to get the freeCodeCamp icon? preferabley as a font.
chriscrosscutler
@chriscrosscutler
Aug 26 2015 01:56
@Reggie01 Thanks!
function end(str, target) {
  var length = str.length;
  var lastLetter = str.substr(length);
  if (lastLetter === target)
    {
      return true;
    }
}

end('Bastian', 'n');
am I overlooking something here? It should compare the last letter of a string to a target letter to see if they match and then return true if they do.
Omar
@oab00
Aug 26 2015 01:57
@jack-acid use this.valueOf() in the isNotEqual comparison instead of value
since u're using thisarg
@chriscrosscutler
'Bastian'.length => 7
but 'Bastian'[7] => undefined
since indices start at 0
chriscrosscutler
@chriscrosscutler
Aug 26 2015 02:07
@oab00 Ok, I fixed that and it passed bastian but failed the other test cases
Hans van Riet
@hansinla
Aug 26 2015 02:07
@chriscrosscutler The target isn’t necessarily only one character, so you’ll need to adjust your code to deal with a target.length > 1
Elliescode
@EllieAdam
Aug 26 2015 02:10
Q

To do this, we omit the word this from the property or method declaration.

See if you can keep myBike.speed and myBike.addUnit private, while making myBike.getSpeed publicly accessible.

chriscrosscutler
@chriscrosscutler
Aug 26 2015 02:12
function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  var lengthOfTar = target.length;
  var length = str.length;
  var number = length - lengthOfTar;
  var lastLetter = str.substr(number);
  if (lastLetter === target)
    {
      return true;
    }
}

end('Bastian', 'n');
@hansinla ok, I did that but it's still failing other cases.
Elliescode
@EllieAdam
Aug 26 2015 02:12
var Bike = function() {
  // Only change code below this line.
  Bike.speed = 100;
  function Bike.addUnit(value) {
    return(value + "KM/H");
  }

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

};
JackAcid
@jack-acid
Aug 26 2015 02:14
thanks, @oab00. It works, now I just have to suss out why. : )
CamperBot
@camperbot
Aug 26 2015 02:14
jack-acid sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 226 | @oab00 | http://www.freecodecamp.com/oab00
@oab00 can you look at my Q??
Omar
@oab00
Aug 26 2015 02:16
@EllieAdam u want to make speed and addUnit private ?
use var if that's the case!
Rex Schrader
@SaintPeter
Aug 26 2015 02:19

@EllieAdam as @oab00 says, use var:

var speed = 100;

Then it can only be accessed by methods like getSpeed

DJ
@qualitymanifest
Aug 26 2015 02:20

I want to use a regex metacharacter in a boolean expression like:

if ( str[j] === /\w/ )

It doesn't work. is that something you just can't do, or am I doing it wrong?

Elliescode
@EllieAdam
Aug 26 2015 02:20
What about addUnit? leave it alone?
Rex Schrader
@SaintPeter
Aug 26 2015 02:23
@qualitymanifest To use a regular expression use RegExp.test or RegExp.match.
/\w/.test(str[j]); // returns true or false
m66n
@m66n
Aug 26 2015 02:27
I'm doing 'Waypoint: Get Set for Basejumps' and running into DaftMonk/generator-angular-fullstack#1197. Should I upgrade node to 0.12 on my Cloud 9 instance?
how come [title]|(link) doesn't seem to work? here's the link to the bug report:
https://github.com/DaftMonk/generator-angular-fullstack/issues/1197
Patrick McWilliams
@patrickmac110
Aug 26 2015 02:29
I'm so confused! HELP
function where(collection, source) {
  var arr = [];
  var x = 0;
  var y = 0;
  var kysc = Object.keys(collection);
  var kyss = Object.keys(source);
  // What's in a name?
  for(x = 0; x<collection.length; x++){
      if(kyss[0] == kysc[0] ){
         arr.push(collection[x]);
         }

  }
  //return arr;
  return kysc;
}

where([{ 'a': 1 }, { 'a': 2 }, { 'a': 3, 'b': 2 }], { 'a': 1 });
Elliescode
@EllieAdam
Aug 26 2015 02:30
Q.
Patrick McWilliams
@patrickmac110
Aug 26 2015 02:30
I'm normally returning arr but it's not going through the forloop but once
Elliescode
@EllieAdam
Aug 26 2015 02:31
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.

this.engines = 1;

// Only change code above this line.
(function() {return(JSON.stringify(myCar));})();
Need help on last one.
assert(typeof(myCar.engines) === 'number', 'The property engine of myCar should be a number');The property engine of myCar should be a number
Omar
@oab00
Aug 26 2015 02:31

@EllieAdam addUnit either

function addUnit(value) {
    return value + "KM/H";
}

or

var addUnit = function(value) {
    return value + "KM/H";
};
Elliescode
@EllieAdam
Aug 26 2015 02:32
@oab00 For this 2Q??
@oab00 How to write this 2Q. It wants 'number' of engine. I did
DJ
@qualitymanifest
Aug 26 2015 02:34
@SaintPeter Hmm okay. Haven't quite gotten it yet but that helps, thanks
CamperBot
@camperbot
Aug 26 2015 02:34
qualitymanifest sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 346 | @saintpeter | http://www.freecodecamp.com/saintpeter
Elliescode
@EllieAdam
Aug 26 2015 02:34
this.engines = 1;
Omar
@oab00
Aug 26 2015 02:34
this isn't inside a function .. it doesn't refer to myCar
var person = {
    name: 'oab'
};

person.age = 20;
person becomes
{
    name: 'oab',
    age: 20
}
Reggie
@Reggie01
Aug 26 2015 02:36
@patrickmac110 You have your keys from the source. kyss So now you have to look for the key in each object in the collection.
Patrick McWilliams
@patrickmac110
Aug 26 2015 02:37
like this:
function where(collection, source) {
  var arr = [];
  var x = 0;
  var y = 0;
  var lengths = [];

  for(var m = 0; m<collection.length; m++){
    lengths.push(collection[m].length);
  }
  y = Math.max.apply(lengths);

  var kysc = Object.keys(collection[y]);
  var kyss = Object.keys(source);

  // What's in a name?
  for(x = 0; x<collection.length; x++){
      if(kyss[0] == kysc[x] ){
         arr.push(collection[x]);
         }

  }

  return arr;
}

where([{ 'a': 1 }, { 'a': 2 }, { 'a': 3, 'b': 2 }], { 'a': 1 });
but that's not working
chriscrosscutler
@chriscrosscutler
Aug 26 2015 02:37
function repeat(str, num) {

  var empty;
  if (num < 0)
    {
      return empty;
    }
  var newStr = str;
  var repeat;

  for (var i = 0; i <= num; i++)
    {
      repeat = newStr + str;
    }

  return repeat;
}

repeat('abc', 3);
this should add strings together as many times as (num) or return an empty string if num is less than 0. What am I missing?
Reggie
@Reggie01
Aug 26 2015 02:38
@patrickmac110 your changing your code. You had the logic almost right earlier.
chriscrosscutler
@chriscrosscutler
Aug 26 2015 02:39
@hansinla @Reggie01 Thanks for your help today!
CamperBot
@camperbot
Aug 26 2015 02:39
chriscrosscutler sends brownie points to @hansinla and @reggie01 :sparkles: :thumbsup: :sparkles:
:star: 320 | @hansinla | http://www.freecodecamp.com/hansinla
:star: 151 | @reggie01 | http://www.freecodecamp.com/reggie01
Patrick McWilliams
@patrickmac110
Aug 26 2015 02:39
but it was only passing through the if statement once because my keys weren't right
Reggie
@Reggie01
Aug 26 2015 02:39
correct
so then you needed to run a check against the value
Elliescode
@EllieAdam
Aug 26 2015 02:40
Screen Shot 2015-08-25 at 7.39.25 PM.png
Reggie
@Reggie01
Aug 26 2015 02:40
kyss is returning an array
Elliescode
@EllieAdam
Aug 26 2015 02:40
Screen Shot 2015-08-25 at 7.39.49 PM.png
@oab00 I get one wrong or other!
Patrick McWilliams
@patrickmac110
Aug 26 2015 02:40
sowhat's wrong with this?
function where(collection, source) {
  var arr = [];
  var x = 0;
  var y = 0;
  var kysc = Object.keys(collection[0]);
  var kyss = Object.keys(source);
  // What's in a name?
  for(x in collection){
      if(kyss[0] == kysc[x] ){
         arr.push(collection[x]);
         }

  }
  //return arr;
  return arr;
}

where([{ 'a': 1 }, { 'a': 2 }, { 'a': 3, 'b': 2 }], { 'a': 1 });
Reggie
@Reggie01
Aug 26 2015 02:40
so if you want the key from the array what would you do next?
Omar
@oab00
Aug 26 2015 02:41
@EllieAdam u have ur object myCar you can add values to it using
object.key = value;
Reggie
@Reggie01
Aug 26 2015 02:42
Yeah so kyss is an array. So how would you get the key from the array?
Omar
@oab00
Aug 26 2015 02:42
@EllieAdam consider engines is a key and value is 1
Patrick McWilliams
@patrickmac110
Aug 26 2015 02:43
kyss[0]
Omar
@oab00
Aug 26 2015 02:43
@patrickmac110 who u kissin? ಠ_ಠ
Reggie
@Reggie01
Aug 26 2015 02:43
yea so then earlier you had
collection[x].hasOwnProperty( _
so you can pass kyss[0] to hasOwnProperty method
Omar
@oab00
Aug 26 2015 02:44
@EllieAdam you can't use this.engines outside the function but u can use myCar.engines :)
Reggie
@Reggie01
Aug 26 2015 02:44
Then if that is true, what do you need to look for next?
Hint: It's the second half of the question in the bonfire.
CamperBot
@camperbot
Aug 26 2015 02:46
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Patrick McWilliams
@patrickmac110
Aug 26 2015 02:46
do I need another if statement
Elliescode
@EllieAdam
Aug 26 2015 02:47
@oab00 I completely lost.
Reggie
@Reggie01
Aug 26 2015 02:47
yes you can add another if statement
Elliescode
@EllieAdam
Aug 26 2015 02:47
This message was deleted
Omar
@oab00
Aug 26 2015 02:47
no no don't use this outside the function
use myCar.engines :p
Kurt Johnson
@pompan129
Aug 26 2015 02:48
@EllieAdam thanks!
CamperBot
@camperbot
Aug 26 2015 02:48
pompan129 sends brownie points to @ellieadam :sparkles: :thumbsup: :sparkles:
:star: 1110 | @ellieadam | http://www.freecodecamp.com/ellieadam
Elliescode
@EllieAdam
Aug 26 2015 02:49
@oab00 Where I am adding this line(myCar.engines)
@pompan129 U welcome!
Omar
@oab00
Aug 26 2015 02:49
you have a lot of points! o_O
Patrick McWilliams
@patrickmac110
Aug 26 2015 02:49
@Reggie01 how do I compare in an argument the corresponding values to the keys
Omar
@oab00
Aug 26 2015 02:50
@EllieAdam you can use myCar instead of this so it becomes myCar.engines = 1 :)
Reggie
@Reggie01
Aug 26 2015 02:50
===
Elliescode
@EllieAdam
Aug 26 2015 02:50
I tried it. But doesn't work!
Patrick McWilliams
@patrickmac110
Aug 26 2015 02:51
// What's in a name?
  for(x in collection){
      if(collection[x].hasOwnProperty(kyss[0])){
        if(source[0]===collection[x])
         arr.push(collection[x]);
         }

  }
Omar
@oab00
Aug 26 2015 02:51
oh.. really?! :O
can u link me the waypoint?
Reggie
@Reggie01
Aug 26 2015 02:52
@patrickmac110 source[0] would get you get index 0 from an array. For objects you use the key. so object.key or object[key]
Omar
@oab00
Aug 26 2015 02:52
@EllieAdam needs a semi-colon ;
myCar.engines = 1; should work :thumbsup:
Eric
@tsaifoon
Aug 26 2015 02:53
anyone free to help me?
Victoria3015
@vgibson15
Aug 26 2015 02:54
I was hoping to get some assistance with exercise 17 or the Create a class called smaller-image and use it to resize the image so that it's only 100 pixels wide.
Elliescode
@EllieAdam
Aug 26 2015 02:54
@oab00 I tried same code ten times with ; Didn't work but now finally working. THANKS!!
CamperBot
@camperbot
Aug 26 2015 02:54
ellieadam sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 228 | @oab00 | http://www.freecodecamp.com/oab00
Omar
@oab00
Aug 26 2015 02:55
anytime ^^
Elliescode
@EllieAdam
Aug 26 2015 02:55
What's your Name @oab00 ?
Omar
@oab00
Aug 26 2015 02:55
it's Omar :)
Elliescode
@EllieAdam
Aug 26 2015 02:55
Nice to meet you Omar!
Omar
@oab00
Aug 26 2015 02:56
aww thank you! nice to meet u as well, ellie ^^
CamperBot
@camperbot
Aug 26 2015 02:56
if you want to thank someone, put an @ before their name!
Patrick McWilliams
@patrickmac110
Aug 26 2015 02:56
@Reggie01 I can't call it by name because the key is liable to change
Reggie
@Reggie01
Aug 26 2015 02:57
@patrickmac110 So your key is kyss[0] so it should be source[kyss[0]]
Jonathan Kvicky
@jonkvix
Aug 26 2015 02:57
Anybody else having issues w/ "Run Code" button functionality not working?
Ah, got it. Just worked after a few refreshes.
Eric
@tsaifoon
Aug 26 2015 02:58
Can someone help me with the .replace function?
Elliescode
@EllieAdam
Aug 26 2015 02:59
@oab00 I have lots of point because I am with fcc since 01-01-15 :) But Sometime I don't code....
Omar
@oab00
Aug 26 2015 02:59
sure @tsaifoon what's the problem?
Patrick McWilliams
@patrickmac110
Aug 26 2015 02:59
for(x in collection){
      if(collection[x].hasOwnProperty(kyss[0])){
         if(source[kyss[0]]===collection[kysc[x]]){
           arr.push(collection[x]);
         }
      }
  }
like this? (ps thanks for walking me through this, I feel so helpless with this one) @Reggie01
CamperBot
@camperbot
Aug 26 2015 02:59
patrickmac110 sends brownie points to @reggie01 :sparkles: :thumbsup: :sparkles:
:star: 152 | @reggie01 | http://www.freecodecamp.com/reggie01
Omar
@oab00
Aug 26 2015 03:00
@EllieAdam oh wow! I've been here since may so only 3-4 months :sweat_smile:
Eric
@tsaifoon
Aug 26 2015 03:00
So i was working on the palindromes
i got .replace to replace a space with nothing
but the moment i try to replace ", or ." the ones supposedly false
are now wrong
Reggie
@Reggie01
Aug 26 2015 03:01
@patrickmac110 ok so collection is array of objects. So if you want the object how would change your third line
Hint look at line 2
CamperBot
@camperbot
Aug 26 2015 03:01
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Omar
@oab00
Aug 26 2015 03:01
@tsaifoon are you using regex to replace them or ?
Patrick McWilliams
@patrickmac110
Aug 26 2015 03:01
@tsaifoon use this .replace(/[.,!@#$%\^&\*()\-_=+]|\s/g, '')
Eric
@tsaifoon
Aug 26 2015 03:02
SUCCESS
wait but
any idea why mine errored
it didn't make sense to me
Omar
@oab00
Aug 26 2015 03:02
hmm dunno what that vertical bar does .. try .replace(/[.,!@#$%\^&\*()\-_=+\s]/g, '') ?
wait what xD
Eric
@tsaifoon
Aug 26 2015 03:02
so is space
\s?
Patrick McWilliams
@patrickmac110
Aug 26 2015 03:02
the vertical bar is an OR operator
Omar
@oab00
Aug 26 2015 03:02
yeah
Patrick McWilliams
@patrickmac110
Aug 26 2015 03:03
and yes
Omar
@oab00
Aug 26 2015 03:03
but u don't want or you want to replace them all!
Eric
@tsaifoon
Aug 26 2015 03:03
right right
how do i show u my code
I'm just curious why it didn't work
Patrick McWilliams
@patrickmac110
Aug 26 2015 03:03
regex is a search, so it searches for the rest or a space
idk, it worked for mine
Elliescode
@EllieAdam
Aug 26 2015 03:04
@tsaifoon Screen Shoot!
Omar
@oab00
Aug 26 2015 03:04
@tsaifoon copy paste!
u can use formatting help ctrl + shift + m
Patrick McWilliams
@patrickmac110
Aug 26 2015 03:05
@Reggie01 to just if(source[kyss[0]]===collection[x]){ right?
HayleeNeal
@HayleeNeal
Aug 26 2015 03:05
http://codepen.io/HayleeNeal/pen/doEXjg why am I getting a white box around my About me element? I don't really understand what I could have done differently there.
Patrick McWilliams
@patrickmac110
Aug 26 2015 03:05
that's what I thought earlier anyways, it doesnt work
Eric
@tsaifoon
Aug 26 2015 03:05

function palindrome(str) {
// Good luck!

str = str.toLowerCase();

str = str.replace(/ /g, '');

str = str.replace(/./g, '');

str = str.replace(/,/g, '');

var rev = "";

for( var i = str.length - 1 ; i >= 0; i--)
{
rev += str[i];
}

if( str == rev)
{
return true;
}

else
return false;

}

palindrome("eye");

Patrick McWilliams
@patrickmac110
Aug 26 2015 03:06
wiki format
CamperBot
@camperbot
Aug 26 2015 03:06

:point_right: code formatting [wiki]

Inline code

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

Code Block

``` ⇦ Type 3 backticks, 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

Patrick McWilliams
@patrickmac110
Aug 26 2015 03:06
try that, @tsaifoon it'll help everyone annd their mother read your code here
Reggie
@Reggie01
Aug 26 2015 03:07
ok, so now we have the object in the array collection[x] so now we can look at the key collection[x][kyss0]
Eric
@tsaifoon
Aug 26 2015 03:07
function palindrome(str) {
  // Good luck!

  str = str.toLowerCase();

  str = str.replace(/ /g, '');

  str = str.replace(/./g, '');

  str = str.replace(/,/g, '');

  var rev = "";

  for( var i = str.length - 1 ; i >= 0; i--)
    {
      rev += str[i];
    }

  if( str == rev)
  {
  return true;
  }

  else
    return false;


}

palindrome("eye");
Omar
@oab00
Aug 26 2015 03:07
@tsaifoon right so return gets u out of the loop right away so it doesn't really do the loop
Eric
@tsaifoon
Aug 26 2015 03:07
thanks patrick
CamperBot
@camperbot
Aug 26 2015 03:08
if you want to thank someone, put an @ before their name!
Eric
@tsaifoon
Aug 26 2015 03:08
@patrickmac110 thanks!
CamperBot
@camperbot
Aug 26 2015 03:08
tsaifoon sends brownie points to @patrickmac110 :sparkles: :thumbsup: :sparkles:
:star: 209 | @patrickmac110 | http://www.freecodecamp.com/patrickmac110
Reggie
@Reggie01
Aug 26 2015 03:08
Hmm, the brackets disappeared
collection[x][kyss[0]]
Eric
@tsaifoon
Aug 26 2015 03:08
sorry @oab00 what do you mean?
Omar
@oab00
Aug 26 2015 03:09
u wouldn't want to return false in the loop if u caught a letter that is not correct to the condition
but only return true if the loop is finished with all letters
Patrick McWilliams
@patrickmac110
Aug 26 2015 03:09
@Reggie01 and that's what i'm supposed to push to my arr correct?
Omar
@oab00
Aug 26 2015 03:09
so just put return true outside the for loop :)
Eric
@tsaifoon
Aug 26 2015 03:10
ohhhhh
ic ic
Omar
@oab00
Aug 26 2015 03:10
@tsaifoon wait
lol
Reggie
@Reggie01
Aug 26 2015 03:10
no yet, we're checking for the values
not yet
post your code again
Patrick McWilliams
@patrickmac110
Aug 26 2015 03:11
function where(collection, source) {
  var arr = [];
  var x = 0;
  var y = 0;
  var kysc = Object.keys(collection[0]);
  var kyss = Object.keys(source);
  // What's in a name?
  for(x in collection){
      if(collection[x].hasOwnProperty(kyss[0])){
         if(source[kyss[0]]===collection[x][kyss[0]]){
           arr.push(collection[x]);
         }
      }
  } 

  return arr;
}

where([{ 'a': 1 }, { 'a': 2 }, { 'a': 3, 'b': 2 }], { 'b': 1 });
Omar
@oab00
Aug 26 2015 03:11
@tsaifoon ok so have u tried console.log? :sweat_smile:
Stephen
@step11angelo
Aug 26 2015 03:11

guys need help creating new p elemet around a element, i have this but it's wrong :

<p> click here for
<a href="http://www.catphotoapp.com">cat photos
</a>
</p>

Omar
@oab00
Aug 26 2015 03:11
@tsaifoon I just did and it seems like both ur strings are COMPLELTY EMPTY !!
Eric
@tsaifoon
Aug 26 2015 03:12
oh weird...
i have not tried console.log
Omar
@oab00
Aug 26 2015 03:12
str = str.replace(/./g, ''); <- this is the fault
Patrick McWilliams
@patrickmac110
Aug 26 2015 03:12
it passes now! ...and my brain hurts... thanks again @Reggie01
CamperBot
@camperbot
Aug 26 2015 03:12
patrickmac110 sends brownie points to @reggie01 :sparkles: :thumbsup: :sparkles:
:warning: patrickmac110 already gave reggie01 points
Eric
@tsaifoon
Aug 26 2015 03:12
how come?
Omar
@oab00
Aug 26 2015 03:12
. inside regex like this means EVERYTHING
Eric
@tsaifoon
Aug 26 2015 03:12
OH
D:
so it doesn't take period
Omar
@oab00
Aug 26 2015 03:12
YES! u done messed up TSAIFOON !
Eric
@tsaifoon
Aug 26 2015 03:12
how can i fix that
hahahaha
Omar
@oab00
Aug 26 2015 03:13
use \. instead
Patrick McWilliams
@patrickmac110
Aug 26 2015 03:13
@tsaifoon use a backslash like this /\./g
Omar
@oab00
Aug 26 2015 03:13
to escape the dot :)
Patrick McWilliams
@patrickmac110
Aug 26 2015 03:13
what @oab00 said...
Eric
@tsaifoon
Aug 26 2015 03:13
ohhh icic
Omar
@oab00
Aug 26 2015 03:13
xD
Eric
@tsaifoon
Aug 26 2015 03:14
@oab00 @patrickmac110 thank you so much for your help!
CamperBot
@camperbot
Aug 26 2015 03:14
tsaifoon sends brownie points to @oab00 and @patrickmac110 :sparkles: :thumbsup: :sparkles:
:warning: tsaifoon already gave patrickmac110 points
:star: 229 | @oab00 | http://www.freecodecamp.com/oab00
HayleeNeal
@HayleeNeal
Aug 26 2015 03:14
http://codepen.io/HayleeNeal/pen/doEXjg can anyone help me figure out why there's a white line across my about me element?
Francis Ngo
@francisngo
Aug 26 2015 03:14
my carousel is not working
can someone take a look into the code?
Stephen
@step11angelo
Aug 26 2015 03:14

guys need help creating new p elemet around a element, i have this but it's wrong :

<p> click here for
<a href="http://www.catphotoapp.com">cat photos
</a>
</p>

Patrick McWilliams
@patrickmac110
Aug 26 2015 03:15
@HayleeNeal is a Pirate! "across me element!" Arghh
HayleeNeal
@HayleeNeal
Aug 26 2015 03:16
@patrickmac110 ?
Patrick McWilliams
@patrickmac110
Aug 26 2015 03:17
Why ye be givin me that questionin' eye, you scallywag?!
Reggie
@Reggie01
Aug 26 2015 03:17
@patrickmac110 ok, glad you passed. For future references objects would use for .. in loops https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in
arrays you should use for loops https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for if index order matters
John Irle
@JohnIrle
Aug 26 2015 03:18
Could someone help me figure out why my code is returning undefined?
Matt Everson
@matteverson
Aug 26 2015 03:19
@doudeman Sure, post the code.
Patrick McWilliams
@patrickmac110
Aug 26 2015 03:19
@HayleeNeal ...ohh "across the 'about me' element" ... sorry, that you're not a real pirate
i can't read
John Irle
@JohnIrle
Aug 26 2015 03:19
var quote =["filled", "with", "strings"];
var filt = [];

var filter = function(){
  for(var i = 0; i< quote.length; i++){
    filt.push(quote[i + 1]);
  }
  console.log(filt);
};
Trying to select every other item in the array
Harishankar Ayandev
@harishankards
Aug 26 2015 03:20
hello everyone! I'm just stuck in bonfire : Reverse a String.
Patrick McWilliams
@patrickmac110
Aug 26 2015 03:21
@doudeman use i+=2 in your for loop
Matt Everson
@matteverson
Aug 26 2015 03:21
@doudeman You should return something at the end of your function, say right after the console.log() line
John Irle
@JohnIrle
Aug 26 2015 03:21
I tried that and it said that it was an illegal return
Harishankar Ayandev
@harishankards
Aug 26 2015 03:22

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

reverseString('hello');

Matt Everson
@matteverson
Aug 26 2015 03:22
@doudeman return filt; doesn't work?
Harishankar Ayandev
@harishankards
Aug 26 2015 03:22
this doesn't work.
help anybody?
@doudeman , @matteverson
John Irle
@JohnIrle
Aug 26 2015 03:23
Now I'm getting Uncaught SyntaxError: Unexpected token )
at Object.InjectedScript._evaluateOn (<anonymous>:905:140)
at Object.InjectedScript._evaluateAndWrap (<anonymous>:838:34)
at Object.InjectedScript.evaluate (<anonymous>:694:21)
Omar
@oab00
Aug 26 2015 03:23
@HayleeNeal hey
Matt Everson
@matteverson
Aug 26 2015 03:23
@harishankards I think you want to assign your first line to something. str.split() doesn't work in-place, it returns a value.
@doudeman post the new code please
Omar
@oab00
Aug 26 2015 03:24

@HayleeNeal

html {
  background: url(https://images.unsplash.com/photo-1430132594682-16e1185b17c5?q=80&fm=jpg&s=a70abbfff85382d11b03b9bbc71649c3) no-repeat center center fixed;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

change html to body in this instance

then it's all fixed :)
Harishankar Ayandev
@harishankards
Aug 26 2015 03:24
thanks @matteverson ! fixed
CamperBot
@camperbot
Aug 26 2015 03:24
harishankards sends brownie points to @matteverson :sparkles: :thumbsup: :sparkles:
:star: 287 | @matteverson | http://www.freecodecamp.com/matteverson
Stephen
@step11angelo
Aug 26 2015 03:25
guys need help with this:
<p> click here for
<a href="http://www.catphotoapp.com">cat photos
</a>
</p>
says create new p element around your a element but says i did it wrong
Elliescode
@EllieAdam
Aug 26 2015 03:27
Q
Omar
@oab00
Aug 26 2015 03:27
@francisngo hey
John Irle
@JohnIrle
Aug 26 2015 03:27
var quote = ["various", "items", "are", "in", "here"];
var filt = [];

var filter = function(){
  for(var i = 0; i< quote.length; i+=2){
    filt.push(quote[i]);
  }
  console.log(filt); 
};
now showing undefined again
Omar
@oab00
Aug 26 2015 03:27
@francisngo u need to include jQuery !
Elliescode
@EllieAdam
Aug 26 2015 03:28
This message was deleted
This message was deleted
Omar
@oab00
Aug 26 2015 03:28
same Q? :o
Elliescode
@EllieAdam
Aug 26 2015 03:29
My answer is [2,3,4,5,6]; but it is wrong!
Omar
@oab00
Aug 26 2015 03:29
u linked wrong code :cry:
Matt Everson
@matteverson
Aug 26 2015 03:29
@doudeman I'd expect something like this
var quote = ["various", "items", "are", "in", "here"];
var filt = [];

var filter = function(){
  for(var i = 0; i< quote.length; i+=2){
    filt.push(quote[i]);
  }
  console.log(filt); 
  return filt;
};
Omar
@oab00
Aug 26 2015 03:30
why i += 2 ?
Elliescode
@EllieAdam
Aug 26 2015 03:30
Screen Shot 2015-08-25 at 8.30.05 PM.png
HayleeNeal
@HayleeNeal
Aug 26 2015 03:30
@oab00 thanks so much!
CamperBot
@camperbot
Aug 26 2015 03:30
hayleeneal sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 230 | @oab00 | http://www.freecodecamp.com/oab00
John Irle
@JohnIrle
Aug 26 2015 03:31
Still getting undefined
Elliescode
@EllieAdam
Aug 26 2015 03:31
Need to clean old SS.
Omar
@oab00
Aug 26 2015 03:31
no probs!
@EllieAdam it should be [4, 5, 6, 7, 8]
DJ
@qualitymanifest
Aug 26 2015 03:32
@step11angelo what part is it saying you did wrong?
Elliescode
@EllieAdam
Aug 26 2015 03:32
Okay.  return(val+3);
Omar
@oab00
Aug 26 2015 03:33
think so
John Irle
@JohnIrle
Aug 26 2015 03:35
This is frustrating
Brett Guillory
@kurzninja
Aug 26 2015 03:36
Hmmmm
CSS question y'all
is there a way I can create a fixed size div, but have it centered on the page regardless of the size of the viewport?
even if that viewport is smaller than the dimensions of the div?
Prashanth Chandra
@prashcr
Aug 26 2015 03:37
I'm struggling with Exercise 12 of Functional Programming, by jhusain..any tips?
Omar
@oab00
Aug 26 2015 03:37
@doudeman what's the problem?
Prashanth Chandra
@prashcr
Aug 26 2015 03:38
@kurzninja What's the current behavior?
Omar
@oab00
Aug 26 2015 03:38
@kurzninja margin: 0 auto; !
Brett Guillory
@kurzninja
Aug 26 2015 03:39
the div is just sitting up against the left side of the viewport
margins didn't seem to affect it
oh
Omar
@oab00
Aug 26 2015 03:40
well u need display: inline-block; with it too
Brett Guillory
@kurzninja
Aug 26 2015 03:40
i had a height: 100% and that didn't seem to work
that's the problem
I want a bunch of divs that are all centered on the center of the viewport, but set to fixed widths
and 100% tall
I want these divs to be independent on the page from everything else
Francis Ngo
@francisngo
Aug 26 2015 03:44
how do i add jquery @oab00
into codepen?
nvm i see what you mean!
Brett Guillory
@kurzninja
Aug 26 2015 03:45
@francisngo click on the gear on the JS editor and you can add jQuery there
Francis Ngo
@francisngo
Aug 26 2015 03:45
thanks @oab00 @kurzninja
CamperBot
@camperbot
Aug 26 2015 03:45
francisngo sends brownie points to @oab00 and @kurzninja :sparkles: :thumbsup: :sparkles:
:star: 231 | @oab00 | http://www.freecodecamp.com/oab00
:star: 308 | @kurzninja | http://www.freecodecamp.com/kurzninja
Francis Ngo
@francisngo
Aug 26 2015 03:45
got it!
ZeroDay23
@ZeroDay23
Aug 26 2015 03:47

Alright I've done a decent bit of reading over the past few hours and i have been stuck on this one issue. It has to be a simple fix but im just getting started and im not sure how to solve 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;
}
.smaller-image { width: 100px;}
</style>

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

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

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

How do i make the image smaller?
Brett Guillory
@kurzninja
Aug 26 2015 03:48
@oab00 but those are still inline, I need them statically fixed on the page so they don't move related to the actual content
Omar
@oab00
Aug 26 2015 03:48
wat? if u want blocks then they stack on top of each other
@kurzninja u could use bootstrap
Brett Guillory
@kurzninja
Aug 26 2015 03:51
I do want them to stack on top of each other
I just need the borders of them to show
wontoan
@wontoan
Aug 26 2015 03:51
This message was deleted
Brett Guillory
@kurzninja
Aug 26 2015 03:52
I'm trying to create a bunch of boxes that are the sizes of different viewports, like iPhone4, iPhone5, iPad, common desktop resolutions, etc
and have them transparent except for dashed borders
so if you're on an iPhone4, all you'll see is the iPhone4 size
but if you're on a 1920 x 1080 desktop, you'll see them all
all centered on the page
apparently, "height: 100%" is not something you can do in CSS I'm now learning
at least for something that's not bounded by something else
ahhh, got it!
had to give both the body and html elements heights of 100% also
Brett Guillory
@kurzninja
Aug 26 2015 03:59
what I'm trying to do may not be possible :\
Prashanth Chandra
@prashcr
Aug 26 2015 04:00
I'm trying to do Exercise 12 of http://jhusain.github.io/learnrx/
What am I doing wrong?
return movieLists.map(function(cat) {
    return cat.videos.map(function(vid) {
      return vid.boxarts.filter(function(boxart) {
        return boxart.width == 150;
      }).map(function(boxart) {
        return {id: vid.id, title: vid.title, boxart: boxart.url};
      }).concatAll();
    });
  }).concatAll();
Omar
@oab00
Aug 26 2015 04:01
@kurzninja 2responsive4me :/
Brett Guillory
@kurzninja
Aug 26 2015 04:01
lol
@oab00 I appreciate you trying, but I'm trying to achieve something very specific
Lux3
@Lux3
Aug 26 2015 04:02
@prashcr I don't think that is part of FCC so it is unlikely you will get help with it if you can't provide an idea of what you are trying to do.
Prashanth Chandra
@prashcr
Aug 26 2015 04:02
It is a part of FCC
Or at least it was
Lux3
@Lux3
Aug 26 2015 04:03
Which part?
DJ
@qualitymanifest
Aug 26 2015 04:03
i just completed "title case a sentence" but i feel like my code might be overcomplicated. anybody willing to look it over for me and give me their thoughts?
Prashanth Chandra
@prashcr
Aug 26 2015 04:03
Functional programming waypoints
Lux3
@Lux3
Aug 26 2015 04:03
I am not that far along yet so I won't be of any help.
Omar
@oab00
Aug 26 2015 04:04
@prashcr you're getting empty arrays :o
Matt Everson
@matteverson
Aug 26 2015 04:04
@prashcr I'd move that over to repl.it and add some console.log() statements to see what's going on
Lux3
@Lux3
Aug 26 2015 04:04
@qualitymanifest send me a pm
Brett Guillory
@kurzninja
Aug 26 2015 04:05
@oab00 I figured it out, thanks to Stackoverflow
CamperBot
@camperbot
Aug 26 2015 04:05
kurzninja sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 232 | @oab00 | http://www.freecodecamp.com/oab00
Brett Guillory
@kurzninja
Aug 26 2015 04:05
I needed a position: fixed
Omar
@oab00
Aug 26 2015 04:05
lol nice
Brett Guillory
@kurzninja
Aug 26 2015 04:06
and margin: 0 auto;
but along with that, you have to set the left and right values also
which are 0
Omar
@oab00
Aug 26 2015 04:06
I hate css ...
Brett Guillory
@kurzninja
Aug 26 2015 04:06
so this:
    top: 0;
    left: 0;
    right: 0;
    width: 500px;
    margin: 0 auto;
Omar
@oab00
Aug 26 2015 04:06
never works the way u intend -.-
Brett Guillory
@kurzninja
Aug 26 2015 04:06
I would just love to know WHY that works
what's the logic behind that
ya know?
Omar
@oab00
Aug 26 2015 04:07
can u show me the whole thing?
and how u gon put 3 of them together?
Brett Guillory
@kurzninja
Aug 26 2015 04:09
sure
let me finish adding a few
Ramesh Tamang
@rameshtmg
Aug 26 2015 04:09
i am stucked in first lesson of javascript. what do i do?
DJ
@qualitymanifest
Aug 26 2015 04:10
thanks @Lux3 @matteverson
CamperBot
@camperbot
Aug 26 2015 04:10
qualitymanifest sends brownie points to @lux3 and @matteverson :sparkles: :thumbsup: :sparkles:
:star: 221 | @lux3 | http://www.freecodecamp.com/lux3
:star: 289 | @matteverson | http://www.freecodecamp.com/matteverson
that's not what it looks like
stupid preview
Lux3
@Lux3
Aug 26 2015 04:11
my pleasure! :thumbsup:
Omar
@oab00
Aug 26 2015 04:15
@kurzninja aah nice :)
Brett Guillory
@kurzninja
Aug 26 2015 04:15
the idea is to show what different viewport sizes look like on the page
I'll have to @media query them to display:none if the viewport gets too small or else they'll all just butt up against the left side
Brett Guillory
@kurzninja
Aug 26 2015 04:30
crap, these CSS text 2D transforms aren't working at all
Greg Thomas
@DipstickJimmy
Aug 26 2015 04:30
I know this is super basic stuff but why wouldn't this work to factorialize a number?
function factorialize(num) {
  return num!;
}

factorialize(5);
Pranav Doshi
@pranavdoshi
Aug 26 2015 04:31
css transforms are not still widely accepted by all browsers
Brett Guillory
@kurzninja
Aug 26 2015 04:31
well surely they work in Chrome, since they're obviously working in all of the examples that I see
Pranav Doshi
@pranavdoshi
Aug 26 2015 04:31
@DipstickJimmy you have write the code
Brett Guillory
@kurzninja
Aug 26 2015 04:31
just not in mine in Codepen
Pranav Doshi
@pranavdoshi
Aug 26 2015 04:31
ohh @kurzninja
Matt Everson
@matteverson
Aug 26 2015 04:31
@DipstickJimmy ! isn't a factorial operator in JS. It's just binary-not
Greg Thomas
@DipstickJimmy
Aug 26 2015 04:32
@pranavdoshi
@matteverson
Pranav Doshi
@pranavdoshi
Aug 26 2015 04:32
try figuring out @DipstickJimmy
Greg Thomas
@DipstickJimmy
Aug 26 2015 04:32
Gotcha. I just misunderstood the directions.
Pranav Doshi
@pranavdoshi
Aug 26 2015 04:32
cool np :)
Greg Thomas
@DipstickJimmy
Aug 26 2015 04:32
Thanks @pranavdoshi
Thanks @matteverson
CamperBot
@camperbot
Aug 26 2015 04:32
dipstickjimmy sends brownie points to @pranavdoshi and @matteverson :sparkles: :thumbsup: :sparkles:
:star: 190 | @pranavdoshi | http://www.freecodecamp.com/pranavdoshi
:star: 290 | @matteverson | http://www.freecodecamp.com/matteverson
Pranav Doshi
@pranavdoshi
Aug 26 2015 04:33
wc
Brett Guillory
@kurzninja
Aug 26 2015 04:33
oh, I think I know why it's not working
I have it applied to a span, which is not a block element
tada
sure enough, that did it
Pranav Doshi
@pranavdoshi
Aug 26 2015 04:34
ohh nice u figured out
hey @kurzninja can u tell me wat hav u done on codepen
i want to know some ideas to start using codepen
some help would be appreciated
Brett Guillory
@kurzninja
Aug 26 2015 04:35
I'm using Codepen for the Zipline projects
Pranav Doshi
@pranavdoshi
Aug 26 2015 04:35
ohh so ahead in fcc html css projects are der?
Brett Guillory
@kurzninja
Aug 26 2015 04:35
my only complete one right now is my Random Quote Generator
yes
Pranav Doshi
@pranavdoshi
Aug 26 2015 04:35
cool
Brett Guillory
@kurzninja
Aug 26 2015 04:35
they're called Ziplines
I'll show you the one I finished
Pranav Doshi
@pranavdoshi
Aug 26 2015 04:35
just now i am on basic js
way ahead still
Pranav Doshi
@pranavdoshi
Aug 26 2015 04:37
n ice work
kudos
Brett Guillory
@kurzninja
Aug 26 2015 04:51
ha, this is working pretty nicely now
Prashanth
@dgprashanth
Aug 26 2015 04:52
Guys, Anyone knows if I should be importing something to get ScrollSpy to work on codepen?
TIA
CrystalClarity
@CrystalClarity
Aug 26 2015 04:53
Guys Please help me on Waypoint: Iterate over Arrays with map. I can't figure out what I am supposed to do.
//Use map to add three to each value in the array
var array = [1,2,3,4,5];
// Only change code below this line.
array = array.map(function(val){
  return(val+1);
});


// Only change code above this line.
(function() {return(array);})();
Nnxoxo
@Nnxoxo
Aug 26 2015 04:57
@CrystalClarity, array = array.map(function(val){ return(val+3); });
John Irle
@JohnIrle
Aug 26 2015 04:58
I'm geting an illegal token error on this code
$(document).ready(function() {      
  $(#quote).onClick(function(){
    var x = Math.floor(Math.random() * 6) + 1;
    $('.quote').text(quote[x]); 
    $('.auth').text(auth[x]);
    })
});
CrystalClarity
@CrystalClarity
Aug 26 2015 04:59
Oh Alright mate
Thanks @Nnutthowze !
Much appreciation
CamperBot
@camperbot
Aug 26 2015 04:59
crystalclarity sends brownie points to @nnutthowze :sparkles: :thumbsup: :sparkles:
:star: 281 | @nnutthowze | http://www.freecodecamp.com/nnutthowze
John Irle
@JohnIrle
Aug 26 2015 04:59
Never mind
Though it isn't working
I fixed the missing quotes around #quote
John Irle
@JohnIrle
Aug 26 2015 05:14
Could someone help me with how I take an array and use jQuery to put it into a web page?
Or more specifically one item from an array
Carl Springer
@haironfire
Aug 26 2015 05:15
function findLongestWord(str) {
    str = str.split(' ').sort(function(a, b){return b-a});
    return str[0].length;
}

findLongestWord('The quick brown fox jumped over the lazy dog');
Any hints on the above Bonfire for Longest Word?
The results say '3' for this example. Correct answer is '6' for 'jumped'.
John Irle
@JohnIrle
Aug 26 2015 05:19
I used a for loop
DJ
@qualitymanifest
Aug 26 2015 05:21
@haironfire I'm still fairly new to this, but I'm past that one and I cannot understand what your code is doing there. From what I can tell though, str[0] is the first word, "the", which is why return str[0].length; is 3
can you help me understand what your function inside the main findLongestWord function does?
Brett Guillory
@kurzninja
Aug 26 2015 05:22
well, @haironfire is sorting the array before that
Carl Springer
@haironfire
Aug 26 2015 05:22
@qualitymanifest ; I thought it was taking the first value of the sorted array, which is sorted in descending order. Oh, wait. It is alphabetical order, not numerical.
Brett Guillory
@kurzninja
Aug 26 2015 05:23
try changing your sort function to something like return a.length > b.length
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 05:25
Hi, I'm checking for a palindrome in Bonfire
I got a problem with completing the last part of the palindrome task
assert.deepEqual(palindrome("almostomla"), false);
expected true to deeply equal false
Carl Springer
@haironfire
Aug 26 2015 05:25
Hmm.. I think I will go back to a FOR loop approach. I don't get SORTing yet.
Let's see your code, @jhsherk1995
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 05:26
function palindrome(str) {
// Good luck!
str.replace(/,/g,'');
str.split(" ").join();
var lowerCaseStr = str.toLowerCase();
for (var i=0; i=lowerCaseStr.length-1; i++)
{
if (lowerCaseStr[i] == lowerCaseStr[lowerCaseStr.length-1-i])
{
return true;
}
else if (lowerCaseStr[i]!==lowerCaseStr[lowerCaseStr.length-1-i])
{
return false;
}
}
}
The other alternative is to use "else" after the "if" I wrote. However it's still the same
Carl Springer
@haironfire
Aug 26 2015 05:28
On the first line, you need to assign that to a variable. Then apply your split and join operators on that variable.
Brett Guillory
@kurzninja
Aug 26 2015 05:28
any jQuery gurus hanging out here?
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 05:29
@haironfire what do you mean by "that"?
Carl Springer
@haironfire
Aug 26 2015 05:29
Plus @jhsherk1995 you need to search for more than just a comma.
Here is my first few lines
```
DJ
@qualitymanifest
Aug 26 2015 05:30
@haironfire yeah, i used a for loop approach. yours is interesting though, i like the idea. so far with many of the bonfires i have completed i've felt like there was a better way
Carl Springer
@haironfire
Aug 26 2015 05:31
function palindrome(str) {
  // Good luck!

  clean_text = str.replace(/[^a-zA-Z]/g,'').toLowerCase(); // clean out and lower case
@jhsherk1995 see about for 'that'
Brett Guillory
@kurzninja
Aug 26 2015 05:32
what he's saying is that str.replace() doesn't mutate a string in place, it returns a new one
so you have to assign that returned string to a variable
you can never mutate a string, only return new ones
Carl Springer
@haironfire
Aug 26 2015 05:32
exaclty @kurzninja
kurzninja @kurzninja thumbs up
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 05:33
OOH. I get it now
Thanks!
CamperBot
@camperbot
Aug 26 2015 05:33
if you want to thank someone, put an @ before their name!
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 05:33
thanks @haironfire and @kurzninja !!
CamperBot
@camperbot
Aug 26 2015 05:33
jhsherk1995 sends brownie points to @haironfire and @kurzninja :sparkles: :thumbsup: :sparkles:
:star: 309 | @kurzninja | http://www.freecodecamp.com/kurzninja
:star: 210 | @haironfire | http://www.freecodecamp.com/haironfire
DJ
@qualitymanifest
Aug 26 2015 05:35
does freecodecamp ditch your previous solutions after a little while? i'm looking back on some bonfires i did just yesterday, and my solutions arent there anymore. just wondering if i should save them for reference
CrystalClarity
@CrystalClarity
Aug 26 2015 05:36
I wonder what is wrong with my code for Waypoint: Make Instances of Objects with a Constructor Function. Could someone help me please?
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.
 engines: 1;
Brett Guillory
@kurzninja
Aug 26 2015 05:39
take your myCar object, and add the "engines" property to it
set to the value 1
myCar['engines'] = 1;
CrystalClarity
@CrystalClarity
Aug 26 2015 05:42
@kurzninja Alright mate,
I got it
Thank You!
CamperBot
@camperbot
Aug 26 2015 05:42
crystalclarity sends brownie points to @kurzninja :sparkles: :thumbsup: :sparkles:
:star: 310 | @kurzninja | http://www.freecodecamp.com/kurzninja
Brett Guillory
@kurzninja
Aug 26 2015 05:43
do you understand what you did there?
DTing
@dting
Aug 26 2015 05:43
@haironfire
function findLongestWord(str) {
    str = str.split(' ').sort(function(a, b){return b.length - a.length;});
    return str[0].length;
}

findLongestWord('The quick brown fox jumped over the lazy dog');
Brett Guillory
@kurzninja
Aug 26 2015 05:44
you created a new Car object by calling new Car()
DTing
@dting
Aug 26 2015 05:44
you need to compare the lengths
Brett Guillory
@kurzninja
Aug 26 2015 05:44
so it automatcially had the "wheels" property, then you added a new property to it
Cody Welsh
@CWelshE
Aug 26 2015 05:44
Hey, guys. Anyone have experience with Alpha-Beta Pruning?
CrystalClarity
@CrystalClarity
Aug 26 2015 05:46
I understand now! thank you for the explanation
CamperBot
@camperbot
Aug 26 2015 05:46
if you want to thank someone, put an @ before their name!
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 05:49

Eh, @kurzninja I'm still getting the same error with this code. The last objective is incomplete.
function palindrome(str) {
// Good luck!
var clean_text = str.replace(/[^a-zA-Z]/g,'').toLowerCase();
var clean_text1 = clean_text.replace(/./g,"");
var clean_text2 = clean_text1.replace(/,g/,"");
var final_clean_text = clean_text2.split(" ").join();
for (var i=0; i=final_clean_text.length-1; i++)
{
if (final_clean_text[i] !== final_clean_text[final_clean_text.length-i-1])
{
return false;
}
return true;
}
}

palindrome("nope");

function palindrome(str) {
  // Good luck!
  var clean_text = str.replace(/[^a-zA-Z]/g,'').toLowerCase();
  var clean_text1 = clean_text.replace(/./g,"");
  var clean_text2 = clean_text1.replace(/,g/,"");                                     
  var final_clean_text = clean_text2.split(" ").join();
  for (var i=0; i=final_clean_text.length-1; i++)
    {
      if (final_clean_text[i] !== final_clean_text[final_clean_text.length-i-1])
        {
          return false;
        }
      return true;
    }
}


palindrome("nope");
Brett Guillory
@kurzninja
Aug 26 2015 05:50
what error are you getting?
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 05:50
assert.deepEqual(palindrome("not a palindrome"), false);
expected true to deeply equal false
assert.deepEqual(palindrome("nope"), false);
expected true to deeply equal false
assert.deepEqual(palindrome("almostomla"), false);
expected true to deeply equal false
Maybe I'm just not getting something. Feel like a noob with this easy task! :(
DTing
@dting
Aug 26 2015 05:52
@jhsherk1995
function palindrome(str) {
// Good luck!
var clean_text = str.replace(/[^a-zA-Z]/g,'').toLowerCase();
var clean_text1 = clean_text.replace(/./g,"");
var clean_text2 = clean_text1.replace(/,g/,""); // looks like a typo here
var final_clean_text = clean_text2.split(" ").join();
for (var i=0; i=final_clean_text.length-1; i++)
{
if (final_clean_text[i] !== final_clean_text[final_clean_text.length-i-1])
{
return false;
}
return true;
}
}
palindrome("nope");
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 05:52
Ah I see!
DTing
@dting
Aug 26 2015 05:52
also you reversed your string then when you check you check if the reversed index is ==
you already reversed the string you should check if the same index is ==
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 05:53
Ah, alright. This makes more sense now!
Thanks @kurzninja !
CamperBot
@camperbot
Aug 26 2015 05:53
jhsherk1995 sends brownie points to @kurzninja :sparkles: :thumbsup: :sparkles:
:warning: jhsherk1995 already gave kurzninja points
DTing
@dting
Aug 26 2015 05:56
@jhsherk1995
var clean_text1 = clean_text.replace(/./g,"");
var clean_text2 = clean_text1.replace(/,g/,""); // looks like a typo here
these lines are redundant you already strip all characters that aren't A-Za-z
Hans van Riet
@hansinla
Aug 26 2015 05:57
@jhsherk1995 Look where your return true; statement is.
DTing
@dting
Aug 26 2015 05:58
ah yes. nice catch
Nnxoxo
@Nnxoxo
Aug 26 2015 06:12
@dting sup... I'm reading https://github.com/angular/angular.js/wiki/Understanding-Scopes and I have an issue. Could u help?
DTing
@dting
Aug 26 2015 06:12
sure
Nnxoxo
@Nnxoxo
Aug 26 2015 06:13
@dting, I think it will be easier to you opent the document and find a phrase: "Typing (say, "99") into the second input textbox does not result in a new child property. Because tpl2.html binds the model to an object property, prototypal inheritance kicks in when the ngModel looks for object myObject -- it finds it in the parent scope."
DTing
@dting
Aug 26 2015 06:15
k one sec
k what is the question?
Nnxoxo
@Nnxoxo
Aug 26 2015 06:17
@dting, could u explain what is the difference between adding in previous example 77 and in this one 99? The situations are identical. I understand how they got 77, but what to say about 99, I expected to see the same result for ChildScope2.myPrimitive = 99;
DTing
@dting
Aug 26 2015 06:18
ya the primitive is immutable
so lets say you have
$scope.a = 1;
$scope.b = {};

// html

<input ng-model="a">
<input ng-model="b.something">
so typing something into the first input you replace what $scope.a is referencing with another primitive.
in the second input you would just replace the value of the $scope.b object's something
Nnxoxo
@Nnxoxo
Aug 26 2015 06:23
@dting but if I wanna add smth could I do it
DTing
@dting
Aug 26 2015 06:23
$scope.b is still referencing the same object as before.
Nnxoxo
@Nnxoxo
Aug 26 2015 06:23
?
@dting or I have a pointer only for this array/object?
DTing
@dting
Aug 26 2015 06:24
add something?
sure you can do whatever you want as long as a parent scope has that object
what is an example of what you want to do?
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 06:26
I just saw the example up a few scrolls regarding the Bonfire - Longest Word task
There was a code using sort
Nnxoxo
@Nnxoxo
Aug 26 2015 06:27
This message was deleted
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 06:27
Is there another way you can make the function work without sort?
Nnxoxo
@Nnxoxo
Aug 26 2015 06:27
@dting it's not correct
@dting when I write <input ng-model="b.something"> do I have a possibility to interact with b model noy only with its property?
DTing
@dting
Aug 26 2015 06:29
interact with it where?
i guess the answer is yes
like what you mean? display the entire object?
{{ b }} would show the entire object
Nnxoxo
@Nnxoxo
Aug 26 2015 06:30

@dting

$scope.a = 10;

model b has:
something
a

and <input ng-model="b.something">

Meher Chandan
@meherchandan
Aug 26 2015 06:32
Can anyone help me with Bonfire: Where art thou exercise.. Not sure what to do..
CamperBot
@camperbot
Aug 26 2015 06:32
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Joe Toh Djojo
@joseph-tohdjojo
Aug 26 2015 06:32
anyone willing to help me with the forismatic api for my quote machine.. im having trouble figuring out how to make a proper request and get back json or html
DTing
@dting
Aug 26 2015 06:32
@jhsherk1995 ya you can just loop over each word and track the longest word
thats O(n) rather than using sort which would be O(n log n)
@mrhamburger here i made a demo http://codepen.io/dting/pen/PqrZgb
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 06:34
@dting Supposedly the split() function creates an array. Hence I created an array variable to be
var arrayOfStrings = str.split(" ");
DTing
@dting
Aug 26 2015 06:34
that just gives you each word in an array
since you stripped all the spaces earlier
GitterBotX
@GitterBotX
Aug 26 2015 06:35
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
CamperBot
@camperbot
Aug 26 2015 06:35
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 06:35
But apparently when I try to access arrayOfStrings by arrayOfStringsi, it says that isn't defined arrayOfStringsi
*arrayOfStrings[i]
DTing
@dting
Aug 26 2015 06:36
@jhsherk1995 you are splitting on spaces you want to probably split on empty string "" if you want each character
Nnxoxo
@Nnxoxo
Aug 26 2015 06:36
@dting, nvm... I understood all... big thanks!
CamperBot
@camperbot
Aug 26 2015 06:36
nnutthowze sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 703 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 26 2015 06:38
@Nnutthowze sure. ya the scope stuff is a bit confusing to read but when you jump into it it makes a lot more sense.
@jhsherk1995 what's your code look like now?
Nnxoxo
@Nnxoxo
Aug 26 2015 06:38
@dting it's very good, that there is an awesome wiki on github
Joe Toh Djojo
@joseph-tohdjojo
Aug 26 2015 06:38
@dting thanks but that doesnt help me much. i still dont know why or how the syntax works and what each line does
CamperBot
@camperbot
Aug 26 2015 06:38
mrhamburger sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 704 | @dting | http://www.freecodecamp.com/dting
Joe Toh Djojo
@joseph-tohdjojo
Aug 26 2015 06:42
ive read those but i still dont know how to format the request. like the url on line 3 of @dting code. i thought it was as simple as copying and pasting the POST on the forismatic api doc but i see you’ve added ‘?’. i havent read anything about that
what does the ? do?
Nnxoxo
@Nnxoxo
Aug 26 2015 06:44
@mrhamburger,
Have u opened this http://forismatic.com/en/api/?
Joe Toh Djojo
@joseph-tohdjojo
Aug 26 2015 06:44
yes
DTing
@dting
Aug 26 2015 06:45
$.getJSON uses a get request
the ? are request parameters

This is a shorthand Ajax function, which is equivalent to:

$.ajax({
  dataType: "json",
  url: url,
  data: data,
  success: success
});

Data that is sent to the server is appended to the URL as a query string. If the value of the data parameter is a plain object, it is converted to a string and url-encoded before it is appended to the URL.

Most implementations will specify a success handler:

Rowan
@rowansen
Aug 26 2015 06:47
Hey everyone do think the lesson is buggy is morning or is my coding not correct?
Capture.PNG
DTing
@dting
Aug 26 2015 06:48
@rowansen your left well didnt get the css. your left-well's parent did
choose a child of left well as the selector (you are using .parent()) on the initial selector
Rowan
@rowansen
Aug 26 2015 06:49
ok
thanks
CamperBot
@camperbot
Aug 26 2015 06:49
if you want to thank someone, put an @ before their name!
Rowan
@rowansen
Aug 26 2015 06:49
@dting thanks forgot hehe
CamperBot
@camperbot
Aug 26 2015 06:49
rowansen sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 705 | @dting | http://www.freecodecamp.com/dting
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 06:52
Not trying to get an array for each individual char. Trying to get it so that each array index has a word. Something is wrong below
function findLongestWord(str) {
  var sentence = str;

  var arrayOfStrings = sentence.split(" ");
  var numOfWords = arrayOfStrings.length;
  var longestWord = '';
  for (var i=0; i=numOfWords; i++)
    for (var j=1; j=numOfWords; j++)
      {
        if (arrayOfStrings[i].length > arrayOfStrings[j].length)
          {
            continue;
          }
        else
          {
            longestWord = arrayOfStrings[j];
          }
      }
  return longestWord.length
}

findLongestWord('The quick brown fox jumped over the lazy dog');
DTing
@dting
Aug 26 2015 06:53
@jhsherk1995 oh sorry i thought you were working on another bf. let me take a look
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 06:53
It's cool. No worries
DTing
@dting
Aug 26 2015 06:53
@jhsherk1995 ya you dont want 2 for loops. you only want 1 for loop
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 06:54
alright
DTing
@dting
Aug 26 2015 06:54

if i have an array of words:

['hi', 'hello', 'bye', 'welcome', 'a']

think of how you would find the longest word in your head

Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 06:55
@dting I understand what I have to logically do, however, at the moment I have an error message saying this:
"arrayOfStrings[i] is not defined"
*undefined
Trying to figure that out first
DTing
@dting
Aug 26 2015 06:56
oh
i see
your forloops is malformed
you are assigning a value to i in the comparison section
and that value is outside the array index since array's are 0 indexed
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 06:57
Ah I see
I guess I have to change it to
for (var i=0; i<arrayOfStrings.length; i++)
DTing
@dting
Aug 26 2015 06:59
ya
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 07:00
Alrighty then. Thanks again!
CamperBot
@camperbot
Aug 26 2015 07:00
if you want to thank someone, put an @ before their name!
Derek Frankel
@TuvyaYis
Aug 26 2015 07:36
why is it that some simple functions you can callback with a console.log? Where as some functions will give you an "undefined" result if you try the same approach?
DTing
@dting
Aug 26 2015 07:37
what you mean?
Derek Frankel
@TuvyaYis
Aug 26 2015 07:37

var divideByThree = function(number) {

var val = number / 3;

console.log(val);

};

divideByThree(6);

whereas if you write...
console.log(divideByThree(6)):
is a no go?
DTing
@dting
Aug 26 2015 07:39
@TuvyaYis your function doesn't have a return statement so it returns undefined
so console.log logs undefined

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined

A function returns undefined if a value was not returned.

Derek Frankel
@TuvyaYis
Aug 26 2015 07:43
tho it has a callback
some really basic syntax and functional understandings are killing me
DTing
@dting
Aug 26 2015 07:57
what do you mean it has a call back?
Derek Frankel
@TuvyaYis
Aug 26 2015 07:57
divideByThree(6);
what's thd difference between a callback and return?
DTing
@dting
Aug 26 2015 08:02
@TuvyaYis that looks like a good article.
Derek Frankel
@TuvyaYis
Aug 26 2015 08:04
i was at a meetup earlier going over functions, which can have parameters, and a callback. So we were pairing and using an 'array' , and 'callback' as parameters to .push a multiplyByTwo function onto the array. It was very simple to understand... tho ive been having, tho def'ly less trouble than previous, retaining the syntax format
and my phone didn't have enough battery to get a picture of it and now i can't solve the problem again
DTing
@dting
Aug 26 2015 08:16
@TuvyaYis i think you are misusing the term callback.
DJ Nixon
@tGxcoder
Aug 26 2015 08:17
Generate random whole number.
DTing
@dting
Aug 26 2015 08:18

im guessing your multiplyByTwo function had a "return" value.

function multiplyByTwo(somethingToMultiply) {
  return somethingToMultiply * 2;
}

here "somethingToMultiply" is a parameter. the function's "return value" or the function "returns" the result..

DJ Nixon
@tGxcoder
Aug 26 2015 08:19
return(Math.random()); Math. Floor(Math.random()*10);
What am I doing wrong. Sorry. I'm on my phone
DTing
@dting
Aug 26 2015 08:19
@tGxcoder replace the Math.random() inside the () with the code you have after the ;
DJ Nixon
@tGxcoder
Aug 26 2015 08:21
@dting thanks
CamperBot
@camperbot
Aug 26 2015 08:21
tgxcoder sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 707 | @dting | http://www.freecodecamp.com/dting
DJ Nixon
@tGxcoder
Aug 26 2015 08:21
Now I wanna know what happened when I tried that earlier. And @dting lol do you sleep man
DTing
@dting
Aug 26 2015 08:22
what you did earlier just returns the code in the parenthesis the code after never is reached
ya im about to head out
DJ Nixon
@tGxcoder
Aug 26 2015 08:23
Ok. Thanks again man.
CamperBot
@camperbot
Aug 26 2015 08:23
if you want to thank someone, put an @ before their name!
Geri Escandor
@geriesc
Aug 26 2015 08:27
Hey. There's something wrong with FCC on my end. When I click on a Waypoint under jQuery, it refreshes by itself. It reloads but at the same time, a pop-up is there saying I'm done and I can move on to the next lesson when I'm not.
Is this a problem with my laptop or FCC?
Derek Frankel
@TuvyaYis
Aug 26 2015 08:28
@dting yeh i may be
Geri Escandor
@geriesc
Aug 26 2015 08:30
I literally can finish jQuery without doing the actual work. The system just keeps saying I'm done.
Derek Frankel
@TuvyaYis
Aug 26 2015 08:41
anyone up for a quick .push question please?
Mbos95
@Mbos95
Aug 26 2015 08:43
Hey guys. anyone can check if I have my code correct? It doesn't work and i am out of guesses
var Hello = "Hello";
var Howdy = "Howdy";
var Earth = "Greetings from Earth";

function reverseString(Letter, seperator) {
  var Arrayofletters = Letter.split(seperator);
  return Letter;
}

var string = ',';
reverseString(Hello,string);
I want to seperate every letter of some variables
Dennis Andersson
@deandersson
Aug 26 2015 08:47
@Mbos95 you are splitting at ,
which is never in the example
And you are returning the input Letter
Mbos95
@Mbos95
Aug 26 2015 08:47
was there an example?
Dennis Andersson
@deandersson
Aug 26 2015 08:47
in your code
Mbos95
@Mbos95
Aug 26 2015 08:48
Well, I also tried returning Hello or Reversestring or Arrayofletters. They all return undefined..
Is the splitting of , legit? or
Dennis Andersson
@deandersson
Aug 26 2015 08:49
what Letter.split(",")does is try to split Letter at the character ,
Mbos95
@Mbos95
Aug 26 2015 08:49
ooooooooh
but how can I make it split at the end of every letter then ?
Mbos95
@Mbos95
Aug 26 2015 08:50
I need it to out put "h" "E" "L" "L" "O"
Dennis Andersson
@deandersson
Aug 26 2015 08:50
Letter.split("")
Mbos95
@Mbos95
Aug 26 2015 08:50
oh.. I see. I am very sorry! I missed this link on my google search
Dennis Andersson
@deandersson
Aug 26 2015 08:50
A tip is to read up on functions from different reference sites to really understand the function when using it
Mbos95
@Mbos95
Aug 26 2015 08:50
Eitherway, thank you @deandersson ! Really appreciated.
CamperBot
@camperbot
Aug 26 2015 08:50
mbos95 sends brownie points to @deandersson :sparkles: :thumbsup: :sparkles:
:star: 241 | @deandersson | http://www.freecodecamp.com/deandersson
Mbos95
@Mbos95
Aug 26 2015 08:51
Yea, ussually I do that but this time I was all confuzzled and stuck xD
Dennis Andersson
@deandersson
Aug 26 2015 08:51
hehe yes I understand :)
Michaël Karim
@MichaelKarim
Aug 26 2015 08:52
@desmoquak Have you found the solution ? I'm stuck as well.
Abdul Rafay Khan
@khanrafay
Aug 26 2015 08:53
hello, can anyone tell me how can be two classes at the same time.for image
in css.
can anyone help me out.
Mbos95
@Mbos95
Aug 26 2015 08:57
@khanrafay I am not sure what you mean, but you can look into Class and ID's
@khanrafay They are both important. :)
Rabin Shrestha
@jyapujuju
Aug 26 2015 08:57
function titleCase(str) {
  var words=str.split(' ');
  for (i=0;i<words.length;i++){
   words[i]=words[i].charAt(0).toUpperCase+words[i].substr(1).toLowerCae();
  }
  //words.charAt();
  return words;
}
titleCase("I'm a little tea pot");
what is .substr is not function
ahbi
@ahbiwong
Aug 26 2015 09:01

<h1>Hello World</h1>

<h2>CatPhotoApp</h2>

<p>Hello Paragraph</p>
-->

Michaël Karim
@MichaelKarim
Aug 26 2015 09:01
@vlspivey I'm stuck as well. Found it already?
ahbi
@ahbiwong
Aug 26 2015 09:02
"Be sure to delete all trailing comment tags, i.e. -->." HOW?
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 09:02
Is it me or do others who recently started Free Code Camp think the beginner Bonfire algorithm exercises are hard. Pretty worried for myself at the moment
Michaël Karim
@MichaelKarim
Aug 26 2015 09:02

Use an ID Attribute to Style an Element.

<style>
#cat-photo-element{
background-color: green;
}
</style>

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

How do I style this form to have a green-background without using a class? I should do it with #? Anyone?

Geri Escandor
@geriesc
Aug 26 2015 09:04
@jhsherk1995 I felt the same way at first. That's why I decided to learn outside FCC. I signed up at codecademy and it helped me a lot with FCC.
Ji Hoon Sherk
@jhsherk1995
Aug 26 2015 09:05
@geriesc I see! I'll definitely check out CodeAcademy then. I've been hoping in and out of it. I'll aim to complete the JavaScript tutorial on it and then move onto FCC!
coordinates change after the request and i have no clue why at this point
Andrew Parnell
@parnelandr
Aug 26 2015 09:08
hey everyone I'm a bit stuck. I am on 'Waypoint: Target a Specific Child of an Element Using jQuery' and this is the example - $(".target:nth-child(3)").addClass("animated bounce"); My line is $(".well:nth-child(2)").addClass("animated bounce"); but it seems to select the element with the well class instead of its second child
Spatz
@Spatzerny
Aug 26 2015 09:08
where the hell is grand-popo
could anybody have a look at that? :smile:
Geri Escandor
@geriesc
Aug 26 2015 09:09
@jhsherk1995 I did the same. I would go back and forth between the websites! Good luck!
Mbos95
@Mbos95
Aug 26 2015 09:09
Hey guys. I am currently at Bonfire: Reverse a string. I have got it working.. but it doesn accept it and let me continue! can someone check my code and see what is wrong ?
var Hello = "hello";
var Howdy = "Howdy";
var Earth = "Greetings from Earth";

function reverseString(Letter, seperator) {
  var Arrayofletters = Letter.split(seperator);
  Arrayofletters.reverse()
  var outcome = Arrayofletters.join('');
  endarray.push(outcome);
}
var endarray = []
var endresult = endarray.toString();

var string = "";
reverseString(Hello,string);
reverseString(Howdy,string);
reverseString(Earth,string);

function endsteps(){
  var endresult = endarray.toString()
  return endresult
}
endsteps();
It is probably not efficiently written in any way.. but hey it works xD
Omar
@oab00
Aug 26 2015 09:13
@Mbos95 bonfires dont accept global variables
Mbos95
@Mbos95
Aug 26 2015 09:14
:O
Spatz
@Spatzerny
Aug 26 2015 09:14
OH!
its a string!
Mbos95
@Mbos95
Aug 26 2015 09:14
So... I need to solve this all within a function ?
Omar
@oab00
Aug 26 2015 09:15
yep!
Mbos95
@Mbos95
Aug 26 2015 09:15
ouch. okay! well thank you :) didn know that
CamperBot
@camperbot
Aug 26 2015 09:15
if you want to thank someone, put an @ before their name!
Mbos95
@Mbos95
Aug 26 2015 09:15
thanks @oab00
CamperBot
@camperbot
Aug 26 2015 09:15
mbos95 sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 233 | @oab00 | http://www.freecodecamp.com/oab00
Omar
@oab00
Aug 26 2015 09:19
^^
lol @Spatzerny funny man :joy:
Andrew Parnell
@parnelandr
Aug 26 2015 09:20
Just seen github issue on my problem all good
Omar
@oab00
Aug 26 2015 09:20
@parnelandr nice !
u needed to target the childs not the parent right?
this sentence doesn't sound right :/
Mbos95
@Mbos95
Aug 26 2015 09:21
You cold hearted *
:worried:
Omar
@oab00
Aug 26 2015 09:22
:fearful:
Mbos95
@Mbos95
Aug 26 2015 09:24
I was so proud of my solution which you just saw
Andrew Parnell
@parnelandr
Aug 26 2015 09:24
@oab00 it was that the code should read $(".well :nth-child(2)")... the space here is important. However the example given doesn't have a space
Mbos95
@Mbos95
Aug 26 2015 09:24
and now I need to rebuild it. I dont want to put the produce of my brain powers to rest :shipit:
Andrew Parnell
@parnelandr
Aug 26 2015 09:24
@oab00 the space between .well and :nth-child
Omar
@oab00
Aug 26 2015 09:29
@parnelandr ah makes sense without the space it targets second .well if there's one
Michaël Karim
@MichaelKarim
Aug 26 2015 09:29

blob

How do I use # in the Id attribute?

Mbos95
@Mbos95
Aug 26 2015 09:30

cat-photo-form {}

oops.
#cat-photo-form {

}
Omar
@oab00
Aug 26 2015 09:31
@MichaelKarim that's the correct use but they need to be exact same name
make both of them cat-photo-form
@Mbos95 want a little help from me? :smile:
Mbos95
@Mbos95
Aug 26 2015 09:32
@oab00 Hmm.. maybe xD I am all stuck now. I probably will need to start at the beginning again. If I try to copy stuff into functions, It messes up everything and I get error
Omar
@oab00
Aug 26 2015 09:34

@Mbos95 okay this is a small section of the code u posted earlier

function reverseString(letter) {
  var arrayOfletters = letter.split();
  arrayOfletters.reverse();
  var outcome = arrayOfletters.join();
}

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

what do u think it's missing to be complete?

Mbos95
@Mbos95
Aug 26 2015 09:35
It needs to be put into a string, righty?
Omar
@oab00
Aug 26 2015 09:36
meaning? :o
Mbos95
@Mbos95
Aug 26 2015 09:37
Well.. we need to also collect the data somewhere. It now runs hello, how and greetings from earth through it but it doesn't properly collect it. it just does it and that 's it
We'll need to push it in an array.. or string .. or anywhere!
Omar
@oab00
Aug 26 2015 09:38
that's right they need to be returned out of the function now how would u do that!
Mbos95
@Mbos95
Aug 26 2015 09:39
Hmm... uhh..
array.push?
im not really sure to be honest
I can't have global variables..
Omar
@oab00
Aug 26 2015 09:42
ok so there's another thing missing
.split() and .join() need to have a separator so I'll edit them to .split('') and .join('')
so for example take reverseString("hello"); they want u to return the string 'hello' reversed
Mbos95
@Mbos95
Aug 26 2015 09:43
You can just put the seperator in the () ?
Omar
@oab00
Aug 26 2015 09:45
function reverseString(letter) {    // letter starts at 'hello' 
  var arrayOfLetters = letter.split(''); // now arrayOfLetters = ['h', 'e', 'l', 'l', 'o']
  arrayOfLetters.reverse();    // now arrayOfLetters = ['o', 'l', 'l', 'e', 'h']
  var outcome = arrayOfLetters.join('');  // now outcome = 'olleh'
  // what do u need to return here?
}

reverseString("hello");
@Mbos95 yeah
Mbos95
@Mbos95
Aug 26 2015 09:47
That makes things so much easier xD
Didn't know that! I thought you needed to do it the way I did.. with an variable which declared how you wanted to seperate.
```
function reverseString(letter) {    // letter starts at 'hello' 
  var arrayOfLetters = letter.split(''); // now arrayOfLetters = ['h', 'e', 'l', 'l', 'o']
  arrayOfLetters.reverse();    // now arrayOfLetters = ['o', 'l', 'l', 'e', 'h']
  var outcome = arrayOfLetters.join('');  // now outcome = 'olleh'
return outcome
}

reverseString("hello");
```
is that correct ?
Omar
@oab00
Aug 26 2015 09:48
well it works so xD
congratz ! :)
Mbos95
@Mbos95
Aug 26 2015 09:49
oh wauw xD
my code was so messy..
I had all the parts in it which were neccesary.. but so much things un needed xD
Xchel Hernandez
@xchelm
Aug 26 2015 09:49
Hey my CodePen is slow - anyone else having trouble with it loading?
Mbos95
@Mbos95
Aug 26 2015 09:49
thank you so much oab00.
CamperBot
@camperbot
Aug 26 2015 09:49
if you want to thank someone, put an @ before their name!
Omar
@oab00
Aug 26 2015 09:50
@Mbos95 wanna learn a little trick I use to debug anything?
Mbos95
@Mbos95
Aug 26 2015 09:50
@oab00 yes please
Omar
@oab00
Aug 26 2015 09:51
console.log() everything! to see what each step looks like
so u can see what happens in the console :p
Mbos95
@Mbos95
Aug 26 2015 09:51
ooh, that is nice
I'll keep that one in mind. thank you!
CamperBot
@camperbot
Aug 26 2015 09:51
if you want to thank someone, put an @ before their name!
Omar
@oab00
Aug 26 2015 09:51
no problems :)
@xchelm codepen works fine for me
Mustafa Hussain
@MustafaMohsin
Aug 26 2015 09:54
@DesignForYourMind ahahha Nice :)
Xchel Hernandez
@xchelm
Aug 26 2015 09:55
@oab00 I've been using font-color for my h1 tag and it won't update - it's weird.
thanks @oab00
CamperBot
@camperbot
Aug 26 2015 09:55
xchelm sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 235 | @oab00 | http://www.freecodecamp.com/oab00
Omar
@oab00
Aug 26 2015 09:56
@xchelm should use color instead
h1 { color: red; }
MB
@hudnoirhibtam
Aug 26 2015 09:58
Hey Guys!
Stuck at a BonFire.
Screen Shot 2015-08-26 at 3.34.28 pm.png
Palindrome thingy!
Please Help!!

function palindrome(str) {
// Good luck!
str.toLowerCase();

var letters = str.split();

letters.reverse();

var strev = letters.join();

if (str == strev) return true;
else return false;
}

palindrome("eye");

Afroz (zorfa)
@zorfa
Aug 26 2015 10:00
you should use === instead o ==
MB
@hudnoirhibtam
Aug 26 2015 10:00
Oh ok ok!
Thanks @zorfa
CamperBot
@camperbot
Aug 26 2015 10:00
hudnoirhibtam sends brownie points to @zorfa :sparkles: :thumbsup: :sparkles:
:star: 291 | @zorfa | http://www.freecodecamp.com/zorfa
Afroz (zorfa)
@zorfa
Aug 26 2015 10:00
if(str === strev)
no problem!
Costas Chaitas
@CostasChaitas
Aug 26 2015 10:05
what the diff between == and ===?
Elizabeth Hatleli
@TheHighPriestess
Aug 26 2015 10:06
Has anyone had trouble with the openweathermap API? I mean...having it suddenly stop working...and then start working again?
Soumya Rauth
@soumyaRauth
Aug 26 2015 10:07
@TheHighPriestess hello
Elizabeth Hatleli
@TheHighPriestess
Aug 26 2015 10:08
@soumyaRauth yes?
Have you had trouble with it?
Soumya Rauth
@soumyaRauth
Aug 26 2015 10:08
@TheHighPriestess I was about to use openweathermap API.
Elizabeth Hatleli
@TheHighPriestess
Aug 26 2015 10:08
Oh...well...I have been having trouble with it.
right now...I'm not getting anything back from it
Same thing happened earlier...this morning
Soumya Rauth
@soumyaRauth
Aug 26 2015 10:10
Are u doing it based on latitude,longditude?
Elizabeth Hatleli
@TheHighPriestess
Aug 26 2015 10:10
I suppose it could be the other API though....
@soumyaRauth yes
perhaps that API isn't working
<sigh>
Soumya Rauth
@soumyaRauth
Aug 26 2015 10:12
I was wondering why there is no such service on google....
I mean google weather is precise...
but, still I don't find an api... :(
Omar
@oab00
Aug 26 2015 10:13
google weather is an app using an api .. just like ours xD
it's using weather.com
Soumya Rauth
@soumyaRauth
Aug 26 2015 10:14
@TheHighPriestess Did you have to sign up on openweathermap
Afroz (zorfa)
@zorfa
Aug 26 2015 10:14
@rasakos In javascript === is used as a comparison operator to check for strict equality. For example nul== undefined is true but nul === undefined will return false
Elizabeth Hatleli
@TheHighPriestess
Aug 26 2015 10:15
@soumyaRauth I did...and they give you a key. However, it was working even without the key...because I forgot it.
Soumya Rauth
@soumyaRauth
Aug 26 2015 10:15
@oab00 ok. So do they provide the api for free?
Omar
@oab00
Aug 26 2015 10:16
more examples:
'2' == 2 => true
'2' === 2 => false
Afroz (zorfa)
@zorfa
Aug 26 2015 10:16
@rasakos == attempts to convert the values to the same type before testing if they're the same. === does not do this; it requires objects to be of the same type to be equal. "5" !== 5
Omar
@oab00
Aug 26 2015 10:16
@soumyaRauth yeah they own wunderground http://www.wunderground.com/weather/api
Soumya Rauth
@soumyaRauth
Aug 26 2015 10:17
@oab00 Thanks a lot.
CamperBot
@camperbot
Aug 26 2015 10:17
soumyarauth sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 236 | @oab00 | http://www.freecodecamp.com/oab00
Elizabeth Hatleli
@TheHighPriestess
Aug 26 2015 10:19
Well..the problem must be with the openweathermap....because the IP API has the city
the temp just disappeared

Their support center says:

"Some delay of connection is possible in Free account."

Costas Chaitas
@CostasChaitas
Aug 26 2015 10:21
thanks @zorfa @oab00
CamperBot
@camperbot
Aug 26 2015 10:21
rasakos sends brownie points to @zorfa and @oab00 :sparkles: :thumbsup: :sparkles:
:star: 293 | @zorfa | http://www.freecodecamp.com/zorfa
:star: 237 | @oab00 | http://www.freecodecamp.com/oab00
Soumya Rauth
@soumyaRauth
Aug 26 2015 10:22
@TheHighPriestess hmmm.
Elizabeth Hatleli
@TheHighPriestess
Aug 26 2015 10:23
Makes it difficult to work on the project.
Omar
@oab00
Aug 26 2015 10:23
@TheHighPriestess u can have an error function to see if there's an error
$.getJSON(url, function() {/*success*/}).error(function(err) {
      console.log('Error:', err);
    });
Elizabeth Hatleli
@TheHighPriestess
Aug 26 2015 10:23
I was trying to implement my background color changes based on th the temp values
@oab00 Thanks...yeah, I should do that.
CamperBot
@camperbot
Aug 26 2015 10:23
thehighpriestess sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 238 | @oab00 | http://www.freecodecamp.com/oab00
MB
@hudnoirhibtam
Aug 26 2015 10:32
var code = "formatted"
Sorry.
How to send code like you are sending @oab00 ?
Omar
@oab00
Aug 26 2015 10:35
use three backticks -> ``` <- before and after the code on seperate lines (shift+enter to go to next line)
wiki format
CamperBot
@camperbot
Aug 26 2015 10: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

``` ⇦ Type 3 backticks, 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

MB
@hudnoirhibtam
Aug 26 2015 10:35
oh okay okay thanks @oab00
CamperBot
@camperbot
Aug 26 2015 10:35
hudnoirhibtam sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 239 | @oab00 | http://www.freecodecamp.com/oab00
MB
@hudnoirhibtam
Aug 26 2015 10:36

okay so my earlier issue still prevails !
'''
function palindrome(str) {
// Good luck!
str.toLowerCase();

var letters = str.split();

letters.reverse();

var strev = letters.join();

if (str === strev) return true;
else return false;
}

palindrome("eye");
'''

CamperBot
@camperbot
Aug 26 2015 10:36
:bulb: to format code use backticks! ``` more info
MB
@hudnoirhibtam
Aug 26 2015 10:36
function palindrome(str) {
  // Good luck!
  str.toLowerCase();

  var letters = str.split();

  letters.reverse();

  var strev = letters.join();

  if (str === strev) return true;
  else return false;
}



palindrome("eye");
Screen Shot 2015-08-26 at 4.12.56 pm.png
This is the error message :(
Omar
@oab00
Aug 26 2015 10:41
@hudnoirhibtam try console.log() everything !
MB
@hudnoirhibtam
Aug 26 2015 10:42
I am not sure how to do that.
Can you please give me an example!?
:(
John Behan
@jjmax75
Aug 26 2015 10:43
can anyone help me figure out the math behind Bonfire: No Repeats Please?
CamperBot
@camperbot
Aug 26 2015 10:43
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Omar
@oab00
Aug 26 2015 10:43

@hudnoirhibtam

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

  var letters = str.split();
  console.log('letters =', letters);

  letters.reverse();
  console.log('letters =', letters);

  var strev = letters.join();
  console.log('strev =', strev);

  if (str === strev) return true;
  else return false;
}



palindrome("not a palindrome");

press Ctrl+Shift+J to open the console

John Behan
@jjmax75
Aug 26 2015 10:44
bonfire no repeats please
CamperBot
@camperbot
Aug 26 2015 10:44

:fire:Bonfire: No repeats please :link:

function permAlone(str) {
  return str;
}

permAlone('aab');

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

more info:  bf details | bf links | hint

MB
@hudnoirhibtam
Aug 26 2015 10:45
alrighty :) thanks I'll try that @oab00
CamperBot
@camperbot
Aug 26 2015 10:45
hudnoirhibtam sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:warning: hudnoirhibtam already gave oab00 points
MB
@hudnoirhibtam
Aug 26 2015 10:45
Oh. Limited points eh?
Omar
@oab00
Aug 26 2015 10:45
lol to prevent cheating the system!
@jjmax75 I hate that one ._.
John Behan
@jjmax75
Aug 26 2015 10:46
@oab00 melting my brain
Omar
@oab00
Aug 26 2015 10:46
so for example 'aab' has 6 permutations which are 'aab', 'aab', 'aba', 'aba', 'baa', 'baa'
each a is treated as a seperate element obviously
and u want the permutations with no repeating letters
so only aba and aba are accepted
u can put numbers to each a to help keep track of things
so accepted permutations are a1ba2 and a2ba1
MB
@hudnoirhibtam
Aug 26 2015 10:48
ok. I'll thank you later :P
CamperBot
@camperbot
Aug 26 2015 10:48
if you want to thank someone, put an @ before their name!
Omar
@oab00
Aug 26 2015 10:48
or (a1)(b)(a2) and (a2)(b)(a1) to help visualise it
John Behan
@jjmax75
Aug 26 2015 10:50
ok, I get that part and have written a function to determine factorials, but how do I calculate the permutations with repeated characters?
Or should I be doing this by creating every permutation, storing in an array and then filtering out the ones with consecutive characters?
I've a feeling I can do this mathematically
Omar
@oab00
Aug 26 2015 10:51
yes exactly that!
@jjmax75 what I've done is take a function from stackoverflow that makes the permutations then filter them out myself
couldn't figure out how to make permutations ._.
John Behan
@jjmax75
Aug 26 2015 10:52
so, am I barking up the wrong tree by approaching this as a mathematical problem?
Mbos95
@Mbos95
Aug 26 2015 10:52
damn trees....
Omar
@oab00
Aug 26 2015 10:52
I guess so xD
John Behan
@jjmax75
Aug 26 2015 10:52
when I look at the numbers, they look related, I can't figure out a formula to recreate this relationship though
thanks @oab00 , I'm going to try to come up with a maths way to do this, maybe math.stackexchange, but your input has helped clear my head somewhat, appreciate it
CamperBot
@camperbot
Aug 26 2015 10:55
jjmax75 sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 240 | @oab00 | http://www.freecodecamp.com/oab00
Omar
@oab00
Aug 26 2015 10:57
@jjmax75 no problems .. the function I got from the net to make the permutations has an inner loop and calls itself from there .. so loop + recursive .. so confusing >.<
Mbos95
@Mbos95
Aug 26 2015 10:57
```
function factorialize(num) {
 num = 5!=1*2*3*4*5
  return num;
}

factorialize(5);
why does this return true ?
I made a monster
Omar
@oab00
Aug 26 2015 10:58
xD
5!=1*2*3*4*5 => (5 != 120) .. it's true that 5 doesn't equal 120 :p
John Behan
@jjmax75
Aug 26 2015 10:59
:)
Mbos95
@Mbos95
Aug 26 2015 10:59
well, glad I got that right
!= doesn't equal..right?
Omar
@oab00
Aug 26 2015 11:00
yep
Mbos95
@Mbos95
Aug 26 2015 11:00
then this guy,https://en.wikipedia.org/wiki/Christian_Kramp, made a weird discovery
n!=literally everything in de world
Omar
@oab00
Aug 26 2015 11:01
except n !
n!=n => false :sweat_smile:
Gabriel Pinheiro
@GxPinheiro
Aug 26 2015 11:01
Im stuck on the palindrome one
MB
@hudnoirhibtam
Aug 26 2015 11:02
@Rhods Me too!
Consider doing it together?! I have never done that before.
Gabriel Pinheiro
@GxPinheiro
Aug 26 2015 11:02
i dont know if im following the right path
blob
MB
@hudnoirhibtam
Aug 26 2015 11:03
!?
Try copy pasting code inside two sets of ```
Easier to read. I just learnt it a couple of minutes back :D
Omar
@oab00
Aug 26 2015 11:04
wiki format
CamperBot
@camperbot
Aug 26 2015 11:04

: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

``` ⇦ Type 3 backticks, 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

Omar
@oab00
Aug 26 2015 11:04
camperbot to the rescue !
Gabriel Pinheiro
@GxPinheiro
Aug 26 2015 11:04
test

function palindrome(str) {
  // Good luck!

  str.toLowerCase();

  var strg = str; 

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

  var strf = str

  if(strf==strg)
    {
      return true;
    }

  else 
  {
    return false;
  }

}

palindrome("eye");
amir
@Rimabo
Aug 26 2015 11:05
I tried adding a background image in CSS on a header tag in HTML. I don't know why but the image is not showing... HELP!
Mbos95
@Mbos95
Aug 26 2015 11:06
@Aubaroo Is your link to the image correcT?
Gabriel Pinheiro
@GxPinheiro
Aug 26 2015 11:06
i forgot something on my palindrome?
amir
@Rimabo
Aug 26 2015 11:06
@Mbos95 Yes
Mbos95
@Mbos95
Aug 26 2015 11:06
@Aubaroo send us the code you used.
Omar
@oab00
Aug 26 2015 11:07
@Aubaroo ohayou!
yea let us see the code
amir
@Rimabo
Aug 26 2015 11:07
ok hang on
its evening here by the way
MB
@hudnoirhibtam
Aug 26 2015 11:07
@Rhods I did the exact same thing.
Mbos95
@Mbos95
Aug 26 2015 11:07
@oab00 I am not sure what to do with my monster
MB
@hudnoirhibtam
Aug 26 2015 11:07
Didn't work.
Omar
@oab00
Aug 26 2015 11:08
@Aubaroo oh ok Konbanwa ! :sweat_smile:
@Rhods u need to remove characters like comas and spaces from the comparison .. it says in the bonfire to remove punctuation :)
amir
@Rimabo
Aug 26 2015 11:08
'''
<header>
<div class="logo">
<a href="index.html"><img src="scholaris logo.svg"></a>
</div>
</header>
'''
CamperBot
@camperbot
Aug 26 2015 11:08
:bulb: to format code use backticks! ``` more info
amir
@Rimabo
Aug 26 2015 11:09
here is the HTML header
header {
  position: relative;
  width:100%;
  min-height: auto;
  text-align: center;
  background-image: url(book.svg);
  background-position: center;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  background-size: cover;
  -o-background-size: cover;
}
here is my CSS
Omar
@oab00
Aug 26 2015 11:10
@Aubaroo <img src="scholaris logo.svg"> seems wrong to me .. why is there a space
Mbos95
@Mbos95
Aug 26 2015 11:10
@Aubaroo try scholaris_logo.svg
I am his sidekick
Omar
@oab00
Aug 26 2015 11:10
haha
amir
@Rimabo
Aug 26 2015 11:10
@oab00 That works, I just had space between scholaris and logo
the problem is the background
not the logo
Mbos95
@Mbos95
Aug 26 2015 11:11
well, you've send us code about your header, not background
amir
@Rimabo
Aug 26 2015 11:11
background-image in my css
that isnt working for me
Mbos95
@Mbos95
Aug 26 2015 11:11
oh, right right.
Omar
@oab00
Aug 26 2015 11:12
well u have 2 images stacked on top of each other maybe that's why :o
amir
@Rimabo
Aug 26 2015 11:13
ok ill give it a play around
Mbos95
@Mbos95
Aug 26 2015 11:13
.jumbotron {
  background-image:  url("https://www.mediafire.com/convkey/9d73/5ctwc4s781l1m486g.jpg");
  height:auto;
  background-repeat: no-repeat;
  background-size: cover;

}
That is how it looks for me
Omar
@oab00
Aug 26 2015 11:13
@Aubaroo try add this to css
header img {
    width: 100px;
    height: 100px;
}
Mbos95
@Mbos95
Aug 26 2015 11:13
I can't be more helpful as this since I am only sidekick in the rankings
MB
@hudnoirhibtam
Aug 26 2015 11:14
Can anyone send me the code for Bonfire: Check for Palindromes!? Is that allowed?
Mbos95
@Mbos95
Aug 26 2015 11:15
and enjoy my picture of air balloons :D
Omar
@oab00
Aug 26 2015 11:17
@hudnoirhibtam are u suuuure u want to spoil it for urself?
all you're missing is pretty much removing punctuation
MB
@hudnoirhibtam
Aug 26 2015 11:18
yea! I'm on the edge man, been on it from quite some time. Oh yea.?
Okay I'll try again.
Omar
@oab00
Aug 26 2015 11:18
also str = str.toLowerCase(); to make the string lower case
MB
@hudnoirhibtam
Aug 26 2015 11:19
okay. thanks again man :) @oab00
CamperBot
@camperbot
Aug 26 2015 11:19
hudnoirhibtam sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:warning: hudnoirhibtam already gave oab00 points
John Behan
@jjmax75
Aug 26 2015 11:19
@oab00 I've posted to Math.StackExchange - http://math.stackexchange.com/questions/1410184/permutations-excluding-repeated-characters, maybe we'll get an answer there
Omar
@oab00
Aug 26 2015 11:19
wow that's awesome xD
Gabriel Pinheiro
@GxPinheiro
Aug 26 2015 11:20
@oab00 Mine left only the punctuation too?
Omar
@oab00
Aug 26 2015 11:20
let's sit and wait for a math genius to solve it for us!
@Rhods yes!
oh @hudnoirhibtam and u need to put empty strings in both .split('') and .join('')
Mbos95
@Mbos95
Aug 26 2015 11:22
Is it an factorialization, is it an array.reverse? No it is super Oab00!
MB
@hudnoirhibtam
Aug 26 2015 11:22
ok.. :)
Mbos95
@Mbos95
Aug 26 2015 11:22
it'll get better once I will be better at java script and know more terms.. fear not
Omar
@oab00
Aug 26 2015 11:24
@Mbos95 I have faith in you! you can be the greatest javascripter ever known
Mbos95
@Mbos95
Aug 26 2015 11:25
@oab00 To the top together!
Omar
@oab00
Aug 26 2015 11:25
function javascript() {
    return "I don't know what I'm doing";
}
console.log(javascript());
Mbos95
@Mbos95
Aug 26 2015 11:26
```
```
function javascript() {
    return "I don't know what I'm doing";
n!=5
}
console.log(javascript());
```
Omar
@oab00
Aug 26 2015 11:26
xD
Mbos95
@Mbos95
Aug 26 2015 11:27
:D :D
I can't laugh too hard, i am at work -.-
@oab00 what is your daily occupation?
Omar
@oab00
Aug 26 2015 11:33
@Mbos95 CS student enjoying the summer break ;)
wiki know it
CamperBot
@camperbot
Aug 26 2015 11:33
no wiki entry for: know it
:pencil: click here to create one now!after creating your page type update to reload it here
Omar
@oab00
Aug 26 2015 11:33
D:
bonfire arguments
CamperBot
@camperbot
Aug 26 2015 11:33

:fire:Bonfire: Arguments Optional :link:

function add() {
  return false;
}

add(2,3);

Create a function that sums two arguments together. If only one argument is provided, return a function that expects one additional argument and will return the sum.

more info:  bf details | bf links | hint

Omar
@oab00
Aug 26 2015 11:33
hint
CamperBot
@camperbot
Aug 26 2015 11:33
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Mbos95
@Mbos95
Aug 26 2015 11:34
bonfire factorliza
CamperBot
@camperbot
Aug 26 2015 11:34
Sorry, can't find a bonfire called factorliza. [ Check the map? ]
Mbos95
@Mbos95
Aug 26 2015 11:34
xD typo.. but it makes me think of godzilla
Omar
@oab00
Aug 26 2015 11:34
lol
Mbos95
@Mbos95
Aug 26 2015 11:34
bonfire Factorialize a Number
CamperBot
@camperbot
Aug 26 2015 11:34

:fire:Bonfire: Factorialize a Number :link:

function factorialize(num) {
  return num;
}

factorialize(5);

Return the factorial of the provided integer.

more info:  bf details | bf links | hint

Mbos95
@Mbos95
Aug 26 2015 11:34
hint
CamperBot
@camperbot
Aug 26 2015 11:34
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Omar
@oab00
Aug 26 2015 11:34
wiki know it
Mbos95
@Mbos95
Aug 26 2015 11:34
Ah oke! enjoy your break :D
xDxDxD
Mbos95
@Mbos95
Aug 26 2015 11:40
you have a long break. here the schools started 1 week back
Harishankar Ayandev
@harishankards
Aug 26 2015 11:41
I'm stuck here " Bonfire: Find the Longest Word in a String" !! failing in a test case
anybody there to help?
Rabin Shrestha
@jyapujuju
Aug 26 2015 11:41
function largestOfFour(arr) {
  var arr2=1;
  var pos=0;
  // You can do this!
  for(i=0;i<4;i++){
    for(j=0;j<4;j++)
      {
       if(arr[i][j]>arr2){
         arr2=arr[i][j];
         pos=i;
       }
      }
  }

   return arr[pos];

}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
wht is wrong??
Harishankar Ayandev
@harishankards
Aug 26 2015 11:42
@jyapujuju how to preview code like you did above?? what command should I use?
Rabin Shrestha
@jyapujuju
Aug 26 2015 11:43
use ```
Spatz
@Spatzerny
Aug 26 2015 11:43
explain markup
CamperBot
@camperbot
Aug 26 2015 11:43
no wiki entry for: markup
:pencil: click here to create one now!after creating your page type update to reload it here
Spatz
@Spatzerny
Aug 26 2015 11:43
hmm
Omar
@oab00
Aug 26 2015 11:43
@Mbos95 we're starting in about a month ^^
Harishankar Ayandev
@harishankards
Aug 26 2015 11:43

```
function findLongestWord(str) {
var str1 = str.split(" ");
var longest = 0;
var word = null;
for (var i = 0; i < str1.length - 1; i++) {
if (longest < str1[i].length) {
longest = str1[i].length;

   word = str1[i];  
    }
}

return word.length;
}

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

Rabin Shrestha
@jyapujuju
Aug 26 2015 11:43
use ``` before and after code
Spatz
@Spatzerny
Aug 26 2015 11:44
explain code formatting
CamperBot
@camperbot
Aug 26 2015 11:44

: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

``` ⇦ Type 3 backticks, 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

Harishankar Ayandev
@harishankards
Aug 26 2015 11:44
function findLongestWord(str) {
  var str1 = str.split(" ");
    var longest = 0;
    var word = null;
    for (var i = 0; i < str1.length - 1; i++) {
        if (longest < str1[i].length) {
            longest = str1[i].length;

       word = str1[i];  
        }
    }
  return word.length;
}

findLongestWord('The quick brown fox jumped over the lazy dog');
thanks @jyapujuju !
CamperBot
@camperbot
Aug 26 2015 11:44
harishankards sends brownie points to @jyapujuju :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for jyapujuju
Harishankar Ayandev
@harishankards
Aug 26 2015 11:45
@jyapujuju could you help me on solving the above? I'm failing in this test case !!
expect(findLongestWord('What if we try a super-long word such as otorhinolaryngology')).to.equal(19);
Rabin Shrestha
@jyapujuju
Aug 26 2015 11:47
@harishankards dont use -1 in loop
Harishankar Ayandev
@harishankards
Aug 26 2015 11:48
oh ! @jyapujuju it works now. What is the reason?
Omar
@oab00
Aug 26 2015 11:49
@jyapujuju try console.log() and u will see where the problem is
console.log('largest of array', arr[i], 'is', arr2); at the end of the for loop
Rabin Shrestha
@jyapujuju
Aug 26 2015 11:49
@harishankards its alread <
Harishankar Ayandev
@harishankards
Aug 26 2015 11:49
yeah! Now it's fine! thanks @jyapujuju
CamperBot
@camperbot
Aug 26 2015 11:49
harishankards sends brownie points to @jyapujuju :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for jyapujuju
Harshal Gupta
@harshalgupta826
Aug 26 2015 11:49
Anyone have any idea on how to combat the default \n propertry of console.log inside a for loop?
Gabriel Pinheiro
@GxPinheiro
Aug 26 2015 11:50
@oab00
added the punctuation still not working
function palindrome(str) {
  // Good luck!

  str.toLowerCase();

  var strg = str; 

  var str0 = strg.replace(/[.,-\/#!$%\^&\*;:{}=\-_`~()]/g,"");
  var str1 = str0.replace(/\s{2,}/g," ");

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



  var strp = str.replace(/[.,-\/#!$%\^&\*;:{}=\-_`~()]/g,"");
  var strf = strp.replace(/\s{2,}/g," ");

  if(strf==str1)
    {
      return true;
    }

  else 
  {
    return false;
  }
Omar
@oab00
Aug 26 2015 11:51
@harshalgupta826 I don't think u can :o
u could make a variable var output = ''; then add logs to it output +='logs'in the loop
then at the end console.log(output)
Rabin Shrestha
@jyapujuju
Aug 26 2015 11:52
@oab00 no luck
Clayton
@cjg040103
Aug 26 2015 11:52
anybody know wats rong here?
function mutation(arr) {

  var a = arr[0].toUpperCase();
  var b = arr[1].toUpperCase();

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

mutation(['hello', 'hey']);
Omar
@oab00
Aug 26 2015 11:52
@Rhods so many variables .. what is what o_o
Harshal Gupta
@harshalgupta826
Aug 26 2015 11:53
Yes. Done. Thank yo so much @oab00 :D
CamperBot
@camperbot
Aug 26 2015 11:53
harshalgupta826 sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 241 | @oab00 | http://www.freecodecamp.com/oab00
Rabin Shrestha
@jyapujuju
Aug 26 2015 11:53
function largestOfFour(arr) {
  var arr2=1;
  var pos=0;
  // You can do this!
  for(i=0;i<4;i++){
    for(j=0;j<4;j++)
      {
       if(arr[i][j]>arr2){
         arr2=arr[i][j];
         pos=i;
       }
      }
  }
  for(i=0;i<4;i++){
   console.log arr[pos][i];
}
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
console.log
Clayton
@cjg040103
Aug 26 2015 11:54
add some spaces
Rabin Shrestha
@jyapujuju
Aug 26 2015 11:54
function largestOfFour(arr) {
  var arr2=1;
  var pos=0;
  // You can do this!
  for(i=0;i<4;i++){
    for(j=0;j<4;j++)
      {
       if(arr[i][j]>arr2){
         arr2=arr[i][j];
         pos=i;
       }
      }
  }
  for(i=0;i<4;i++){
   console.log (arr[pos][i]);
}
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Omar
@oab00
Aug 26 2015 11:56

@jyapujuju

function largestOfFour(arr) {
  var arr2=1;
  var pos=0;
  for(i=0;i<4;i++){
    for(j=0;j<4;j++) {
       if(arr[i][j]>arr2){
         arr2=arr[i][j];
         pos=i;
       }
      }
    console.log('i =', i, ': largest of array', arr[i], 'is', arr2);
  }
   return arr[pos];
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

what do u see the console ?

Rabin Shrestha
@jyapujuju
Aug 26 2015 11:56
can you elaborate??
@oab00
Omar
@oab00
Aug 26 2015 11:57
arr2 should be the output right? then maybe use arr2[i] instead to actually make it an array
@jyapujuju if u're wondering u can open the console using Ctrl+Shift+J
Aaron Freidus
@shadowfool
Aug 26 2015 11:58
If anyone is confused about the push and pop methods here's a great explanation of stacks: https://www.interviewcake.com/concept/stack?utm_source=weekly_email
Mbos95
@Mbos95
Aug 26 2015 11:58
I like the name of the website
Omar
@oab00
Aug 26 2015 12:00
@shadowfool there's also shift() and unshift() does the exact same thing except at the beginning of the stack rather than the end
Gabriel Pinheiro
@GxPinheiro
Aug 26 2015 12:02

@oab00 it, make 2 variables first str and strg i replace everything on the stg changin i to str1
then i take str1 and split join or anything then after this take strp and replace
after conpare strf with str1

probably im doing something wrong but dont know

Omar
@oab00
Aug 26 2015 12:10

@Rhods way too many variables u only need 2 one for the original str and one for the reverse
here's a pseudocode:

take str, lower case it and remove (spaces, comas and dots only)
make variable strReverse that stores the reverse of str after it's been changed above
compare str with strReverse

Rabin Shrestha
@jyapujuju
Aug 26 2015 12:11
@oab00 but it didn't pass me ;/
Gabriel Pinheiro
@GxPinheiro
Aug 26 2015 12:11
i tried to make another way
Mbos95
@Mbos95
Aug 26 2015 12:12
hey @oab00 If you have time, can you help me with an bonfire?
CamperBot
@camperbot
Aug 26 2015 12:12
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Gabriel Pinheiro
@GxPinheiro
Aug 26 2015 12:12
@oab00
function palindrome(str) {
  // Good luck!
  var nstr = str.replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~()]/g,"").toLowerCase();

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

  if(nstr === rev(nstr))
    {
    return true;  
    }
    else
    {
      return false;
    }
    }

palindrome("eye");
Omar
@oab00
Aug 26 2015 12:15
@Mbos95 sure :)
Mbos95
@Mbos95
Aug 26 2015 12:15

Could somebody help me make a start on this bonfire? I am really thrown off me game. Or could someone explain the tips on the left in understandable terms?

function factorialize(num) {
 var num = 5 != 1*2*3*4*5
  return num;
}

factorialize(5);

Tips left:

Return the factorial of the provided integer.

If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.

Factorials are often represented with the shorthand notation n!

For example: 5! = 1 2 3 4 5 = 120f

Remember to use Read-Search-Ask if you get stuck. Write your own code.

Here are some helpful links:

Arithmetic Operators

CamperBot
@camperbot
Aug 26 2015 12:15
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Rabin Shrestha
@jyapujuju
Aug 26 2015 12:16
i want to say myself rtfm
Omar
@oab00
Aug 26 2015 12:16
@Rhods everything looks fine except that u didn't add space to the .replace function
Gabriel Pinheiro
@GxPinheiro
Aug 26 2015 12:17
still not working
Omar
@oab00
Aug 26 2015 12:17
@jyapujuju u need to store an array for the output :/
@Rhods why not?
works for me
when I added space
@Mbos95 wiki hints weren't good enough? :o
Mbos95
@Mbos95
Aug 26 2015 12:19
Oh. I didn manage to get there to begin with :D
this might help.. give me a moment!
Omar
@oab00
Aug 26 2015 12:21
@Mbos95 it will sure help it's very detailed and well throughout lol
Mbos95
@Mbos95
Aug 26 2015 12:21
@oab00 the english hurts my brain! xD so many terms which are not known to me yet
Omar
@oab00
Aug 26 2015 12:23
:worried: hmm maybe it needs more coding examples rather than text book explanation
Mbos95
@Mbos95
Aug 26 2015 12:24
Well, there is nothing wrong with getting used to the terminology
Omar
@oab00
Aug 26 2015 12:25
yeah of course! learn2play
Mbos95
@Mbos95
Aug 26 2015 12:26
I'll do my best to read and solve. if I can't do it or get too frustrated, I'll put in the solution. I'll get back to it tomorrow, read and solve again and see if I can do it
sometimes you just need a day to overthink something you're stuck at :)
Omar
@oab00
Aug 26 2015 12:28
nah it's not that hard all u need is a variable to multiply to and a loop that does multiplication n times :)
Mbos95
@Mbos95
Aug 26 2015 12:28
shhh!
Well, I certainly didn't get that from the text yet
Omar
@oab00
Aug 26 2015 12:29
opps :shipit:
Mbos95
@Mbos95
Aug 26 2015 12:30
so this will result into multiple if loops inside each other
That is how I would build it, for as far as I read.
I think I just have massive codes :D I just looked at the solution and that Is kinda what I wanted to make. so I got it a little bit. but I would've done it way bigger :D
Omar
@oab00
Aug 26 2015 12:32
more code isn't bad as long as it's readable
try to solve it with a for loop instead of recursion that's how I did it :)
Mbos95
@Mbos95
Aug 26 2015 12:34

for(i = 5; i < 1 ; i++){

}
I tihnk i just made an infinite one..
Omar
@oab00
Aug 26 2015 12:34
I did the reverse went from 1 to n instead
if u want to do it that want u want to use i-- instead of i++
Mbos95
@Mbos95
Aug 26 2015 12:35
for(i = 1; I > 5 ; i++){
return = 1;

}
This loop is alrighty?
except my mess up with capital I
Omar
@oab00
Aug 26 2015 12:36
nope it's wrong
Mbos95
@Mbos95
Aug 26 2015 12:36
:(
Omar
@oab00
Aug 26 2015 12:36
this is how for loops work
for ( i = initial point; while i is less than end point; increment i)
Gabriel Pinheiro
@GxPinheiro
Aug 26 2015 12:36
@oab00 Maybe it bugged i added space but still not working
Omar
@oab00
Aug 26 2015 12:37
@Rhods did u add it to the regex?
between [] brackets
Mbos95
@Mbos95
Aug 26 2015 12:37
for(i = 0; i < 5; i++){
return=false;
}
Gabriel Pinheiro
@GxPinheiro
Aug 26 2015 12:37
regex?
ronald
@ronstarcool
Aug 26 2015 12:37
hi, anyone don this one? : Bonfire: Make a Person
im stuck on it
Mbos95
@Mbos95
Aug 26 2015 12:37
so when it hits 5 it hits true
Omar
@oab00
Aug 26 2015 12:38
when i is 5 yeah it exists the loop
ronald
@ronstarcool
Aug 26 2015 12:38
return false
var i
Mbos95
@Mbos95
Aug 26 2015 12:38
oke
ronald
@ronstarcool
Aug 26 2015 12:38
on return the loop stops
you can console.log somethiing 5 times., but return is end point
Omar
@oab00
Aug 26 2015 12:39
@Rhods the replace function str.replace(/<this is regex>/g, '');
ronald
@ronstarcool
Aug 26 2015 12:40
@Mbos95 and you cant use the cap indeed. i , always i. not I (capital). thats another variable
Mbos95
@Mbos95
Aug 26 2015 12:41
@ronstarcool Yes, bedankt ;)
ronald
@ronstarcool
Aug 26 2015 12:41
goedzo :)
Mbos95
@Mbos95
Aug 26 2015 12:41
sorry for the dutch
ronald
@ronstarcool
Aug 26 2015 12:41
geen probleem
Gabriel Pinheiro
@GxPinheiro
Au