varary=[1,2,3,4];functionfn(ary){ary[0]=0;ary=[0];ary[0]=100;returnary;}varres=fn(ary);//请问当把函数给res的时候开辟新空间了吗?还是指向函数定义时的那个空间?console.log(ary);console.log(res);
functionfn(ary){ary[0]=0;ary=[0];ary[0]=100;returnary;}varres=fn(ary);//请问当把函数给res的时候开辟新空间了吗?还是指向函数定义时的那个空间?console.log(ary);console.log(res);
ary[0]=0;ary=[0];ary[0]=100;returnary;}varres=fn(ary);//请问当把函数给res的时候开辟新空间了吗?还是指向函数定义时的那个空间?console.log(ary);console.log(res);
ary=[0];ary[0]=100;returnary;}varres=fn(ary);//请问当把函数给res的时候开辟新空间了吗?还是指向函数定义时的那个空间?console.log(ary);console.log(res);
ary[0]=100;returnary;}varres=fn(ary);//请问当把函数给res的时候开辟新空间了吗?还是指向函数定义时的那个空间?console.log(ary);console.log(res);
returnary;}varres=fn(ary);//请问当把函数给res的时候开辟新空间了吗?还是指向函数定义时的那个空间?console.log(ary);console.log(res);
}varres=fn(ary);//请问当把函数给res的时候开辟新空间了吗?还是指向函数定义时的那个空间?console.log(ary);console.log(res);
varres=fn(ary);//请问当把函数给res的时候开辟新空间了吗?还是指向函数定义时的那个空间?console.log(ary);console.log(res);
console.log(ary);console.log(res);
console.log(res);
湖上湖
米脂
相关分类