The slice method (Array.prototype.slice) but endless.
npm add endless-slice
import slice from 'endless-slice';
const arr = [0, 1, 2, 3, 4, 5];
slice(arr); // => [0, 1, 2, 3, 4, 5]
slice(arr, 3); // => [3, 4, 5]
slice(arr, -2); // => [4, 5]
slice(arr, 2, 4); // => [2, 3]
slice(arr, -2, 2); // => [4, 5, 0, 1]
This project is licensed under Apache License, version 2.0.