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);

你可能感兴趣的:(JavaScript)