Posted in Javascript onJuly 08, 2013
CSSCommonJS.DeepCopy = function (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; for (i = 0; i < len; i++) { newArr[i] = arguments.callee(json[i]); } return newArr; } else { var newObj = {}; for (var name in json) { newObj[name] = arguments.callee(json[name]); } return newObj; } } }
复制js对象方法(详解)
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@