作者:顆顆顆顆幸福_483 | 来源:互联网 | 2023-07-02 18:04
webStorm编辑器中报警告:Possibleiterationoverunexpected(custominherited)members,probablymis
webStorm编辑器中报警告:Possible iteration over unexpected (custom / inherited) members, probably missing hasOwnProperty check
问题:没有hasOwnProperty验证
解决:添加 hasOwnProperty 验证
for (var key in res.data.missing) {if (res.data.missing.hasOwnProperty(key)) {const element = res.data.missing[key]if (element != null) {unfinished.push({vol: key,timeInterval: element})}}
}