egg-slicer
v0.0.2
Published
egg-slicer
Downloads
2
Readme
egg-slicer
Install
npm i egg-slicer -S
Usage
1
const EggSlicer = require('egg-slicer');
const arr = Array.from(Array(1000).keys()); // [0..999];
const slicedArr = EggSlicer.slice(arr, 4);
console.log(slicedArr);
=> [
[0 ... 249],
[250 ... 499],
[500 ... 749],
[750 ... 999]
]
2
const EggSlicer = require('egg-slicer');
const arr = Array.from(Array(999).keys()); // [0..998];
const slicedArr = EggSlicer.slice(arr, 4);
console.log(slicedArr);
=> [
[0 ... 248],
[249 ... 497],
[498 ... 746],
[747 ... 998]
]