色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

js如何向函數(shù)傳遞object類型

js如何向函數(shù)傳遞object類型?

例1

var person = {

name : "leaf"

};

function obj(o){

o.name = "kafu";

return o;

}

var result = obj(person);

console.log(result.name);// kafu

console.log(person.name);// kafu

例2

var person = {

name : "leaf"

};

function obj(o){

o = {

name : "kafu"

};

return o;

}

var result = obj(person);

console.log(result.name);// kafu

console.log(person.name);// leaf