English 中文(简体)
JavaScript RegExp Tutorial

Selected Reading

JavaScript RegExp - constructor
  • 时间:2024-09-17

JavaScript RegExp - constructor


Previous Page Next Page  

Description

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

Syntax

Its syntax is as follows −


RegExp.constructor

Return Value

Returns the function that created this object s instance.

Example

Following example shows usage of RegExp expression.


<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>

Output


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