Checks whether a string has a specified property.
| Parameters | Description |
|---|---|
| property | The name of a property. |
| Return value | Description |
|---|---|
| boolean | True if the object has the property; otherwise false. |
var regexp = /(Moscow)/;
return "constructor = " + regexp.hasOwnProperty("constructor") +
"\nlength = " + regexp.hasOwnProperty("length") +
"\nprototype = " + regexp.hasOwnProperty("prototype")