UNPKG

@extra-array/entries

Version:
43 lines (30 loc) 1.18 kB
Lists all index-value pairs. [:package:](https://www.npmjs.com/package/@extra-array/entries) [:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array) [:running:](https://npm.runkit.com/@extra-array/entries) [:vhs:](https://asciinema.org/a/332041) [:moon:](https://www.npmjs.com/package/@extra-array/entries.min) [:scroll:](https://unpkg.com/@extra-array/entries/) [:newspaper:](https://nodef.github.io/extra-array/) [:blue_book:](https://github.com/nodef/extra-array/wiki/) > Similar: [keys], [values], [entries]. > This is part of package [extra-array]. [extra-array]: https://www.npmjs.com/package/extra-array <br> ```javascript array.entries(x); // x: an array ``` ```javascript const array = require("extra-array"); var x = ["A", "B", "C"]; [...array.entries(x)]; // [ [ 0, "A" ], [ 1, "B" ], [ 2, "C" ] ] ``` <br> <br> ## References - [Array.prototype.entries: MDN web docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) [keys]: https://github.com/nodef/extra-array/wiki/keys [values]: https://github.com/nodef/extra-array/wiki/values [entries]: https://github.com/nodef/extra-array/wiki/entries