hasOwnProperty is a method of the object object in JavaScript. It is used to check whether the calling object has the specified key as a direct member. It does not traverse the prototype chain.
hasOwnProperty is a method of most objects. A notable exception is the window object in IE.