JSFiddle - React, Tailwind, and code Playground

by Anik Islam Abhi

JavaScript

var data=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18];

var a=-1,temp=[];
data.forEach(function(item,index){
  if(index%6==0){
    temp[++a]=[];
  }
  temp[a].push(item);
});
console.log(temp);