1.0.0 • Published 4 years ago
@feizheng/next-chunk v1.0.0
next-chunk
Creates an array of elements split into groups the length of size.
installation
npm install -S @feizheng/next-chunk
apis
api | type | description |
---|---|---|
nx.chunk | (inArray,inChunk) | Create split chunks |
usage
import '@feizheng/next-chunk';
const arr = [1,2,3,4,5,6,7,8];
const res = nx.chunk(arr, 3);
/*
[
[ 1, 2, 3 ],
[ 4, 5, 6 ],
[ 7, 8 ]
]
*/
1.0.0
4 years ago