const target = { a: 1, b: 2 }
const source = { b: 4, c: 5 }
console.log({ ...target, ...source })
console.log(Object.assign(target, source))
Object.assign与展开运算符
猜你喜欢
转载自blog.csdn.net/weixin_45585996/article/details/107986123
今日推荐
周排行