当我通过Ionic 3中的Form中的值覆盖我的Condition
对象的属性时,我会遇到这种奇怪的行为。value
被构造为null
,然后被覆盖一个String
。当我在覆盖后尝试访问它时,我得到null
而不是"8"
。这是console.log
我跑过的图片:
这就是我试图覆盖value
属性的方法:
for (var property in form.value) {
if (form.value.hasOwnProperty(property)) {
var index = this.numberArray.findIndex((cond) => cond.name == property)
this.numberArray[index].value = form.value[property];
}
}
答案 0 :(得分:0)
你应该使用strict'===',看起来像是来自console.log()
的后期评估