Utils/utility_functions.js
/**
 * Returns an array with arrays of the given size.
 *
 * @param {Array} myArray  array to split
 * @param {BigInteger} chunk_size Size of every group
 */
Returns an array with arrays of the given size.
@param {Array} myArray  array to split
@param {BigInteger} chunk_size Size of every group
Returns an array with arrays of the given size . @param { Array } myArray array to split @param { BigInteger } chunk_size Size of every group
function chunkArray(myArray, chunk_size) {
    let index = 0;
    let arrayLength = myArray.length;
    let tempArray = [];
    for (index = 0; index < arrayLength; index += chunk_size) {
        let myChunk = myArray.slice(index, index + chunk_size);
        tempArray.push(myChunk);
    }
    return tempArray;
}
function chunkArray ( myArray , chunk_size ) { let index = 0 ; let arrayLength = myArray . length ; let tempArray = [ ] ; for ( index = 0 ; index < arrayLength ; index += chunk_size ) { let myChunk = myArray . slice ( index , index + chunk_size ) ; tempArray . push ( myChunk ) ; } return tempArray ; }
Returns an array with arrays of the given size.
Returns an array with arrays of the given size .
// Do something if you want with the group