Skip to content
Subhajit Sahu edited this page Dec 22, 2022 · 9 revisions

Check if entries has a key.

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


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

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

entries.has(x, "c");
// → true


References

Clone this wiki locally