let chunk = function(arr, num){
num = num*1 || 1;
let ret = [];
arr.forEach(function(item, i){
if(i % num === 0){
ret.push([]);
}
ret[ret.length - 1].push(item);
});
return ret;
};

相关文章:

  • 2021-09-19
  • 2021-12-10
  • 2022-12-23
  • 2021-12-18
  • 2021-10-18
  • 2021-10-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案