a-slice

1.0.0 • Public • Published

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 sliced
  • start: start point of array slicing. It can be negative
  • end: 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

Readme

Keywords

Package Sidebar

Install

npm i a-slice

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • vikramcse