Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Jack Lyons
@JackEdwardLyons
but i have no idea whats going
Islam Ibakaev
@dagman
@JackEdwardLyons it is not hard at all
Jack Lyons
@JackEdwardLyons
so you slice away the brackets on source ?
Islam Ibakaev
@dagman
@JackEdwardLyons yep
Jack Lyons
@JackEdwardLyons
then return first right away? why?
Islam Ibakaev
@dagman
@JackEdwardLyons the first get under .map .fiter and .map
Dan Logajan
@hiltydiggs
@dagman nice work!
Islam Ibakaev
@dagman
@JackEdwardLyons you should check docs on this methods and also JSON.stringify and JSON.parse and i bet all stuff suddenly will be easy to understand
@hiltydiggs thx :smile:
CamperBot
@camperbot
dagman sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 554 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
Jack Lyons
@JackEdwardLyons
ok thanks @dagman
CamperBot
@camperbot
jackedwardlyons sends brownie points to @dagman :sparkles: :thumbsup: :sparkles:
:warning: jackedwardlyons already gave dagman points
Islam Ibakaev
@dagman
@JackEdwardLyons yw
Gabriel Alexandre
@GabrielShaad
Any help with the navbar?
Jack Lyons
@JackEdwardLyons
can someone please explain nested for loops with variables that have something like this
variable[i][j]
when it is nested in two loops
what does that mean
Greg Duncan
@GregatGit
@JackEdwardLyons i simple one would be to console.log each number in this arr var myArr = [ [1, 2 ], [3, 4 ] ];

@JackEdwardLyons

var myArr = [ [1,2], [3,4]];

for (var i = 0; i < myArr.length; i++){
    for (var j = 0; j < myArr[i].length; j++)
        console.log(myArr[i][j]);
}

the second for loop is nested in the first

Jack Lyons
@JackEdwardLyons
ah ok
so its not like bracket notation?
so it adds [i] first then [j]
Greg Duncan
@GregatGit
console.log(myArr[1][0]); / / => 3
@JackEdwardLyons there is no adding
Jack Lyons
@JackEdwardLyons
it displays
Greg Duncan
@GregatGit
it accesses it
var myArr = [ [1,2], [3,4]];
myArr[0][1] = 'apple';

for (var i = 0; i < myArr.length; i++){
    for (var j = 0; j < myArr[i].length; j++)
        console.log(myArr[i][j]);
}
that for loop would put out
1
apple
3
4
Greg Duncan
@GregatGit
@JackEdwardLyons I looked at your code
source.length is undefined
Jack Lyons
@JackEdwardLyons
ok
Greg Duncan
@GregatGit
source is an object.
Jack Lyons
@JackEdwardLyons
thanks @GregatGit i think i got it
CamperBot
@camperbot
jackedwardlyons sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 612 | @gregatgit |http://www.freecodecamp.com/gregatgit
Jack Lyons
@JackEdwardLyons
yeah, so this code...
collection[i][sourceKey[j]]
how does it work?
Greg Duncan
@GregatGit
@JackEdwardLyons do you know how to run a snippet in the chrome dev tools?
collection[i][sourceKey[j]] - collection is an array so collection[i] will give you the first thing in the collection that happens to be an object
becauce collection[i] is an object if you put a property in [] after it - since sourceKey[j] is a string
Lars
@Oppenheimer1
is anyone around I can ask code questions to?
Greg Duncan
@GregatGit
@Oppenheimer1 we might be able to help
Lars
@Oppenheimer1
I just figured it out. I was trying to see why my code wasn't passing all the tests but it's because I built it to pass the function and not to remove items from the array using shift but here's what I had for the Drop it algorithm
function dropElements(arr, func) {
// Drop them elements.
var newArr = [];
for(var i=0; i<arr.length; i++){
if(func(arr[i]) === true){
newArr.push(arr[i]);
}
}
return newArr;
}
dropElements([1, 2, 3], function(n) {return n < 3; });
also how do I get my code to display like code and not like this in a post
Greg Duncan
@GregatGit
``` on a seperate line before and after the code
you can just edit your post above
Dan Logajan
@hiltydiggs
use three backticks (left of the '1' key) before and after the code