hasOwnProperty Method (Object) (JavaScript)
JavaScript - Internet Explorer 10
Determines whether an object has a property with the specified name.
object.hasOwnProperty(proName)
In the following example, all String objects share a common split method. The following code will display false and true.
var s = new String("Sample"); document.write(s.hasOwnProperty("split")); document.write("<br/>"); document.write(String.prototype.hasOwnProperty("split")); // Output: // false // true
Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards. Also supported in Windows Store apps. See Version Information.