1.JSON对象序列化方法(不能复制函数)
var obj = {a:1,b:2}
var newObj = JSON.parse(JSON.stringify(obj))
2.DOM元素的复制–cloneNode
let div = document.getElementById('box') let divCopy=div.cloneNode(true)3.es6新方法–Object.assign
var obj = {a:1,b:2}
var newObj = Object.assign({},obj)
4.es6新方法–扩展运算符
var obj = {a:1,b:2}
var newObj = {…obj}
5.使用Object.create()方法
var obj = {a:1,b:2}
var newObj = Object.create(obj)
https://blog.csdn.net/weixin_37719279/article/details/81240658
好文章参考