Object.assign ( ) 合并对象
let params = Object.assign({},obj,obj1)
//花括号{ }叫目标对象,后面的obj、obj1是源对象。对象合并是指:将源对象里面的属性添加到目标对象中去,若两者的属性名有冲突,后面的将会覆盖前面的
var obj1 = { test1: 1 } var obj2 = { test12: 1 } var params = Object.assign({}, obj1, obj2) console.log(params)