split-into-batches
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Split Into Batches

Splits long arrays into batches of a specified size.

Example

import splitIntoBatches from "split-into-batches";

const longArray = ["a", "b", "c", "d", "e"];
const batches = splitIntoBatches(longArray, 2);

console.log(batches);

// [ [ 'a', 'b' ], [ 'c', 'd' ], [ 'e' ] ]

Readme

Keywords

none

Package Sidebar

Install

npm i split-into-batches

Weekly Downloads

0

Version

0.1.3

License

MIT

Unpacked Size

2.11 kB

Total Files

5

Last publish

Collaborators

  • andrew_rothman