Chunky monkey: undefined in first element of Array

[],[0,1,2,],[3,4,5,],[6] is the output i get from the following code

function chunkArrayInGroups(arr, size) {

var newarr=[[]];// Break it up.
for (var i=0; i<arr.length; i+=size){
newarr.push(arr.slice(i,i+size) );


return newarr;


chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3);

Double check your variables- what are you initializing newarr to and why?

changed newarr assignment to newarr=[ ];
Thank you