标签:data 变量声明 asc 局部变量 add addclass ram ext javascrip
var a =10;
function aaa(){
alert(a);
}
function bbb(){
var a = 20;
aaa(); //10
}
bbb();
function aaa(){
var a=b=10;
}
aaa();
alert(a);//not defined
alert(b);//10
var a = 10
function aaa(){
alert(a);
var a =20;
}
aaa();//undefined
4.当參数跟局部变量重名时候。优先级是等同
var a = 10;
function aaa(a){
alert(a);
var a = 20;
}
aaa(a); //10
标签:data 变量声明 asc 局部变量 add addclass ram ext javascrip
原文地址:http://www.cnblogs.com/brucemengbm/p/7227892.html