javascript Object 属性

属性合并

let a = {name: 'hello'}
let b = {...a,age: 23}
// {name: "hello", age: 23}

深拷贝

anathorObj = JSON.parse(JSON.stringfy(obj))
发布了126 篇原创文章 · 获赞 3 · 访问量 4555

猜你喜欢

转载自blog.csdn.net/Q10CAU/article/details/105433629