Skip to content

entries

Subhajit Sahu edited this page Dec 8, 2022 · 12 revisions

Obtain all index-value pairs.

Similar: keys, values, entries.


function entries(x)
// x: an array
const xarray = require('extra-array');

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


References

Clone this wiki locally