zacker330
3/14/2013 - 1:21 PM

javascript中神奇的作用域

javascript中神奇的作用域

var scope = "s1";

var f = function(){
    console.log(scope);  // will print undefined
    var scope = "f1";
}