Posted in Javascript onDecember 04, 2008
function objectClone(obj,preventName){
if((typeof obj)=='object'){
var res=(!obj.sort)?{}:[];
for(var i in obj){
if(i!=preventName)
res[i]=objectClone(obj[i],preventName);
}
return res;
}else if((typeof obj)=='function'){
return (new obj()).constructor;
}
return obj;
}
js 深拷贝函数
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@