使引用对象引用另一个对象,而不更改原始对象

时间:2015-11-26 18:28:10

标签: javascript oop

我有一个对象a

var a = {//some properties....};

然后b参考a

var b = a;
function modifyB()
{
//do something with b to change a
}
//after finish I want from b to refer an other object c
b = c;

引用问题c,如何更改b而不更改后modifyB()

0 个答案:

没有答案