baniol
1/15/2014 - 9:33 AM

array, slice

array, slice

var arr = [1,2,3,4,5,6];
var step = 3;
arr.forEach(function (el, i) {
  if (i % step === 0) {
    var c = arr.slice(i, i+step);
    console.log(c)
  }
});