一、for循环
var obj = {
name: "小花",
age: 13
}
var obj1 = {}
for (var x in obj) {
obj1[x] = obj[x]
}
console.log(obj1)
二、利用json转换
var obj = {name:'小花'}
var obj1 = JSON.parse(JSON.stringify(obj))
三、扩展运算符
var obj = {name:'小花',age:13};
var obj1 = {...obj}
四、Object.assign() 方法
var obj = {name:'123',age:13};
var obj1 = Object.assign({},obj1);
有待补充......