These are chat archives for FreeCodeCamp/HelpJavaScript

28th
Aug 2017
Ogundele Olumide
@Lumexralph
Aug 28 2017 01:11
@Margaret2 Hallo :zap:
Pagnito
@Pagnito
Aug 28 2017 01:29
anyone know if 3d mobile games like racing games use webGL?
or is webGL only for browsers?
Ginger
@GingerChew
Aug 28 2017 01:43
hey can I get some help with this function? I'm trying to get it to create an object each time it makes a key value pair
function updateInventory(arr1, arr2) {
    // All inventory must be accounted for or you're fired!
  var currentInv = arr1.reduce(function(acc,curr){
    acc[curr[1]] = curr[0];
    return acc;
  }, {}), incomingStock = arr2.reduce(function(acc,curr){
    acc[curr[1]] = curr[0];
    return acc;
  }, {}), i=0, shippingContainer = [];

  while (i<arr2.length) {
    if (currentInv.hasOwnProperty(arr2[i][1])) {
      currentInv[arr2[i][1]] += incomingStock[arr2[i][1]];
      i++;
      return currentInv;
    } else if (!currentInv.hasOwnProperty(arr2[i][1])) {
      currentInv[arr2[i][1]] = incomingStock[arr2[i][1]];
      i++;
      return currentInv;
    }
  }
  return currentInv;
}

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

var newInv = [
    [2, "Hair Pin"],
    [3, "Half-Eaten Apple"],
    [67, "Bowling Ball"],
    [7, "Toothpaste"]
];
currentInv and incomingStock should both make an array of objects. Right now they just create an object with several key value pairs. I'd like each inverntoy item to be an object
Christopher McCormack
@cmccormack
Aug 28 2017 01:56
@GingerChew make your accumulator an array and push the new array onto the accumultor
that can be done without initializing as an array, also. You aren't really reducing, so you can use a forEach or map instead, and just return {curr[1], curr[0]}
Ginger
@GingerChew
Aug 28 2017 01:59
I'm trying to have it be {curr[1]:curr[0]} so that I can search for the item name and get the given quantity more easily. But is that not necessarily easier?
Christopher McCormack
@cmccormack
Aug 28 2017 02:00
probably easier to have it all in one object like you're doing
or to just work with the array you already have instead of converting it
@GingerChew Adding each pair as a new object makes it much more difficult, adding each item instead as a property to a single object makes it easy to lookup
In the former case you would basically have to loop over the array of object every time until you hit the one you want, in the latter, it's a quick lookup
Ginger
@GingerChew
Aug 28 2017 02:04
Okay, I get what you're saying. I'm gonna keep at it then @cmccormack thanks for the tips!
CamperBot
@camperbot
Aug 28 2017 02:04
gingerchew sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1170 | @cmccormack |http://www.freecodecamp.com/cmccormack
Christopher McCormack
@cmccormack
Aug 28 2017 02:05
np
Pagnito
@Pagnito
Aug 28 2017 02:39
anyone use materialize css alot?
LovingVi
@LovingVi
Aug 28 2017 02:42
function where(collection, source) {
  var arr = [];
    for(var i = 0; i < collection.length;i++){
      var flag = false;
       for(var key in collection){
         if(collection[i][key] === source[key]){
           flag = true;
         }
       }
      if(flag){
        arr.push(collection[i]);
      }
    }
  return arr;
}

where([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
help!!! this function doesn't working!
iso
@iso1048
Aug 28 2017 02:44
Is anyone available to help with the 'everything be true' challenge? I can pass all tests except the one below - it should return false but returns true:
function truthCheck(collection, pre) {
  var check = true;
  collection.forEach(function(item, index){
    if (!item.hasOwnProperty(pre) || [null, undefined, 0, "", NaN].indexOf(item[pre]) > -1){check = false;}
  });

  return check;
}

truthCheck([{"single": "double"}, {"single": NaN}], "single");
Butterfly Girl
@qmm-g-Excellent
Aug 28 2017 02:45
there have a problem is that this subject don't pass
任务
按照下面的顺序,并且用空格来分割:
反斜杠 制表符 退格符 回车符 换行符 并把它赋值给变量 myStr:
my answer: var myStr ="\"\\"\"\t\"\"\b\"\"\r\"\"\n\"";
iso
@iso1048
Aug 28 2017 03:02
@AnonymousLords try replacing word with arr inside the filter function
John
@AnonymousLords
Aug 28 2017 03:03
@gothamknight Nope, still same thing
iso
@iso1048
Aug 28 2017 03:04
@AnonymousLords also change word.length to arr.length
John
@AnonymousLords
Aug 28 2017 03:04
nope
var bouncer = bouncer.filter(function(arr) {
     return arr !== false, null, 0, undefined, NaN && arr.length > 0;
  });

bouncer([7, "ate", "", false, 9]);

TypeError: Cannot read property 'filter' of undefined
    at eval:1:22
    at eval
    at r.<anonymous>
iso
@iso1048
Aug 28 2017 03:05
@AnonymousLords can you paste your full code please
John
@AnonymousLords
Aug 28 2017 03:05
That is it
iso
@iso1048
Aug 28 2017 03:07
oh. what are the arguments passed into the function for the challenge - i cannot remember. You cannot do bouncer.filter since bouncer is undefined
John
@AnonymousLords
Aug 28 2017 03:07
bouncer is array
oh wait
iso
@iso1048
Aug 28 2017 03:09
@AnonymousLords do arr.filter, then change the parameter of the callback function to anything else
John
@AnonymousLords
Aug 28 2017 03:10
could i make a function and put my code inside?
iso
@iso1048
Aug 28 2017 03:11
I don't get what you mean
John
@AnonymousLords
Aug 28 2017 03:11


var arr = arr.filter(function(arr) {
    return arr !== false, null, 0, undefined, NaN && arr.length > 0;
  });

bouncer([7, "ate", "", false, 9]);
nvm, heres my code
iso
@iso1048
Aug 28 2017 03:12
@AnonymousLords try:
var bouncer = arr.filter(function(item) {
    return item !== false, null, 0, undefined, NaN && item.length > 0;
  });
John
@AnonymousLords
Aug 28 2017 03:13




ReferenceError: arr is not defined
    at eval:3:19
    at eval
    at r.<anonymous>
Johnny
@jtan3
Aug 28 2017 03:14
@AnonymousLords why not just return item true ? instead of return item !== false, null, 0, undefined, NaN && item.length > 0;
John
@AnonymousLords
Aug 28 2017 03:14
im trying to filter that out
Johnny
@jtan3
Aug 28 2017 03:15
@AnonymousLords it should filter everything that is true
John
@AnonymousLords
Aug 28 2017 03:15
even if i switch that, arr is not defined :point_up: August 27, 2017 11:12 PM @jtan3
Johnny
@jtan3
Aug 28 2017 03:16
@AnonymousLords use a new var to store your arr like @gothamknight said
John
@AnonymousLords
Aug 28 2017 03:16
?
so

var filtered = arr.filter(function(item) {
    return item === false, null, 0, undefined, NaN && arr.length > 0;
  });

bouncer([7, "ate", "", false, 9]);
Johnny
@jtan3
Aug 28 2017 03:17
@AnonymousLords if you wanted to use all those values you need to put && between all of them
John
@AnonymousLords
Aug 28 2017 03:18
not a comma?
Johnny
@jtan3
Aug 28 2017 03:18
@AnonymousLords item=== false && item===null
John
@AnonymousLords
Aug 28 2017 03:18
woudl a coma work to?
arr is still not defined
Johnny
@jtan3
Aug 28 2017 03:20
@AnonymousLords return filtered after
John
@AnonymousLords
Aug 28 2017 03:21

var filtered = arr.filter(function(item) {
    return item === false, null, 0, undefined, NaN && arr.length > 0;
    return filtered;
  });


bouncer([7, "ate", "", false, 9]);
ReferenceError: arr is not defined
    at eval:3:20
    at eval
    at r.<anonymous>
Johnny
@jtan3
Aug 28 2017 03:21
@AnonymousLords outside of the filter function
John
@AnonymousLords
Aug 28 2017 03:22
unknown: 'return' outside of function (6:2)
  4 |     return item === false, null, 0, undefined, NaN && arr.length > 0;
  5 |   });
> 6 |   return filtered;
    |   ^
  7 |  
  8 | 
  9 | bouncer([7, "ate", "", false, 9]);
Johnny
@jtan3
Aug 28 2017 03:22
function bouncer(arr) {
  // Don't show a false ID to this bouncer.
var filtered = arr.filter(function(item) {
    return item === false, null, 0, undefined, NaN && arr.length > 0;
  });
  return filtered;
}
John
@AnonymousLords
Aug 28 2017 03:24
I forgot to include the function .-.
function bouncer(arr){
var filtered = arr.filter(function(item) {
    return item === false, null, 0, undefined, NaN && arr.length > 0;
  });
  return filtered;
 }

bouncer([7, "ate", "", false, 9]);
=> []
Johnny
@jtan3
Aug 28 2017 03:24
@AnonymousLords aren't you filtering out the true values?
iso
@iso1048
Aug 28 2017 03:25
@AnonymousLords i think it is a problem with item !== false, null, 0, undefined, NaN - using commas to separate.
John
@AnonymousLords
Aug 28 2017 03:25
Im just trying to filter out false, null, 0, undefined, NaN && item.length > 0
iso
@iso1048
Aug 28 2017 03:26
yeah i realise that bro. I have seen that kind of thing done but I have never used it so do not know about it
John
@AnonymousLords
Aug 28 2017 03:27
So i cant use comas?
Johnny
@jtan3
Aug 28 2017 03:27
@AnonymousLords no you need to use item!== false && item !== null for all of them
@AnonymousLords but that's the same way to say item is true
John
@AnonymousLords
Aug 28 2017 03:28
okay
No now trying to filter outa rrays with 0 length
without filtering out numbers
cant i use
Johnny
@jtan3
Aug 28 2017 03:31
@AnonymousLords sorry its not &&(and) its ||(or)
John
@AnonymousLords
Aug 28 2017 03:33
return item !== false || item !== null || item !== 0 || item !== undefined || item !== NaN;
still just returns the string, && or || dont work
heroiczero
@heroiczero
Aug 28 2017 03:39
@AnonymousLords https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean what you are defining is the boolean method in JS. " If the value is omitted or is 0, -0, null, false, NaN, undefined, or the empty string (""), the object has an initial value of false." from that website
John
@AnonymousLords
Aug 28 2017 03:39
Okay so all of those have a value of false
heroiczero
@heroiczero
Aug 28 2017 03:40
yes it returns false so you could use the Boolean method to filter your array
John
@AnonymousLords
Aug 28 2017 03:41

function bouncer(arr){
var filtered = arr.filter(function(item) {
    return item !== false;
});
  return filtered;
 }

bouncer([7, "ate", "", false, 9]);
[ 7, 'ate', '', 9 ]
!= gets rid of teh string & false
heroiczero
@heroiczero
Aug 28 2017 03:42
@AnonymousLords more like
return arr.filter((x)=>Boolean(x) );
John
@AnonymousLords
Aug 28 2017 03:43
var filtered = arr.filter(function(item === false) {?
unknown: Unexpected token (3:40)
  1 | 
  2 | function bouncer(arr){
> 3 | var filtered = arr.filter(function(item === false) {
    |                                         ^
  4 | });
  5 |   return filtered;
  6 |  }
what is x?
heroiczero
@heroiczero
Aug 28 2017 03:45
@AnonymousLords x is the item and i am using arrow notation from ES2016
John
@AnonymousLords
Aug 28 2017 03:45
Dont know arrow notation, but okay
So i just put it as x?
unknown: Unexpected token (3:35)
  1 | 
  2 | function bouncer(arr){
> 3 | var filtered = arr.filter(function((x)=>item !== false(x) ) {
    |                                    ^
  4 | });
  5 |   return filtered;
  6 |  }
heroiczero
@heroiczero
Aug 28 2017 03:51
@AnonymousLords you have to use
arr.filter(function(item){
if(item!= false && item !=null && item!=0 && item!="" && item!=undefined && item!=NaN){
return item;
}
});
@AnonymousLords the function(parameter) in any function
John
@AnonymousLords
Aug 28 2017 03:54
return item;
}
return filtered;
});
how do i pu the returns?
do i return filtered?
heroiczero
@heroiczero
Aug 28 2017 03:54
@AnonymousLords return the arr.filter
John
@AnonymousLords
Aug 28 2017 03:55
function bouncer(arr){
arr.filter(function(item){
if(item!= false && item !=null && item!=0 && item!="" && item!=undefined && item!=NaN){
return item;
}
});

bouncer([7, "ate", "", false, 9]);
Where do i return teh arr.filter?
Randell Dawson
@RandellDawson
Aug 28 2017 03:56
@AnonymousLords - before the arr.filter(.................
heroiczero
@heroiczero
Aug 28 2017 03:56
@AnonymousLords where else at the return arr.filter(....
John
@AnonymousLords
Aug 28 2017 03:57
@heroiczero ???
@rmdawson71
heroiczero
@heroiczero
Aug 28 2017 03:57
John
@AnonymousLords
Aug 28 2017 03:57
im so tired, ill read tomorrow
heroiczero
@heroiczero
Aug 28 2017 03:57
@AnonymousLords
return arr.filter(function(item){
if(item!= false && item !=null && item!=0 && item!="" && item!=undefined && item!=NaN){
return item;
}
});
im getting a random error?
heroiczero
@heroiczero
Aug 28 2017 03:59
@AnonymousLords missing } at the end i think
John
@AnonymousLords
Aug 28 2017 04:00
}
});
function bouncer(arr){
return arr.filter(function(item){
if(item!= false && item !=null && item!=0 && item!="" && item!=undefined && item!=NaN){
return item;
}
});
heroiczero
@heroiczero
Aug 28 2017 04:00

@AnonymousLords

function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  return arr.filter(function(item){
if(item!= false && item !=null && item!=0 && item!="" && item!=undefined && item!=NaN){
return item;
}
   });
}

bouncer([7, "ate", "", false, 9]);

like this

@KirstaA what do you mean library?
John
@AnonymousLords
Aug 28 2017 04:01
I got it :D thanks @heroiczero @rmdawson71 @jtan3 @gothamknight
CamperBot
@camperbot
Aug 28 2017 04:01
anonymouslords sends brownie points to @heroiczero and @rmdawson71 and @jtan3 and @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 297 | @rmdawson71 |http://www.freecodecamp.com/rmdawson71
:cookie: 402 | @gothamknight |http://www.freecodecamp.com/gothamknight
:star2: 1663 | @heroiczero |http://www.freecodecamp.com/heroiczero
:cookie: 457 | @jtan3 |http://www.freecodecamp.com/jtan3
Mai Thinh
@mthinh
Aug 28 2017 04:01
hey guys, i've just finished my Twitch API challenge, check out if any error <3
John
@AnonymousLords
Aug 28 2017 04:02
why ```
}
});
}
why so many?
@mthinh you could try making each div the link
iso
@iso1048
Aug 28 2017 04:03
@mthinh was one of the user stories to include the profile picture of the user? Looks good otherwise.
Mai Thinh
@mthinh
Aug 28 2017 04:04
@gothamknight no, but i'll optimize it later
John
@AnonymousLords
Aug 28 2017 04:04
i gtg
thanks so much @guys
CamperBot
@camperbot
Aug 28 2017 04:04
anonymouslords sends brownie points to @guys :sparkles: :thumbsup: :sparkles:
:warning: @guys's account is not linked with freeCodeCamp. Please visit the settings and link your GitHub account.
heroiczero
@heroiczero
Aug 28 2017 04:05
@KirstaA well it only supports 53-bit integers so might have to do this: http://2ality.com/2012/07/large-integers.html
@KirstaA maybe you could use scientific notations too if you can round
@mthinh you could make each div the link to their respective sites
Randell Dawson
@RandellDawson
Aug 28 2017 04:07
@AnonymousLords - Funny thing is you do not need the if statement. You can simply use return item. See below where I have commented out the if statement container:
function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  return arr.filter(function(item){
//if(item!= false && item !=null && item!=0 && item!="" && item!=undefined && item!=NaN){
return item;
//}
   });
}
heroiczero
@heroiczero
Aug 28 2017 04:08
@mthinh otherwise nice job
Mai Thinh
@mthinh
Aug 28 2017 04:08
@heroiczero i link it to username when theyre onl
i'll fix it for better UX
heroiczero
@heroiczero
Aug 28 2017 04:09
@mthinh yeah :+1:
@KirstaA did you try making the number into a string. If you can store it in string for your assignment?
heroiczero
@heroiczero
Aug 28 2017 04:16
@KirstaA well if you want like an example: https://thiscouldbebetter.wordpress.com/2013/02/18/arithmetic-with-large-numbers-in-javascript/ they do it pretty nicely with their code just open it up in a html file after you copy it
heroiczero
@heroiczero
Aug 28 2017 04:28
@KirstaA there are other ways to deal with big numbers, but you either have to deal with library like https://stackoverflow.com/questions/4288821/how-to-deal-with-big-numbers-in-javascript the stackoverflow or you have to create your own code to convert the number into string on your own.
Ken Haduch
@khaduch
Aug 28 2017 04:32
@KirstaA - that post on the "strint" library shows how to use it at the bottom- it's pretty straightforward, if you can use a package like that. If you have to create your own method / library then the methods are described.
Harry Fahringer III
@harryrf
Aug 28 2017 05:17
I want a program to stop running if a certain number hits 0, how can that be done?
Here's the link to my code, https://repl.it/K1kH/59
Ogundele Olumide
@Lumexralph
Aug 28 2017 05:19
@harryrf can you paste just the javascript code here?
Harry Fahringer III
@harryrf
Aug 28 2017 05:19
It's quite long, shall I?
Ogundele Olumide
@Lumexralph
Aug 28 2017 05:20
@harryrf just the part you're expecting to count or check the number
Harry Fahringer III
@harryrf
Aug 28 2017 05:20
Hmm, I can make a smaller version of it
```
oops
Ogundele Olumide
@Lumexralph
Aug 28 2017 05:20
or maybe you can explain your script and how you're tracking the number
Harry Fahringer III
@harryrf
Aug 28 2017 05:22
Okay, it's a simple game of humans vs zombies. Each time a random number equals 1, a human dies. When all the humans die, I want the whole script to stop.
Ogundele Olumide
@Lumexralph
Aug 28 2017 05:24
@harryrf what variable is tracking humans?
Harry Fahringer III
@harryrf
Aug 28 2017 05:25
let humans = 10;
function warfare () {
  // do stuff
  if (humans === 0) {
    // place stop here
  }
}

setInterval ( function () {
  warfare();
}, 2000);
Something like this.
humans
Ogundele Olumide
@Lumexralph
Aug 28 2017 05:25
@harryrf just use clearInterval
@harryrf
let humans = 10;

const  t = setInterval ( function () {
  warfare();
}, 2000);

const warfare = () =>  {
  // do stuff
  if (humans === 0) {
    // place stop here
    clearInterval(t);
  }
}
Harry Fahringer III
@harryrf
Aug 28 2017 05:28
Like this:
function warfare () {
  // do stuff
  if (humans === 0) { // or (!humans)
    clearInterval (warfare());
  }
}
@Lumexralph Awesome, thank you!
CamperBot
@camperbot
Aug 28 2017 05:29
harryrf sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:star2: 2050 | @lumexralph |http://www.freecodecamp.com/lumexralph
Harry Fahringer III
@harryrf
Aug 28 2017 05:30
I tried clearInterval earlier, but thought I was on the wrong path, because I was using it wrong.
Ogundele Olumide
@Lumexralph
Aug 28 2017 05:30
@harryrf you're welcome.... it's cool, we're learning aren't we?
Harry Fahringer III
@harryrf
Aug 28 2017 05:30
Yes, we are :)
Ogundele Olumide
@Lumexralph
Aug 28 2017 05:31
awesome!
have a good day man.. need to dash for work
Harry Fahringer III
@harryrf
Aug 28 2017 05:32
You as well, take care.
Markus Kiili
@Masd925
Aug 28 2017 05:37
@Lumexralph Morning.
glitz20
@glitz20
Aug 28 2017 06:11
hey can anyone let me know why my express app is not working? https://glitch.com/edit/#!/adjoining-river?path=routes/movies.js:6:24
sabahatullah
@sabahatullah
Aug 28 2017 07:32
can someone tell me what the following lines means and if that is the right syntax (cross browser etc)
var secErr = document.getElementById('ntf-module');
secErr.style.display = 'none';
if(secErr){
// something here
}
Harry Manchanda
@IamManchanda
Aug 28 2017 07:33

Hey Guys ... can someone tell why this is not working
https://www.freecodecamp.org/challenges/sort-arrays-with-sort

My Code

/*jshint esversion: 6 */

let array = [1, 12, 21, 2];
let result = array.sort((a, b) => {
  return b - a;
});

console.log(result);
Long Nguyen
@longnt80
Aug 28 2017 07:35
@IamManchanda what do you mean not working?
Harry Manchanda
@IamManchanda
Aug 28 2017 07:35
I think my code is correct... Is it not?
Long Nguyen
@longnt80
Aug 28 2017 07:35
it is working here
Harry Manchanda
@IamManchanda
Aug 28 2017 07:36
Yes its working .... Even in my editor :P
But system not taking this
Markus Kiili
@Masd925
Aug 28 2017 07:37
@sabahatullah First line gets the element with the given id attribute value and stores it to the variable. Second line sets the element not to be displayed on the page. The if does something if the element is found, because getElementById returns null if the element is not found.
Harry Manchanda
@IamManchanda
Aug 28 2017 07:37
The output is => [ 21, 12, 2, 1 ]
and error shown is => You should have sorted the array from largest to smallest.
Long Nguyen
@longnt80
Aug 28 2017 07:37
@IamManchanda what system?
I tried on FCC and it worked too
Harry Manchanda
@IamManchanda
Aug 28 2017 07:38
Oh Dang ... i refreshed and it works now!
Long Nguyen
@longnt80
Aug 28 2017 07:43
@IamManchanda btw, you can omit return:
/*jshint esversion: 6 */

let array = [1, 12, 21, 2];
let result = array.sort( (a, b) =>   b - a );

console.log(result);
sabahatullah
@sabahatullah
Aug 28 2017 07:53
@Masd925 thanks for explaining. I know in jQuery we do if($(secErr).length > 0) . In Javascript "if(secErr) " is just fine? no need for length ?
Secondly if the element is null, should we have anything in the if condition. like if((secErr) && (secErr) != null) to cover that scenario?
CamperBot
@camperbot
Aug 28 2017 07:53
sabahatullah sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 4440 | @masd925 |http://www.freecodecamp.com/masd925
Markus Kiili
@Masd925
Aug 28 2017 07:56
@sabahatullah getElementById method returns a reference to an Element object, or null. All objects are truthy and null is falsy. Therefore if(secErr){...} tests whether getElementById found the element with given id.
Jefferson
@jeffersonnnn
Aug 28 2017 08:23
Hi guys, i have a question to ask.m
Pethaf
@Pethaf
Aug 28 2017 08:38
Shoot.
Jefferson
@jeffersonnnn
Aug 28 2017 08:44
I have ethical question guys. If i take explanations from a site that solves the bonfire but not the code itself, is it considered cheating; also does it detract from my learning experience?
Pethaf
@Pethaf
Aug 28 2017 08:45
When I worked as a TA and graded assignments we used to say "You are free to look at any resource you so desire, you are free to ask anyone you so desire, but you have to write the code yourself".
Markus Kiili
@Masd925
Aug 28 2017 08:45
@jeffersonnnn Try to do it yourself, ask questions. Then if you don't get it google some hints.
Looking at some solutions first will hinder learning.
Jefferson
@jeffersonnnn
Aug 28 2017 08:50
@Pethaf thanks. @Masd925 i genuinely seek to learn and learn well, i am writing the code all by myself. I just seek for detailed hints. Experience has shown me that a googled answer is a non answer. The very act of struggling with the code cements the theorem and improves retain-ability
CamperBot
@camperbot
Aug 28 2017 08:50
jeffersonnnn sends brownie points to @pethaf and @masd925 :sparkles: :thumbsup: :sparkles:
:cookie: 393 | @pethaf |http://www.freecodecamp.com/pethaf
:star2: 4442 | @masd925 |http://www.freecodecamp.com/masd925
Markus Kiili
@Masd925
Aug 28 2017 08:54
@jeffersonnnn You can also post your solution to https://gitter.im/FreeCodeCamp/CodeReview and ask for a review or to see some good solutions.
Jefferson
@jeffersonnnn
Aug 28 2017 08:55
@Masd925 namaste
Slitherings
@Slitherings
Aug 28 2017 10:36
hello whats up guys
Stephen James
@sjames1958gm
Aug 28 2017 10:46
@Slitherings first day of school here
Slitherings
@Slitherings
Aug 28 2017 10:48
oohh dope man
you nervous? @sjames1958gm
Stephen James
@sjames1958gm
Aug 28 2017 10:48
@Slitherings For my kid not me :)
Slitherings
@Slitherings
Aug 28 2017 10:49
oooo
Stephen James
@sjames1958gm
Aug 28 2017 10:49
Thus begins the year-long fight to get her up in time :)
Slitherings
@Slitherings
Aug 28 2017 10:49
hahah yea thats gonna be a struggle man
its always hard in the beginning but im sure you will get used to it
Markus Kiili
@Masd925
Aug 28 2017 10:56
@sjames1958gm My kids always get up on the second call, because they know that I will get the water gun if they don't.
muhidav
@muhidav
Aug 28 2017 11:05
hello guys how are you
Slitherings
@Slitherings
Aug 28 2017 11:06
@muhidav Hello, right now im just trying my best to do this JS Challenge :D
muhidav
@muhidav
Aug 28 2017 11:06
i would like to ask you what can someone do after compeleting front end developement certificate
Slitherings
@Slitherings
Aug 28 2017 11:06
go towards back-end
muhidav
@muhidav
Aug 28 2017 11:07
@Slitherings yeah big up bro
no i mean as a job
Slitherings
@Slitherings
Aug 28 2017 11:07
hmmm,
muhidav
@muhidav
Aug 28 2017 11:08
what job can someone with front end certificate do
Slitherings
@Slitherings
Aug 28 2017 11:08
Front End Developer
it all depends
you can get a job but more than likely you will need more than certificate
muhidav
@muhidav
Aug 28 2017 11:09
of course you will need knowledge
Slitherings
@Slitherings
Aug 28 2017 11:09
others would advise, going to school for a degree because you could go anywhere with a computer science degree, but if your not planning 2 go to school.
then i'd say make a website build a portfolio
Long Nguyen
@longnt80
Aug 28 2017 11:10
realistically, you won't get a job with just the FE cert
Slitherings
@Slitherings
Aug 28 2017 11:10
do some freelancer work.. and make a StackOverflow
yeaaa.. geting a job with just a FE cert isnt enough these days
muhidav
@muhidav
Aug 28 2017 11:11
so you need like those 3 of them
heroiczero
@heroiczero
Aug 28 2017 11:11
You need a degree or a good Portfolio or some work experience
Long Nguyen
@longnt80
Aug 28 2017 11:11
I would say even in the past
heroiczero
@heroiczero
Aug 28 2017 11:12
Work experience is the most preferred than a Great Portfolio with Lots of your works that shows your skills probably a Github repository with some of your projects then a degree
muhidav
@muhidav
Aug 28 2017 11:14
how about if you finish all these 3
Long Nguyen
@longnt80
Aug 28 2017 11:14
I think the best way to get a job is to do project with collaborators, extend your social network with other devs
then you might get a job from reference
yeah, so soft skill is very important
heroiczero
@heroiczero
Aug 28 2017 11:15
then your in a good place
muhidav
@muhidav
Aug 28 2017 11:16
i also have another question . like are these certificates completely free of charge
Long Nguyen
@longnt80
Aug 28 2017 11:16
yes
muhidav
@muhidav
Aug 28 2017 11:17
i just joined and i want to make good experience of what i am doing
Stephen James
@sjames1958gm
Aug 28 2017 11:17
@Masd925 lol
Slitherings
@Slitherings
Aug 28 2017 11:20
@muhidav pretty much the easy way to get a job is become apart of a community and code!
muhidav
@muhidav
Aug 28 2017 11:21
@Slitherings thats true bro like this one right ?
Razvan Jackson
@RazvanJackson
Aug 28 2017 11:22
Did someone watch Mayweather vs Mcgregor?
Slitherings
@Slitherings
Aug 28 2017 11:22
@muhidav yep, im apart of some coding discords and i like to watch people code on Twitch
but im mainly just the noob of the group who just asks questions! haha
Long Nguyen
@longnt80
Aug 28 2017 11:22
@RazvanJackson yes
boring as expected
it's like watching a low level boxer against Mayweather
Slitherings
@Slitherings
Aug 28 2017 11:23
mcGregor was out of shape
and wasnt ready to go for 5+ rounds with Mayweather
Razvan Jackson
@RazvanJackson
Aug 28 2017 11:24
@longnt80 who fight before they fight?
muhidav
@muhidav
Aug 28 2017 11:24
so guys as i am seeing we can ask about even the real world problems i have one ?
Slitherings
@Slitherings
Aug 28 2017 11:25
@muhidav i mean i dont see why not? haha
muhidav
@muhidav
Aug 28 2017 11:25
i am trying to do online enterpreneurship ,and i want to to dropshipping what do you guys think about that ?
Long Nguyen
@longnt80
Aug 28 2017 11:25
@RazvanJackson I only watched conor vs floyd
muhidav
@muhidav
Aug 28 2017 11:27
i want to pay for some mentoring but i do know what is behind the curtains , i wan t to do also affiliate marketing and actually that is why i am learning web developement
Long Nguyen
@longnt80
Aug 28 2017 11:50

@muhidav

pay for some mentoring but i do know what is behind the curtains

work for someone who is already doing the same business

Abhinav Mishra
@abhinav-m
Aug 28 2017 14:33
The react dungeon game
does the map have to be random too?
or only the enemies and stuff placed inside it
Moisés Man
@moigithub
Aug 28 2017 14:37
the codepen example have random maps and stuff
but the usercases dont say anything about random maps, only stuff inside it...
Abhinav Mishra
@abhinav-m
Aug 28 2017 14:38
@moigithub ok, ty!
CamperBot
@camperbot
Aug 28 2017 14:38
abhinav-thinktank sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 3613 | @moigithub |http://www.freecodecamp.com/moigithub
Abhinav Mishra
@abhinav-m
Aug 28 2017 14:39
hardcoding maps sounds awful though..
i guess i'll generate them randomly
Pethaf
@Pethaf
Aug 28 2017 14:40
You could do it like "random" games do.
Pick a seed to sow the random number generator until it generates a nice map.
Then save that seed.
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2017 14:48
hello everyone
random question does anyone knows any other ways to see that a user won beside "you won" ?xd
say
Ene Catalin
@EneCatalin
Aug 28 2017 14:49
"you won...or did you ? "
is that better ?
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2017 14:51
@EneCatalin I have like a result box that can holds like 6 letters was trying to use that box to show the result or will have to show it another way around
its the simon game you probably allready made it, when the user gets the sequence right I say great! but if the user gets 20 sequences right I have to say that he won :D
Ene Catalin
@EneCatalin
Aug 28 2017 14:53
I never got to it lol
I am a newbie too
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2017 14:55
always learning, always a step further, thanks @EneCatalin will use "you win"
CamperBot
@camperbot
Aug 28 2017 14:55
tiagocorreiaalmeida sends brownie points to @enecatalin :sparkles: :thumbsup: :sparkles:
:cookie: 444 | @enecatalin |http://www.freecodecamp.com/enecatalin
Ene Catalin
@EneCatalin
Aug 28 2017 15:01
lol
Blauelf
@Blauelf
Aug 28 2017 15:01
@tiagocorreiaalmeida Maybe you could have a longer text with a horizontal scroll effect, not sure how to do that well (I learnt HTML in the 90s and used <marquee> a lot, maybe not trust my design choices)
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2017 15:04
you can create that without using the that for what I know that tag is obsolete hehe, and I decided to reduce the font-size I was using in a box so it all fits perfeclty, thanks aswell @Blauelf always good to hear opinions
CamperBot
@camperbot
Aug 28 2017 15:04
tiagocorreiaalmeida sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star2: 4584 | @blauelf |http://www.freecodecamp.com/blauelf
Ogundele Olumide
@Lumexralph
Aug 28 2017 15:06
@Masd925 Hey man, how're you doing? motivated to start the java project yet?
Pagnito
@Pagnito
Aug 28 2017 15:07

cant seem to understand why doing this

componentDidUpdate(){
    if(this.state.recipeName !== this.props.editModalData.recipeName){
        this.setState({recipeName:this.props.editModalData.recipeName})
        console.log(typeof this.props.editModalData.recipeName)
  }
}

and then

<div className="input-field col">
              <input onChange={this.handleRecipeName} value={this.state.recipeName}  id="recipeName" type="text" className="validate" />
            <label className="active">Recipe Name</label>
          </div>

locks my input, and i cant type on top of the set value, but if i set this.state to just a string inside the constructor , it lets me type

Markus Kiili
@Masd925
Aug 28 2017 15:08
@Lumexralph Yeah. Just started to refresh some java concepts. Servlets, url mappings and project structures etc.
Ogundele Olumide
@Lumexralph
Aug 28 2017 15:08
@Masd925 awesome, glad to know you've started the engine
Markus Kiili
@Masd925
Aug 28 2017 15:09
@Lumexralph engine?
Ogundele Olumide
@Lumexralph
Aug 28 2017 15:10
@Masd925 :smile: when you're about to make something happen rather than procrastinate
Markus Kiili
@Masd925
Aug 28 2017 15:11
@Lumexralph Yeah. Most likely I will just make some database using apis with java. Mostly things I have done in the past. Then some front apps that use those apis.
Mostly been reading about software testing lately (on my free time).
Jason Luboff
@JLuboff
Aug 28 2017 15:14
Free time? Whats that
Markus Kiili
@Masd925
Aug 28 2017 15:19
@JLuboff I think it means time outside work.
You are doing the same things you do at work but it is still different somehow.
Jason Luboff
@JLuboff
Aug 28 2017 15:19
:D
@Masd925 Have you finished any additional FCC projects besides tribute?
Markus Kiili
@Masd925
Aug 28 2017 15:21
@JLuboff No. Just learning new fancy words like procrastinate and putting them into action.
Jason Luboff
@JLuboff
Aug 28 2017 15:21
:joy:
Markus Kiili
@Masd925
Aug 28 2017 15:22
@JLuboff My jiujitsu career starts tomorrow. Had to study that too lately.
Jason Luboff
@JLuboff
Aug 28 2017 15:22
Nice
Blauelf
@Blauelf
Aug 28 2017 15:22
@tiagocorreiaalmeida I really hope <marquee> is obsolete, as should <blink>. Still nothing to prevent people from having green text on yellow background. Former me always seems so stupid.
Jason Luboff
@JLuboff
Aug 28 2017 15:23
I used to do Tae Kwon Do when I was younger (from age... 6? to 16-17 I think when I stopped again)
Markus Kiili
@Masd925
Aug 28 2017 15:23
@JLuboff I also had a creative 20 year break from budo sports (all sports really if you don't count chess and billiards).
Blauelf
@Blauelf
Aug 28 2017 15:24
@Masd925 "Procrastination" is one of my favourite words, I remember using it more than ten years ago. Not doing the stuff you're supposed to do suddenly sounds so sophisticated...
"budo sports" reminds me of that 90s game Budokan :D
Markus Kiili
@Masd925
Aug 28 2017 15:28
@Blauelf Hedonist is another similar nice word. I was once called a hedonist at freediving training when I only did a 4 minute breath hold.
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2017 15:28
https://codepen.io/tiagocorreia/full/QMVRxr/ guys if you can have a look need only to fix 1 thing I think, when the sequence is being played I want to delay when its multiple colors like red blue red , iwant first that the red color effect go back to normal before playing the blue so its more perceptive what color is behing played
if you can give it a look thanks
Blauelf
@Blauelf
Aug 28 2017 15:29
@Masd925 Interesting definition of "Hedonist".
Muhammad Hasham
@MohammadHasham
Aug 28 2017 16:01

finally presenting you ,
Redux YouOwn (A video platform).
Please give stars if you like, (further refer Readme.md)

I hope you guys would like it
https://github.com/MohammadHasham/Redux-YouOwn

Harry Fahringer III
@harryrf
Aug 28 2017 16:02

I have code that updates to the DOM every 2 seconds, but only has 3 random results to update. Sometimes the update is the same result. I'd like to use plain-o JS to add a small fade-in each time it is updated. Here's a sample of what I'm doing.

// each should fade from white to black quickly
document.getElementById("info").innerHTML = "result1";
document.getElementById("info").innerHTML = "result2";
document.getElementById("info").innerHTML = "result3";

I have tried adding CSS to my style.css file that transitions to black and then sending document.getElementById("info").style.color = "#FFFFFF";, but have only had partial success as the transition only happens once.

Harry Fahringer III
@harryrf
Aug 28 2017 16:21
Just realized I can call a function that contains a setTimeout(). Then add all of my "transition" stuff in that timeout.
glitz20
@glitz20
Aug 28 2017 18:03
hey anyone who can please have a look at my project and find what is the problem?https://glitch.com/edit/#!/adjoining-river?path=routes/collection.js:8:56 Thanks
Pagnito
@Pagnito
Aug 28 2017 18:14
im kind of starting to love how react handles data, i wonder how working with redux is gonna be
Maks Ushakov
@maks-ushakov
Aug 28 2017 18:27
@sabin20 what problem do you have?
glitz20
@glitz20
Aug 28 2017 18:28
@maks-ushakov the app.js says variable undefined, but I have defined it
Maks Ushakov
@maks-ushakov
Aug 28 2017 18:35
@sabin20 do you have github code?
glitz20
@glitz20
Aug 28 2017 18:35
@maks-ushakov not really
Maks Ushakov
@maks-ushakov
Aug 28 2017 18:36
it will be better to run it with debug mode and look for it with chrome dev tools
Pagnito
@Pagnito
Aug 28 2017 18:39
@MohammadHasham hey
Maks Ushakov
@maks-ushakov
Aug 28 2017 18:40
@sabin20 you have an error in populatedb.js line 9
glitz20
@glitz20
Aug 28 2017 18:41
@maks-ushakov yeah but that shouldbot matter
for now
Maks Ushakov
@maks-ushakov
Aug 28 2017 18:52
@sabin20 Error: Cannot find module '../models/book'
9:49 PM
glitz20
@glitz20
Aug 28 2017 18:52
@maks-ushakov where did you find models/book?
Maks Ushakov
@maks-ushakov
Aug 28 2017 18:53
Logs error
Controllers/genreController.js line 3
Adit
@adittyagi
Aug 28 2017 18:54
Hey guys! I am having problem with json and stuff. From where should I learn about json,api's and ajax ?
Brian
@BrianCodes33
Aug 28 2017 18:55
function findArray(arr1, arr2){
  var na = [];
  if (arr1 === '' || arr2 === '') {
      na.push([]);
  } else {
    for (var i=0; i<arr2.length; i++) {
      na.push(arr1[arr2[i]]);
    }
  }
  return na;
}

Expected: '[]', instead got: '[undefined, undefined, undefined]'
any clues?
Jason Luboff
@JLuboff
Aug 28 2017 18:55
@BrianCodes33 Whats the function call arguments?
Nathan Vu
@NathanVu
Aug 28 2017 18:56
var i = 1;       // Set counter to 1
var msg = '';    // Message

// Store 5 times table in a variable
while (i < 10) {
  msg += i + ' x 5 = ' + (i * 5) + '<br />';
  i++;
}

document.getElementById('answer').innerHTML = msg;
hey guys this is very basic, but why is var msg = ' ';
?
Jason Luboff
@JLuboff
Aug 28 2017 18:57
@NathanVu You can't add msg +=... to undefined, hence you need an empty string
Nathan Vu
@NathanVu
Aug 28 2017 18:58
oh so am I declaring a variable ?
Jason Luboff
@JLuboff
Aug 28 2017 18:58
@NathanVu Well, yes. var msg
Nathan Vu
@NathanVu
Aug 28 2017 18:58
okay got it...
Adit
@adittyagi
Aug 28 2017 18:58
Hey guys! I am having problem with json and stuff. From where should I learn about json,api's and ajax ?
For random quote machine!
Jason Luboff
@JLuboff
Aug 28 2017 18:59
@adittyagi I'd advise reading the docs for ajax, otherwise, I do not, sorry
Christopher McCormack
@cmccormack
Aug 28 2017 19:00
@JLuboff :wave:
Jason Luboff
@JLuboff
Aug 28 2017 19:01
@cmccormack Yo...whats good?
Christopher McCormack
@cmccormack
Aug 28 2017 19:01
nm, in an Agile training class the next three days :D
yourself?
Adit
@adittyagi
Aug 28 2017 19:01
@JLuboff oh ok thank you!
CamperBot
@camperbot
Aug 28 2017 19:01
adittyagi sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
:star2: 2174 | @jluboff |http://www.freecodecamp.com/jluboff
glitz20
@glitz20
Aug 28 2017 19:06
@maks-ushakov now I have solved those problems, but now the log says it has some problem with mongo
Maks Ushakov
@maks-ushakov
Aug 28 2017 19:07
@sabin20 i get 504 error timeout
glitz20
@glitz20
Aug 28 2017 19:08
@yeah me too
Jason Luboff
@JLuboff
Aug 28 2017 19:09
@cmccormack oh Agile, fun! Took my MTA: IT Infrastructure exam earlier, passed with an 87. So now I get another raise :+1:
Christopher McCormack
@cmccormack
Aug 28 2017 19:10
That's awesome man congrats!
how many left?
Jason Luboff
@JLuboff
Aug 28 2017 19:11
@cmccormack Thanks! I get another one after I pass the next two MTA exams (hopefully by the end of the year) and then another larger one after I earn my MCSA (a year to year and a half I think)
CamperBot
@camperbot
Aug 28 2017 19:11
jluboff sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1171 | @cmccormack |http://www.freecodecamp.com/cmccormack
Christopher McCormack
@cmccormack
Aug 28 2017 19:11
Haha I meant exams but more raises is nice as well
Jason Luboff
@JLuboff
Aug 28 2017 19:11
Well ya, 2 more MTA exams, then its 3 exams for the MCSA
Christopher McCormack
@cmccormack
Aug 28 2017 19:13
I don't know how you do all this and maintain a personal life haha
Jason Luboff
@JLuboff
Aug 28 2017 19:13
The MTA's are fairly simple, but I get to do a lot of studying while I work. I have a lot of downtime lol
Christopher McCormack
@cmccormack
Aug 28 2017 19:14
Oh that's always good, take advantage of it haha. when I used to have downtime I wasted it browsing Digg, now I wish I had studied more then haha
lunch break over, ttyl
Jason Luboff
@JLuboff
Aug 28 2017 19:15
Oh...I spend a lot of wasted time of reddit (and a little bit on Digg...digg is nothing compared to what it used to be)
See ya
Grigor Minasyan
@gogminsam
Aug 28 2017 19:20
Can someone help with this regexp in javascript, im trying to use or in US telephone numbers, is there any syntax error?
    var reg1 = /\d{10}/;
    var reg2 = /\d{3}-\d{3}-\d{4}/;
    if ((reg1+"|"+reg2).test(str)) {
      return true;
    }
Maks Ushakov
@maks-ushakov
Aug 28 2017 19:24
i think you can't concatenate regexp and return new regexp
Grigor Minasyan
@gogminsam
Aug 28 2017 19:26
@maks-ushakov so do i just have to .test(str) inside if() with OR?
Randell Dawson
@RandellDawson
Aug 28 2017 19:27
Create one regex like:
function testIt(str) {
    var reg = /^\d{10}$|\d{3}-\d{3}-\d{4}$/;
    if ((reg).test(str)) {
      return true;
    }
    return false;
}
Maks Ushakov
@maks-ushakov
Aug 28 2017 19:27
@gogminsam or use RegExp object, it allow to concatenate string
glitz20
@glitz20
Aug 28 2017 19:29
@maks-ushakov I did inspection and it says something wrong with your code. Check the log. but i couldnot find useful info in the log
piteto
@piteto
Aug 28 2017 19:32
@gogminsam you have to use two separate .test() methods or combine the regex. There is no need to return true for a method that returns true or false already:
  var reg1 = /\d{10}|\d{3}-\d{3}-\d{4}/;
  return reg1.test(str);
Grigor Minasyan
@gogminsam
Aug 28 2017 19:34
thanks @rmdawson71 @piteto I think i originally had a syntax error
CamperBot
@camperbot
Aug 28 2017 19:34
gogminsam sends brownie points to @rmdawson71 and @piteto :sparkles: :thumbsup: :sparkles:
:warning: @piteto's account is not linked with freeCodeCamp. Please visit the settings and link your GitHub account.
:cookie: 298 | @rmdawson71 |http://www.freecodecamp.com/rmdawson71
Maks Ushakov
@maks-ushakov
Aug 28 2017 19:43
@sabin20 sorry, you can't do inspection on glitch server, when you try it you get error and this message
Margaret Greaney
@greaneym
Aug 28 2017 19:48
hello, I nearly finished the first react challenge, building an app that allows one to use markdown and then find that the library mentioned, marked has a security issue. Is there a different library that could be used which does not have security/sanitation issues. Appreciate any help with this.
Maks Ushakov
@maks-ushakov
Aug 28 2017 19:49
@sabin20 I can download project now, so you too and use inspector on localhost, if you have NodeJS
glitz20
@glitz20
Aug 28 2017 19:50
@maks-ushakov sure
Margaret Greaney
@greaneym
Aug 28 2017 19:51
so far my searches on marked show that it is not maintained and so pages say to use a different library from "marked". Is "remarkable" ok to use?
Maks Ushakov
@maks-ushakov
Aug 28 2017 19:52
@sabin20 I go to sleep. and can check your project tomorrow.
glitz20
@glitz20
Aug 28 2017 19:53
@maks-ushakov sounds good. Thanks for your help today
CamperBot
@camperbot
Aug 28 2017 19:53
sabin20 sends brownie points to @maks-ushakov :sparkles: :thumbsup: :sparkles:
:cookie: 373 | @maks-ushakov |http://www.freecodecamp.com/maks-ushakov
Gersho
@Gersho
Aug 28 2017 19:55
@greaneym i'm sorry i'm not at react yet so i can't really help, have you tried the forum ? other users probably had the same issue you might find some alternative library there
Margaret Greaney
@greaneym
Aug 28 2017 19:56
@gersho, thanks I will try the forum but I have not been able to login there, even though I can login here.
CamperBot
@camperbot
Aug 28 2017 19:56
greaneym sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 364 | @gersho |http://www.freecodecamp.com/gersho
Stephen James
@sjames1958gm
Aug 28 2017 19:57
@greaneym I used marked I think it was good enough for this project.
Gersho
@Gersho
Aug 28 2017 19:57
i used the "log with github" option and it worked for me
Kelechi Chinaka
@ke1echi
Aug 28 2017 19:57
:wave: everyone
Gersho
@Gersho
Aug 28 2017 19:57
:wave:
Stephen James
@sjames1958gm
Aug 28 2017 19:57
@kelechy :wave:
Gersho
@Gersho
Aug 28 2017 19:58
@kelechy nice Law art <3
Kelechi Chinaka
@ke1echi
Aug 28 2017 19:58
@sjames1958gm how do i reference an element's index with map
Stephen James
@sjames1958gm
Aug 28 2017 19:58
@kelechy The second parameter is the index.
function(elem, index, array)
Kelechi Chinaka
@ke1echi
Aug 28 2017 19:58
function zebulansNightmare(functionName) {
  return functionName.replace(/_/g, ' ').split(' ').map((e,i) => {
    return e.charAt(0).toUpperCase() + e.slice(1)
  })
}
i need to do something to the first element
:smile: thanks @Gersho
CamperBot
@camperbot
Aug 28 2017 19:59
kelechy sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 365 | @gersho |http://www.freecodecamp.com/gersho
Kelechi Chinaka
@ke1echi
Aug 28 2017 20:00
i know, i cant see an example on the doc, can you show an example of using the index @sjames1958gm
Gersho
@Gersho
Aug 28 2017 20:01
wouldn't that be "i" in your code ?
Kelechi Chinaka
@ke1echi
Aug 28 2017 20:01
yea
but its not been used
Gersho
@Gersho
Aug 28 2017 20:02
well then use it, as you would any argument
return "the value was"+e+"it was found at index"+i;
Stephen James
@sjames1958gm
Aug 28 2017 20:03
here is a function that adds one to every odd indexed value
function add1Odd(arr) {
  return arr.map((e, i) => e + (i % 2))
}
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 20:21
Hello peeps
@sjames1958gm @cmccormack I have officially gotten the job at the startup. I am on training until November. I got live work to do and I did well with it. :) feeling excited. I remember @cmccormack wanted me to update him about my job process. :) Thanks to FCC and MDN I can say I am a frontend developer. :) Just need to strap on ReactJs in my took kit now.
CamperBot
@camperbot
Aug 28 2017 20:24
roniquericketts sends brownie points to @sjames1958gm and @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1173 | @cmccormack |http://www.freecodecamp.com/cmccormack
:star2: 8405 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Kelechi Chinaka
@ke1echi
Aug 28 2017 20:26
congrats @RoniqueRicketts :clap:
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 20:26
@kelechy :+1:
Excited. :dancers:
Jason Luboff
@JLuboff
Aug 28 2017 20:28
@RoniqueRicketts Way to go!
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 20:29
@JLuboff yeah. Watching your guys help people and getting help from you guys really paid off. Soon I will get better and become a fullstack dev. :)
Jason Luboff
@JLuboff
Aug 28 2017 20:30
:) :+1:
Roxroy
@roxroy
Aug 28 2017 20:32
@RoniqueRicketts , glad to hear the update and that things are dropping into place. Congrats on your accomplishment and belated Happy Birthday. Hope you got a chance to hangout with your bredrins, some r/stripes, w/nephew and some fems.
glitz20
@glitz20
Aug 28 2017 20:32
@JLuboff how far are you for backend certification?
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 20:32
I am happy I didn't give up. I started out having company, 8 persons learning from FCC and they all quit leaving me alone to learn this. Now I've gotten a job from learning through FCC, I've given up so often but ran back to coding as soon as I got too lazy and now I have a part-time jobn
@roxroy Yeah. I did man, thanks much. I chilled with my fiancee and drink some liquor. It was a pretty decent birthday. I get this is a good month so far Since I've gotten a web development job :)
CamperBot
@camperbot
Aug 28 2017 20:35
roniquericketts sends brownie points to @roxroy :sparkles: :thumbsup: :sparkles:
:star2: 1128 | @roxroy |http://www.freecodecamp.com/roxroy
Gersho
@Gersho
Aug 28 2017 20:40
@RoniqueRicketts congratulations
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 20:40
@Gersho thanks
CamperBot
@camperbot
Aug 28 2017 20:40
roniquericketts sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 366 | @gersho |http://www.freecodecamp.com/gersho
Jason Luboff
@JLuboff
Aug 28 2017 20:42
@sabin20 I have the last two Web apps to create still
glitz20
@glitz20
Aug 28 2017 20:42
how long have you been learning backend @JLuboff
Jason Luboff
@JLuboff
Aug 28 2017 20:43
@sabin20 March I believe
glitz20
@glitz20
Aug 28 2017 20:44
I have been trying to learn express and node since last 1 and half month, and I am still not catching things properly.
@JLuboff how did you start?
Jason Luboff
@JLuboff
Aug 28 2017 20:46
@sabin20 I went through several courses on udemy and then just kept going from there
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 20:46
@JLuboff were they paid courses?
Jason Luboff
@JLuboff
Aug 28 2017 20:47
@RoniqueRicketts Yes, I think I paid $15 for one and $10 for the other
Roxroy
@roxroy
Aug 28 2017 20:47
Yeah, I know, you were offline on that day. I think it was your first day off from FCC. But you know what, you earned it and have worked hard to deserve a break to spend sometime with your peps. Perseverance does pay off. Keep working hard and make your own path, others will notice can follow you. Mi proud a you.
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 20:48
@roxroy I still make a daily contribution. :) @JLuboff I am going to go through the free courses as much as possible then when it pays me enough I'll buy some udemy course for that nanodegre. I heard its worth it.
Roxroy
@roxroy
Aug 28 2017 20:49
@JLuboff , we may be at the same place in FCC. I also have 2 more project to complete - book swap and pintrest clone. Is this the same for you?
Jason Luboff
@JLuboff
Aug 28 2017 20:49
@RoniqueRicketts Try and get your company to pay for any courses you take. More often than not, they are willing to
@roxroy Yup. Finished stock chart last week. Been dragging my feet starting book swap
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 20:52
@JLuboff hehe. They want me to learn PHP a little too early 3:) I am not willing to go PHP as yet. :) I'll work my way into asking them to pay for the nanodegre to become a fullstack dev. :) But I won't leave out FCC So I will be around here for a while learning and all. :)
Roxroy
@roxroy
Aug 28 2017 20:55
@JLuboff , I finished Nightlife 3 weeks ago and have started on Book trade. Initially went with using ejs and jquery, but now have switched to react. Still trying to decide on how the trade request will work. But I really need to see if I can get it complete by this weekend. I really need to wrap up this cert by Sept. I already missed my July deadline.
Muhammad Hasham
@MohammadHasham
Aug 28 2017 20:56
@Pagnito yes!
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 20:57
@roxroy I too have to give myself deadlines to get things done.
Roxroy
@roxroy
Aug 28 2017 20:59
@RoniqueRicketts , it is straight PHP, or a framework? I used this site to learn PHP when I worked on a php project, laracasts.com. It has lots of php content, but it specializes on laravel. You can check it out to see if it is relevant.
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 21:00
@roxroy i'll have to use codeigniter
Cody Smith
@TheCodingSmith
Aug 28 2017 21:02
Can someone help me with https://www.freecodecamp.org/challenges/symmetric-difference ? I got it to return the difference of 2 strings, but I can't seem to figure out how to add in all the rest after that.

function sym(args) {
  var sets = Array.from(arguments);

  for(var x = 0; x < sets.length; x++){
    var combined = sets[x].concat(sets[x+1]).sort();
    var difference = combined;

    for(var i = 0; i < combined.length; i++) {
      var current = combined[i];
      var count = 0;

      for(var j = 0; j < combined.length; j++) {
        if(combined[i] == combined[j]){
          count++;
        }
      }
      if(count > 1) {
        for(var k = 0; k < combined.length; k++){
         if(current == combined[k]){
           combined.splice(k, 1);
           k = k - 1;
         } 
        }
      }
    }
    return combined;
  }


}

sym([1, 2, 5], [2, 3, 5], [3, 4, 5]);
Jason Luboff
@JLuboff
Aug 28 2017 21:03
@roxroy I've been using hbs(handlebars) and a mix of jquery/vanilla. I haven't done anything with Data viz (i.e react, angular, etc). The Web apps have been taking me about 2.5-3 weeks each
Roxroy
@roxroy
Aug 28 2017 21:03
@RoniqueRicketts , that's an older framework, but still very popular. There is lots of tutorial that will help you to started. Have to run but will link you next time.
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 21:08
@roxroy ok cool take care. I am really not ready for PHP as yet. I really wanted to get into nodejs and reactjs before
Roxroy
@roxroy
Aug 28 2017 21:09
@JLuboff , sometimes I am note sure what technology to use for the web proj. Should I use ejs with hbs and js or react. I like using vanilla JS, but love the idea of and ease of use of data binding. So the project end up taking me 3-4 weeks. But I am determined now to complete the current one by next week. No sleep , lot of coffee and a help of determination. I have to run now - will chat later.
Jason Luboff
@JLuboff
Aug 28 2017 21:10
@roxroy Good luck, have a good one
Adam Faraj
@adamfaraj
Aug 28 2017 21:15
@adamfaraj
hello everyone
was hoping someone here can help me
https://codepen.io/adamfaraj/pen/projLp
i'm trying to access the text within my <div class="wthr"></div>
so basically, trying to access "Clouds"
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 21:24
@adamfaraj document.querySelector(".wthr").textContent
Stephen James
@sjames1958gm
Aug 28 2017 21:32
@RoniqueRicketts :+1: :clap:
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 21:32
@sjames1958gm soon I'll join you big boys in the programming industry.
Stephen James
@sjames1958gm
Aug 28 2017 21:33
@RoniqueRicketts You go get 'em
Adam Faraj
@adamfaraj
Aug 28 2017 21:34
@RoniqueRicketts my man
@RoniqueRicketts actually, didn't work
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 21:50
@adamfaraj it works its just that it wont get clouds from the function outside. but if you put the same code within your then() you will have access to clouds.

@adamfaraj

 if (navigator.geolocation) { 
  navigator.geolocation.getCurrentPosition(function(position) {
      let lat = position.coords.latitude;
      let long = position.coords.longitude;
      let api = 'https://fcc-weather-api.glitch.me/api/current?lon='+ long + '&lat='+ lat;
      $.ajax({
        method:"GET",
        url: api,
        cache: false,
        datatype: "json"
      }).then(function(data)  {
        dom.city.html(data.name);
        temperatures.celsius = Math.floor(data.main.temp) +"°C";
        let fahr = Math.floor((data.main.temp) * 9/5 + 32) + "°F";
        dom.temp.html(temperatures.celsius);
        dom.wthr.html(data.weather[0].main);
        let iconpng = data.weather[0].icon;
        $('<img src="' + iconpng + '">').appendTo(dom.icon); 
        console.log(dom.wthr[0].innerHTML);
      });

this is what I did and I can see the text "Clouds"

Adam Faraj
@adamfaraj
Aug 28 2017 21:54
@RoniqueRicketts ahhhh
gotcha@
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2017 21:55
how can I save my frontend certification since that's html
Stephen James
@sjames1958gm
Aug 28 2017 21:56
@tiagocorreiaalmeida Congrats!
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 21:57
@tiagocorreiaalmeida What i did was screen capture it. Congrats
Stephen James
@sjames1958gm
Aug 28 2017 21:57
@adamfaraj
dom.wthr.textContent
should also be that text field (since you cache the DOM(
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2017 21:57
@sjames1958gm thanks feels like that stills much more to learn than in the start :D someone point me this http://eloquentjavascript.net/ will read it
CamperBot
@camperbot
Aug 28 2017 21:57
tiagocorreiaalmeida sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8406 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2017 21:58
and yeah @RoniqueRicketts thanks no idea why I didint rmemeber that
CamperBot
@camperbot
Aug 28 2017 21:58
tiagocorreiaalmeida sends brownie points to @roniquericketts :sparkles: :thumbsup: :sparkles:
:cookie: 379 | @roniquericketts |http://www.freecodecamp.com/roniquericketts
Ronique Ricketts
@RoniqueRicketts
Aug 28 2017 21:58
@tiagocorreiaalmeida Excitement I guess :)
Jason Luboff
@JLuboff
Aug 28 2017 22:04
@tiagocorreiaalmeida Personally wasn't a fan of Eloquent JS, didn't care for the writing style. I do like You Don't Know JS better (given I've only completed one of the books)
FlashHero
@FlashHero
Aug 28 2017 22:05

nodejs help please

UserSchema.methods.validPassword = function(password, next) {
    bcrypt.compare(password, this.password, function(err, isMatch) {
      if (err) {
        return next(err, false);
      }
      return next(null, isMatch);
    });
  };

I have this for the local strategy

passport.use(new LocalStrategy({
    usernameField: 'email',
    passwordField: 'password'
  },
    function(email, password, done) {
      User.findOne({ 'email': email }, function (err, user) {
        if (err) { return done(err); }
        if (!user) {
          return done(null, false, { message: 'Incorrect username.' });
        }
        if (!user.validPassword(password)) {
          return done(null, false, { message: 'Incorrect password.' });
        }
        return done(null, user);
      });
    }
  ));

I don't know why its not working it gives me error saying TypeError: next is not a function

Charlie Pham
@icharlie2
Aug 28 2017 22:19
you didn't pass a valid function @FlashHero
if (!user.validPassword(password)) {
the way you defined it, it's expecting "next" as a callback
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2017 22:21
@JLuboff didnt know those existed thanks do you think codefights arcde mode is a goodway of trainign js ?
CamperBot
@camperbot
Aug 28 2017 22:21
tiagocorreiaalmeida sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
:star2: 2175 | @jluboff |http://www.freecodecamp.com/jluboff
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2017 22:22
knew
FlashHero
@FlashHero
Aug 28 2017 22:26
@icharlie2 can you elaborate, I don't understand
Jason Luboff
@JLuboff
Aug 28 2017 22:27
@tiagocorreiaalmeida I haven't used codefights, not sure
Gersho
@Gersho
Aug 28 2017 22:29
someone knows a good site for python ? (0 python knowledge)
mstellaluna
@mstellaluna
Aug 28 2017 22:32
@Gersho paid or free ?
Gersho
@Gersho
Aug 28 2017 22:33
free
i just registered to codewars, i'm a bit lost in the interface but there seem to be plenty of content
mstellaluna
@mstellaluna
Aug 28 2017 22:39
I'm trying to find this link I had to a free course. they covered Django also
@Gersho ah crap he is re-designing his site so its garbage at the moment
@Gersho his vids are up on youtube while his site is being redesigned Master Code Online
Gersho
@Gersho
Aug 28 2017 22:43
i'm not a fan of coding videos but quality knowledge is valuable in any form, thanks @mstellaluna
CamperBot
@camperbot
Aug 28 2017 22:43
gersho sends brownie points to @mstellaluna :sparkles: :thumbsup: :sparkles:
:cookie: 721 | @mstellaluna |http://www.freecodecamp.com/mstellaluna
mstellaluna
@mstellaluna
Aug 28 2017 22:43
@Gersho I used either udemy paid or this guy
try asking in the FCC python room, its not very active but eventually someone will answer you
Gersho
@Gersho
Aug 28 2017 22:44
oh didn't know there was one, since fcc doesn't cover python i assumed there wouldn't be one
Idowu Wasiu
@Hoxtygen
Aug 28 2017 22:56
anybody home?
Brian
@BrianCodes33
Aug 28 2017 22:58
need to get the frequency of each and every character

function charFreq(message) {
  let splitStr = message.split(' ');
  splitStr.map((word) => {

  })
}

charFreq("I like cats"), {'a': 1, ' ': 2, 'c': 1, 'e': 1, 'I': 1, 'k': 1, 'l': 1, 'i': 1, 's': 1, 't': 1})
Fernando
@lestairon
Aug 28 2017 23:10

function destroyer(arr) {
  // Remove all the values
  var args = Array.from(arguments).slice(1);
  return arr.filter((L) => !args.includes(L));
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
What does the ! on "!args..." mean?
Jason Luboff
@JLuboff
Aug 28 2017 23:11
@lestairon It saying args does NOT include L
Fernando
@lestairon
Aug 28 2017 23:11
Oh, so it works like !=
Jason Luboff
@JLuboff
Aug 28 2017 23:11
Yes
korzo
@korzo
Aug 28 2017 23:12
@lestairon generally yes, but include returns boolean, so ! turns true to false and false to true
Moisés Man
@moigithub
Aug 28 2017 23:45
! NOT operator
Conor Murphy
@cmurphy580
Aug 28 2017 23:50
Any reason why my Javascript does not work on Safari and any browser on my iphone?