摘要:
今天因为项目需要写了个Json格式的深拷贝(深度复制)。很简单,没有做其他的判断,代码如下:function deepCopy(json){ if(typeof json == 'number' || typeof json == 'string' || typeof json == 'boolean'){ return json; }else if(typeof json == 'object'){ if(json instanceof Array){ var newArr = [], i, len = json.length; 阅读全文
posted @ 2011-11-23 22:07
realwall
阅读(599)
评论(0)
推荐(0)

浙公网安备 33010602011771号