The object to query.
The key to check.
Returns true
if key
exists, else false
.
5.3.0
[[hasIn]],[[hasPath]],[[hasPathIn]]
const object = { 'a': { 'b': 2 } }
const other = create({ 'a': create({ 'b': 2 }) })
has(object, 'a')
// => true
has(other, 'a')
// => false
Checks if
key
is a direct property ofobject
.