const listChunck = ({ list = [ ], size = 1}) => {
let result = [];
if (size <= 0) return [];
while (list.length) {
result.push(list.splice(0, size));
}
return result;
}
const listChunck = ({ list = [ ], size = 1}) => {
let result = [];
if (size <= 0) return [];
while (list.length) {
result.push(list.splice(0, size));
}
return result;
}
本文标题:分割指定长度的数组
本文链接:https://www.haomeiwen.com/subject/jgloihtx.html
网友评论