function eval2(str) { var Fn = Function; return new Fn('return ' + str)(); } 转载于:https://www.cnblogs.com/rookiehao/p/9153408.html