has - nodef/extra-map GitHub Wiki

Check if map has a key.

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

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

var x = new Map(['a', 1], ['b', 2], ['c', -3](/nodef/extra-map/wiki/'a',-1],-['b',-2],-['c',--3));
map.has(x, 'd');
// → false

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

References