Skip to content
wolfram77 edited this page Mar 27, 2020 · 23 revisions

Gets a part of iterable.

Alternatives: default, update.

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]

references

Clone this wiki locally