JavaScript字典更改变量的值

时间:2019-12-16 19:43:45

标签: javascript dictionary scope

The value of "power" within dictionary changes when the list is expanded

我不知道这是怎么发生的以及如何解决它,但是当我们扩展字典时,值会改变

对象以以下方式记录到控制台:

{id: "BoardColumn_2_0", rotation: 1, facing: "e", type: "switch", *power: true*}

一旦展开,它将变为:

id: "BoardColumn_2_0"
rotation: 1
facing: "e"
type: "switch"
*power: false*
__proto__: Object

0 个答案:

没有答案