javascript Object property

Attribute merge

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

Deep copy

anathorObj = JSON.parse(JSON.stringfy(obj))
Published 126 original articles · won praise 3 · Views 4555

Guess you like

Origin blog.csdn.net/Q10CAU/article/details/105433629