The constructor property returns a regular expression's constructor function:
The result of res will be:
In JavaScript, the constructor property returns the constructor function for an object.
The return value is a reference to the function, not the name of the function:
For JavaScript regular expressions the constructor property returns function RegExp() { [native code] }
For JavaScript numbers the constructor property returns function Number() { [native code] }
For JavaScript strings the constructor property returns function String() { [native code] }
The constructor property is supported in all major browsers.
Return Value: | function RegExp() { [native code] } |
---|---|
JavaScript Version: | 1.1 |