This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* chunk array into specific chunks :) | |
* @param arr | |
* @param len | |
* @returns {Array} | |
*/ | |
function chunkArray(arr, len) { | |
if (!Array.isArray(arr)) return []; | |
let chunks = [], | |
i = 0, |