Chunky Monkey is funky!

Chunky Monkey is funky!
0.0 0

#1

Tell us what’s happening:
Okay, so I guess I’m nearly there. But somehow it is taking the second index along with it while slicing…
Can anyone explain what I might be doing wrong…?

Your code so far

    var chunkedArray = [];
    for (var i = 0; i < arr.length; i++) {
        chunkedArray.push(arr.slice(i, i+size));

    }
    console.log(chunkedArray); //[a,b],[b,c],[c,d],[d]
    return chunkedArray;
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:


#2

The fCC algorithms are designed to challenge your brain. This is just that. This is because in programming you have to face challenges and do debugging.


#3

This about your loop’s iterator. Do you really need to increment by one?


#4

Yo, got it! That was selecting every next element.