// => [['a'], ['b'], ['c'], ['d'], ['e']] splitArrayIntoBatches(array, 2); // => [['a', 'b'], ['c', 'd'], ['e']] splitArrayIntoBatches(array, 3); // => [['a', 'b', 'c'], ['d', 'e']] splitArrayIntoBatches(array, 4); // => [['a', 'b', 'c', 'd'], ['e']] splitArrayIntoBatches(array, 5); // => [['a', 'b', 'c', 'd', 'e']]