YouTip LogoYouTip

Jsref Regexp Constructor

# JavaScript RegExp constructor Property [![Image 3: RegExp Object Reference Manual](#) JavaScript RegExp Object](#) ## Example Return the constructor function of the regular expression prototype: var patt = new RegExp("TUTORIAL", "g"); var res = patt.constructor; [Try it yourself Β»](#) * * * ## Definition and Usage In JavaScript, the constructor property returns the constructor function of an object. The return value is a reference to the function, not the function name: JavaScript **RegExp** constructor property returns **function RegExp() { }** JavaScript Array constructor property returns **function Array() { }** JavaScript Number constructor property returns **function Number() { }** JavaScript String constructor property returns **function String() { }** If a variable is an array, you can use the constructor property to define it. * * * ## Browser Support The numbers in the table indicate the first browser version that supports the property. | Property | | | | | | | --- | --- | --- | --- | --- | --- | | constructor | Yes | Yes | Yes | Yes | Yes | * * * ## Syntax RegExpObject.constructor ## Parameters No parameters. ## Technical Details Return value: function RegExp() { } JavaScript version: ECMAScript 1 * * JavaScript RegExp Object](#)
← Linux Comm ReadJsref Keys β†’