//����һ
var scope=”global”��
function fun(){
console.log(scope);
var scope=”local”��
console.log(scope);
}
fun();
console.log(scope);
//������
var scope=”global”��
function fun(){
console.log(scope);
scope=”local”
console.log(scope);
}
fun();
console.log(scope);
// ������
function fun(){
var x = y = 1;
}
fun();
console.log(y);
console.log(x);
// ������
var x = 10;
function f1(num){
return num++;
}
var y = f1( x );
console.log(x);
console.log(y);
//������
var x = 10;
function f1(num){
num++;
}
var y = f1(x);
console.log(x);
console.log(y);
近期评论