function sliceIntoChunks(arr, chunkSize) {
  const res = [];
  for (let i = 0; i < arr.length; i += chunkSize) {
    const chunk = arr.slice(i, i + chunkSize);
    res.push(chunk);
  }
  return res;
}
Divide an array into chunks of `chunkSize`
@param {any[]} arr
@param {Number} chunkSize
@return {Array<Array<any>>}