-
Notifications
You must be signed in to change notification settings - Fork 3
has
Subhajit Sahu edited this page Dec 8, 2022
·
6 revisions
Check if object has a key.
Similar: has, hasValue, hasEntry, hasSubset, hasPath.
Similar: keys, has, randomKey.
Similar: keys, values, entries.
function has(x, k)
// x: an object
// k: search key
const object = require('extra-object');
var x = {a: 1, b: 2, c: -3};
object.has(x, 'd');
// → false
object.has(x, 'c');
// → true