Hi i want to split an array by some given count.
arr = [0,1,2,3,4,5,6,7,8,9,10]
$scope.arraySpliter(arr);
$scope.arraySpliter = function (a) {
var arrays = [], size = 3;
var tempCount = Math.ceil(a.length / 3);
while (a.length > 0)
arrays.push(a.splice(0, tempCount));
console.log(arrays);
};
I want split array like this. [0,1,2,3][4,5,6,7][8,9,10]