Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 888 Bytes

README.md

File metadata and controls

32 lines (22 loc) · 888 Bytes

deslice

Double-ended slice method (Array.prototype.slice).

npm Build Status License

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.