【发布时间】:2014-09-17 14:20:17
【问题描述】:
w = {c: true}
w =
a: 4
b: true
console.log w
我希望结果 w 是 {a: 4, b: true, c: true},但我得到 {a: 4, b: true}。
如何在不丢失已设置属性的情况下对对象属性进行多次分配?
【问题讨论】:
-
this question 的答案可能很有用,因为您正在做的是将属性合并到初始对象中。
标签: coffeescript