eval() evaluates a string as a JavaScript expression within the current execution scope and can access local variables. new Function()parses the JavaScript code stored in a string into a function object, which can then be called. It cannot access local variables because the code runs in a separate scope. 从以上2点看出,eval的作用域是现行的作用域,而new Function是动态生成的,它的作用域始终都是window。并且,eval可以读到本地的变量,new Function则不能。