js工具类:
①按照指定长度分割数组:
function list_split(array, listLen) {
if (array.length <= listLen) {
return [array]
}
let index = 0;
let newArray = [];
while(index < array.length) {
newArray.push(array.slice(index, index += listLen));
}
return newArray;
}