Skip to content

Instantly share code, notes, and snippets.

Niklas Fondberg fondberg

Block or report user

Report or block fondberg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Split array into N number of arrays
const splitArray = (inArray, buckets) => {
return inArray.reduce((retArr, value, index) => {
const bucket = index % buckets;
if (!retArr[bucket]) {
retArr[bucket] = [];
}
retArr[bucket].push(value)
return retArr
}, [[]]);
}
You can’t perform that action at this time.