scrimba
Note at 1:30
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Note at 1:30
AboutCommentsNotes
Note at 1:30
Expand for more info
main.js
run
preview
console
function chunkyMonkey(values, size) {
const nested = [];
let count = 0;

while(count < values.length) {
nested.push(values.slice(count, count += size));
}

return nested;
}



/**
* Test Suite
*/
describe('chunkyMonkey()', () => {
it('returns largest positive integer possible for digit count', () => {
// arrange
const values = ["a", "b", "c", "d"];
const size = 2;

// act
const result = chunkyMonkey(values, size);

// log
console.log("result: ", result);

// assert
expect(result).toEqual([["a", "b"], ["c", "d"]]);
});
});
Console
"result: a,b,c,d "
,
/index.html
LIVE