ES6 - RegExp Constructor



It returns a reference to the array function that created the instance's prototype.

Syntax

RegExp.constructor        

Return Value

Returns the function that created this object's instance.

Example

var re = new RegExp( "string" ); 
console.log("re.constructor is:" + re.constructor);           

Output

re.constructor is:function RegExp() { [native code] }       
Advertisements