English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

JavaScript RegExp constructor property

 JavaScript Regular Expression RegExp Object

constructorProperty returns a reference to the prototype function of the created example.

For JavaScript RegExp, the constructor property returnsFunction RegExp(){[Machine code]}.

For JavaScript String, the constructor property returnsFunction String(){[native code]}.

For JavaScript Numbers, the constructor property returnsFunction Number(){[native code]}.

For JavaScript Date, the constructor property returnsFunction Date(){[native code]}.

For JavaScript Boolean, the constructor property returnsFunction Boolean(){[native code]}.

For JavaScript array, the constructor property returnsFunction Array(){[native code]}.

Syntax:

regex.constructor
var regex = new RegExp("Parrot", "g");
regex.constructor;
Test See‹/›

Browser Compatibility

All browsers fully support the Constructor property:

Properties
constructorYesYesYesYesYes

Technical Details

Return Value:Returns the function that created the object, that isFunction RegExp(){[native code]}
JavaScript Version:ECMAScript 1

 JavaScript Regular Expression RegExp Object