has - nodef/extra-lists GitHub Wiki

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](/nodef/extra-lists/wiki/'a',-'b',-'c'],-[1,-2,--3);
xlists.has(x, 'd');
// → false

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

References