Determines whether the provided value has an own property.
The property key type expected to exist on the object.
The object to be used to check for an own property.
The property key to be checked.
true if the value has an own property, otherwise false.
true
false
This function is an alias for Object.prototype.hasOwnProperty but more robust.
Object.prototype.hasOwnProperty
const obj = { a: 1 };hasOwn(obj, 'a'); // truehasOwn(obj, 'b'); // false Copy
const obj = { a: 1 };hasOwn(obj, 'a'); // truehasOwn(obj, 'b'); // false
1.0
Determines whether the provided value has an own property.