var a,b,c;
(function(){
eval('var b = 2');
(1, eval)('var c = 3');
(new Function('var a = 4'))();
document.write('<br>a: ' + a);
document.write('<br>b: ' + b);
document.write('<br>c: ' + c);
})()
document.write('<br>a: ' + a);
document.write('<br>b: ' + b);
document.write('<br>c: ' + c);
执行此段代码后,得到如下结果
a: undefined
b: 2
c: 3
a: undefined
b: undefined
c: 3
一只萌萌小番薯