It returns a reference to the array function that created the instance's prototype.
Its syntax is as follows −
RegExp.constructor
Returns the function that created this object's instance.
Try the following example program.
<html> <head> <title>JavaScript RegExp constructor Property</title> </head> <body> <script type="text/javascript"> var re = new RegExp( "string" ); document.write("re.constructor is:" + re.constructor); </script> </body> </html>
re.constructor is: function RegExp() { [native code] }