构造函数返回对创建数组函数的引用。
其语法如下−
链接:https://www.learnfk.comhttps://www.learnfk.com/javascript/regexp-constructor.html
来源:LearnFk无涯教程网
RegExp.constructor
返回创建此对象的函数。
尝试以下示例程序。
<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] }
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)