function slp(arr,size){
//код функции
return arr;
}
console.log(spl([1,2,3,4,5,6,8],2)); //[[1,2],[3,4],[5,6],[8]]
function spl(arr, size) {
var result = [];
var len = arr.length;
for (var i=0; i<len; i+=size) {
result.push(arr.slice(i,i+size));
}
return result;
}