UNPKG

@extra-array/keys

Version:
43 lines (30 loc) 1.12 kB
Lists all indices. [:package:](https://www.npmjs.com/package/@extra-array/keys) [:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array) [:running:](https://npm.runkit.com/@extra-array/keys) [:vhs:](https://asciinema.org/a/332087) [:moon:](https://www.npmjs.com/package/@extra-array/keys.min) [:scroll:](https://unpkg.com/@extra-array/keys/) [: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.keys(x); // x: an array ``` ```javascript const array = require("extra-array"); var x = [1, 2, 3]; [...array.keys(x)]; // [ 0, 1, 2 ] ``` <br> <br> ## References - [Array.prototype.keys: MDN web docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/keys) [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