Skip to content

entries

Subhajit Sahu edited this page May 10, 2020 · 17 revisions

Gets part of an iterable. [:running:] [:vhs:] [:package:] [:moon:]

Similar: [keys], [values], [entries].

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];
[...iterable.entries(x)];
// [ [0, 1], [1, 2], [2, 3] ]

references

Clone this wiki locally