chunk([0,1,2,3,4,5,6], 3) // => [[0,1,2],[3,4,5],[6]]
chunk([0, 1, 2, 3, 4, 5, 6], 10); // [[0, 1, 2, 3, 4, 5, 6]]
chunk([0, 1, 2, 3, 4, 5, 6], 1); // [[0], [1], [2], [3], [4], [5], [6]]
chunk([0, 1, 2, 3, 4, 5, 6], 0); // [0, 1, 2, 3, 4, 5, 6]
chunk([0, 1, 2, 3, 4, 5, 6], -1); // [0, 1, 2, 3, 4, 5, 6]
chunk([0, 1, 2, 3, 4, 5, 6], 3); // [[0, 1, 2], [3, 4, 5], [6]]
chunk([0, 1, 2, 3, 4, 5], 3); // [[0, 1, 2], [3, 4, 5]]
chunk([0, 1, 2, 3, 4], 3); // [[0, 1, 2], [3, 4]]
const emptyArr: any[] = [];
chunk(emptyArr, 3); // []
chunk(emptyArr, 3) !== emptyArr; // true
chunk({} as any, 3); // []
数组分片