<script language="javascript">
//dosomething1, For reference, the variable itself cannot be modified, but the internal structure of the variable can be modified
function dosomething1(a){
a = 'try';
}
//Test 1
function test1(){
var a = {a:'test',b:'is',c:'ok'};
dosomething1(a);
alert();
}
//dosomething2
function dosomething2(v){
= + '!!!'; //Modify the attribute of the reference variable, the modification is successful
v = 'try'; //Try to modify the variable reference, but the modification failed
}
//Test 2
function test2(a){
var a = {a:'test',b:'is',c:'ok'};
dosomething2(a);
alert();
}
test2();
</script>