UNPKG

299 BMarkdownView Raw
1# chunkd
2
3> Get a chunk of an array based on the total number of chunks and current index
4
5## Install
6
7```sh
8yarn add [--dev] chunkd
9```
10
11## Example
12
13```js
14const chunkd = require("chunkd")
15
16chunkd([1, 2, 3, 4], 0, 3) // [1, 2]
17chunkd([1, 2, 3, 4], 1, 3) // [3]
18chunkd([1, 2, 3, 4], 2, 3) // [4]
19```