var spArray = function(N,data)
{
var Data = [];
for (let i = 0;i < data.length; i++) {
Data .push(data.slice(i,i += N))
}
return Data
}
let arr = [1,2,3,4,5,6,7,8,9,10,11,12,13,14];
//N:以多少为一组
console.log(spArray(N,arr))
var spArray = function(N,data)
{
var Data = [];
for (let i = 0;i < data.length; i++) {
Data .push(data.slice(i,i += N))
}
return Data
}
let arr = [1,2,3,4,5,6,7,8,9,10,11,12,13,14];
//N:以多少为一组
console.log(spArray(N,arr))