Skip to content

entries

Subhajit Sahu edited this page Feb 3, 2021 · 17 revisions

List all index-value pairs.

Similar: keys, values, entries.


function entries(x)
// x: an iterable
const xiterable = require('extra-iterable');

var x = ["A", "B", "C"];
[...xiterable.entries(x)];
// → [[0, "A"], [1, "B"], [2, "C"]]


References

Clone this wiki locally