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,深拷贝,函数

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com

评论“js 深拷贝函数”

暂无“js 深拷贝函数”评论...