var obj2 = {
name: "abc",
age: 20
}
Object.assign(obj2, {
name: "garu",
height: 170
})
console.log(obj2); //{name: "garu", age: 20, height: 170}
var obj2 = {
name: "abc",
age: 20
}
Object.assign(obj2, {
name: "garu",
height: 170
})
console.log(obj2); //{name: "garu", age: 20, height: 170}
本文标题:js Object.assgin使用方法
本文链接:https://www.haomeiwen.com/subject/jcneahtx.html
网友评论