a-slice
v1.0.0
Published
Javascript native array slice alternative
Downloads
2
Readme
a-slice
JavaScript native array slice alternative
Install
$ npm install --save a-slice
Example
var slice = require('a-slice');
console.log(slice([1, 2, 3, 4, 5], 1, 4));
// - > [ 2, 3, 4 ]
console.log(slice([1, 2, 3, 4, 5], -2, 5));
// -> [4, 5]
require('a-slice')(array, start, end)
Arguments:
array
: An array that to be slicedstart
: start point of array slicing. It can be negativeend
: end point of array slicing. It can be negative
Returns: Returns a new array with sliced contend of original array
License
© 2016 Vikram Jadhav. MIT License