Fix range utils, move array chunk util to shared
This commit is contained in:
@@ -850,4 +850,14 @@ function getRandom(min, max) {
|
||||
return Math.floor(Math.random() * (toInteger(max) - toInteger(min) + 1)) + toInteger(min)
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function splitArrayIntoChunks(originalArray, perChunk) {
|
||||
let tempArray = [];
|
||||
for (let i = 0; i < originalArray.length; i += perChunk) {
|
||||
tempArray.push(originalArray.slice(i, i + perChunk));
|
||||
}
|
||||
return tempArray;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user