-
Notifications
You must be signed in to change notification settings - Fork 1
slice
wolfram77 edited this page Mar 27, 2020
·
23 revisions
Gets a part of iterable.
iterable.slice(x, [i], [I]);
// x: an iterable
// i: start index (0)
// I: end index (end)
const iterable = require('extra-iterable');
var x = [1, 2, 3, 4, 5];
[...iterable.slice(x, 2)];
// [3, 4, 5]
[...iterable.slice(x, 2, 4)];
// [3, 4]