Javascript Clone

Refer to http://stackoverflow.com/questions/122102/what-is-the-most-efficient-way-to-clone-a-javascript-object

// Shallow copy

var newObject = jQuery.extend({}, oldObject);

// Deep copy
var newObject = jQuery.extend(true,{}, oldObject);
posted @ 2012-08-16 13:36  webglcn  阅读(248)  评论(0编辑  收藏  举报