hasOwnProperty()
method returns a boolean indicating whether the object has the specified property as own (not inherited) property.
In given case -
testObject = {a: undefined};
testObject.hasOwnProperty('a') //true
testObject.hasOwnProperty('b') //false
No comments:
Post a Comment