无涯教程-RegExp.prototype.flags函数

44 阅读1分钟

它返回对创建原型的数组函数的引用。

RegExp.prototype.flags - 语法

RegExp.constructor        

RegExp.prototype.flags - 返回值

返回创建该对象的函数。

RegExp.prototype.flags - 示例

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

运行上面代码输出

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

参考链接

www.learnfk.com/es6/es6-reg…