var str = "console.log('222');console.log(111)"; //这样的话可以执行var tempFun = new Function(str);
tempFun();然后 我把 两句之间的分号去掉var str = "console.log('222') console.log(111)"; //现在这样就会报错var tempFun = new Function(str);
tempFun();我不太明白为什么 平时我们写的话 不是可以不加分号吗?
添加回答
举报
0/150
提交
取消