-
Notifications
You must be signed in to change notification settings - Fork 3
has
Subhajit Sahu edited this page Jun 28, 2020
·
6 revisions
Checks if object has a key. 🏃 📼 📦 🌔 📒
Alternatives: has, [hasValue], [hasEntry], [hasSubset], [hasPath].
Similar: key, keys, has.
object.has(x, k);
// x: an object
// k: key?const object = require('extra-object');
var x = {a: 1, b: 2, c: -3};
object.has(x, 'd');
// false
object.has(x, 'c');
// true