2.2.5 • Published 5 years ago
@extra-object/has v2.2.5
Checks if object has a key. :running: :package: :ledger:
Alternatives: has, hasValue, hasEntry, hasSubset, hasPath. Similar: key, keys, has. This is part of package extra-object.
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