Gets a part of array.
npm install @extra-array/slice-update.minGets a part of array.
:package:
:smiley_cat:
:running:
:vhs:
:moon:
:scroll:
:newspaper:
:blue_book:
> Alternatives: [slice], [slice$].
> This is part of package [extra-array].
[extra-array]: https://www.npmjs.com/package/extra-array
> This is browserified, minified version of [@extra-array/slice-update].
> It is exported as global variable array_slice$.
> CDN: [unpkg], [jsDelivr].
[@extra-array/slice-update]: https://www.npmjs.com/package/@extra-array/slice-update
[unpkg]: https://unpkg.com/@extra-array/slice-update.min
[jsDelivr]: https://cdn.jsdelivr.net/npm/@extra-array/slice-update.min
``javascript`
array.slice$(x, [i], [I]);
// x: an array (updated)
// i: start index (0)
// I: end index (X)
// → x
`javascript
const array = require("extra-array");
var x = [1, 2, 3, 4, 5];
array.slice$(x, 2);
// [ 3, 4, 5 ]
x;
// [ 3, 4, 5 ]
var x = [1, 2, 3, 4, 5];
array.slice$(x, 2, 4);
// [ 3, 4 ]
var x = [1, 2, 3, 4, 5];
array.slice$(x, -3, -1);
// [ 3, 4 ]
``
- Array.prototype.slice: MDN web docs
- _.slice: lodash
[slice]: https://github.com/nodef/extra-array/wiki/slice
[slice$]: https://github.com/nodef/extra-array/wiki/slice$