兼容大部分浏览器
Object.assign({}, array or object);
兼容IE
function clone(obj) { var o; if (typeof obj == "object") { if (obj === null) { o = null; } else { if (obj instanceof Array) { o = []; for (var i = 0, len = obj.length; i < len; i++) { o.push(clone(obj[i])); } } else { o = {}; for (var j in obj) { o[j] = clone(obj[j]); } } } } else { o = obj; } return o; }