Returns a Boolean value indicating whether an object has a property with the specified name.
|
---|
object.hasOwnProperty(proName) |
Arguments
-
object
-
Required. Instance of an object.
-
proName
-
Required. String value of a property name.
Remarks
Example
In the following example, all String objects share a common split method. The following code will print false and true.
| Copy Code |
---|
var s = new String("JScript");
print(s.hasOwnProperty("split"));
print(String.prototype.hasOwnProperty("split")); |
Requirements
See Also