var scope = 'global' ;alert(scope);function testScope(){ alert(scope); var scope = 'local' ; alert(scope);}这样的三个alert分别是"global","undefined","local"。第二个为什么是未定义啊?
就在这个后面加一句testScope()