摘要:
深度克隆注意事项1.传参(如果参数为空时)2.事件名(如果突然事件名要重新命名时)function cloneObject(json){ if(json===null || arguments.length==0){//如果对象为空或者无参数时返回null return null; } var o=json.constructor===Array?[]:{};//判断参数是数组还是json(对象) for(var i in json){//循环对象进行复制 if(json.hasOwnProperty(i)){//当数组或者json(对象)有值的时候才进行克隆 o... 阅读全文