分割数组

function chunkArrayInGroups(arr, size) {

let [start, end, result] = [null, null, []];

for(let i=0;i<Math.ceil(arr.length/size);i++){

start=i*size;

end=start+size

result.push(arr.slice(start,end))

}

return result

}

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