Checks if array has a key.
npm install @extra-array/has-keyChecks if array has a key. [:running:] [:vhs:] [:package:] [:moon:] [:ledger:]
> Similar: [value], [values], [hasValue], [searchValue].
> Similar: [hasValue], [hasPrefix], [hasInfix], [hasSuffix], [hasSubsequence], [hasPermutation].
> This is part of package [extra-array].
[extra-array]: https://www.npmjs.com/package/extra-array
``javascript`
array.hasKey(x, [k]);
// x: an array
// k: key?
`javascript
const array = require('extra-array');
var x = [10, 20, 30];
array.hasKey(x, 2);
// true
array.hasKey(x, 3);
// false
array.hasKey(x, -1);
// true
``
- Array.prototype.includes: MDN web docs
- array-tools.contains: @75lb
[value]: https://github.com/nodef/extra-array/wiki/value
[values]: https://github.com/nodef/extra-array/wiki/values
[hasValue]: https://github.com/nodef/extra-array/wiki/hasValue
[searchValue]: https://github.com/nodef/extra-array/wiki/searchValue
[hasPrefix]: https://github.com/nodef/extra-array/wiki/hasPrefix
[hasInfix]: https://github.com/nodef/extra-array/wiki/hasInfix
[hasSuffix]: https://github.com/nodef/extra-array/wiki/hasSuffix
[hasSubsequence]: https://github.com/nodef/extra-array/wiki/hasSubsequence
[hasPermutation]: https://github.com/nodef/extra-array/wiki/hasPermutation
[:running:]: https://npm.runkit.com/@extra-array/has-key
[:vhs:]: https://asciinema.org/a/343739
[:package:]: https://www.npmjs.com/package/@extra-array/has-key
[:moon:]: https://www.npmjs.com/package/@extra-array/has-key.min
[:ledger:]: https://unpkg.com/@extra-array/has-key/