原创声明:本文为作者原创,未经允许不得转载,经授权转载需注明作者和出处
var num = 10;
function process(num){
num++;
}
process(num);
print(num);
//输出结果为10
var person = new Object();
person.age=10;
process2(person);
print(person.age);
function process2(person){
person.age++;
}
//输出结果为11
var person3 = new Object();
person3.age =10;
process3(person3);
print(person3.age);
function process3(person){
//person.age=20;
person = new Object();
person.age=100;
}
//输出结果为10
var person4 = new Object();
person4.age =10;
person4=process4(person4);
print(person4.age);
function process4(person){
person = new Object();
person.age=100;
return person;
}
//输出结果为100
function print(msg){
document.write(msg);
document.write("<br>");
}