这个跟js execution context、scope chain等有关。
f函数内定义了scope,则在执行时,先从自身f中寻找scope,并且找到了,
就不会从其父级chain中再寻找。
但在运行到alert时,此时scope还未定义,所以就undefined了。
【 在 komac (密钥) 的大作中提到: 】
: 代码如下:
: var scope = "global";
: function f( ) {
: ...................
--
FROM 221.221.235.*