deslice
v1.0.0
Published
Double-ended slice method (Array.prototype.slice).
Downloads
6
Maintainers
Readme
deslice
The slice method (Array.prototype.slice) but endless.
Installation
npm add deslice
Usage
import deslice from 'deslice';
const arr = [0, 1, 2, 3, 4, 5]
deslice(arr) // > [0, 1, 2, 3, 4, 5]
deslice(arr, 3) // > [3, 4, 5]
deslice(arr, -3) // > [3, 4, 5, 0, 1, 2]
deslice(arr, 2, 4) // > [2, 3]
deslice(arr, 2, -2) // > [2, 3]
deslice(arr, -2, 2) // > [4, 5, 0, 1]
License
This project is licensed under Apache License, version 2.0.