var i = 0; eval(new Array(101).join('alert(++i);')); var i = 0; new Function(new Array(101).join('alert(++i);'))();
解释: 1、string.replace(regexp, replacement): replacement可以是function. In this case, the function is invoked for each match, and the string it returns is used as the replacement text.
javascript使用eval或者new Function进行语法检查详解new function(){}和function(){}() 区别分析function, new function, new Function之间的区别Eval and new funciton not the same thing