Skip to content
Subhajit Sahu edited this page Mar 15, 2020 · 24 revisions

Keeps only the selected region.

array.slice$(x, [i], [I]);
// x: an array
// i: start index (0)
// I: end index   (x.length)
// --> x
const array = require('extra-array');

var a = [1, 2, 3, 4, 5];
array.slice$(a, 2);
// [3, 4, 5]

array.slice$(a, 2, 4);
// [3, 4]

references

Clone this wiki locally