📅  最后修改于: 2022-03-11 15:02:51.289000             🧑  作者: Mango
let chunk = (arr, size) => arr.reduce((acc, e, i) => (i % size ? acc[acc.length - 1].push(e) : acc.push([e]), acc), []);
let xy = ['2','4','6','7','8','10','20','33','35']
console.log(chunk(xy, xy.length))