function fn1(x){ arguments[0]=2; alert(x); } fn1(1);//2
var x=0; var f=function (){x=1;} f(); alert(x);//1 function f(){x=2;} f(); alert(x);// 1 1
var myObject={ foo:‘abc‘, fun:function () { var self=this; alert(this.foo); alert(self.foo); (function(){ alert(this.foo); alert(self.foo); }()); } } myObject.fun();//abc abc undefined abc
var abc=function(){ alert(4); }; function abc(){ alert(5); }; abc();//4
function abc(){ alert(5); }; abc();//5
function f(){ x=2; } f(); alert(x);//2
时间: 2024-10-29 00:02:53