Skip to content
Subhajit Sahu edited this page Dec 28, 2022 · 10 revisions

Check if lists has a key.

Alternatives: has, hasValue, hasEntry, hasSubset, hasPath.
Similar: randomKey, keys, has.


function has(x, k)
// x: lists
// k: search key
const xlists = require('extra-lists');

var x = [['a', 'b', 'c'], [1, 2, -3]];
xlists.has(x, 'd');
// → false

xlists.has(x, 'c');
// → true


References

Clone this wiki locally