const result = data.reduce(
([result,nextNum],item)=>{
if(nextNum===undefined){
nextNum=item.id;
result.push([]);
}
if(!(nextNum===item.id)){
result.push([]);
}
result[result.length-1].push(item);
return [result,item.id+1];
},
[[],undefined]
);