I want to know why alert x is a 'undifined', why is not 10.
var x = 10;
function foo(){
alert("foo---" + x);
};
(function(){
alert("this === window---" + (this === window));
alert("window.x---" + window.x);
alert("this.x---" + this.x)
alert("x---" + x); //undifined ? why
var x = 20;
foo.call(); //10
})();