HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

JavaScript RegExp constructor Property

RegExp Object Reference JavaScript RegExp Object

Example

Return the function that created the RegExp object's prototype:

var patt = new RegExp("Hello World","g");
var res = patt.constructor;

The result of res will be:

function RegExp() { [native code] }

Try it yourself »

Definition and Usage

The constructor property returns the function that created the RegExp object's prototype.

Note: The value of this property is a reference to the function itself, and not a string that contains the name of the function.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The constructor property is supported in all major browsers.


Syntax

RegExpObject.constructor

Technical Details

Return Value: The function that created the RegExp object's prototype
JavaScript Version: 1.1


RegExp Object Reference JavaScript RegExp Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE