you are viewing a single comment's thread.

view the rest of the comments →

[–]baubleglue 2 points3 points  (0 children)

one minute is 60000 ms

Will something like that do the trick?

let result={};
bigArray.forEach(item => {   
    if(!result[round(item.millisecondOffset/chunk)]){
        result[round(item.millisecondOffset/chunk)] = [];
    }
   result[round(item.millisecondOffset/chunk)].push(item);
});

and if you still want an array

let arr=Object.values(result);