标签: javascript nan
由于某种原因,当我将两个字典号相乘然后又将其分配回字典中时,JavaScript会吐出此“ Not a number”错误。这些数字甚至早于我将其吐入的实际数字,因此我不认为这是编译器错误?代码:
var test = { variable1: 1, variable2: 2, variable3: this.variable1*this.variable2 } console.log(test.variable3);
结果:NaN。想要的结果:2