tslint 提示error: “for (… in …) statements must be filtered with an if stateme

Reason

In JavaScript documentation:The loop will iterate over all enumerable properties of the object itself and those the object inherits from its constructor's prototype (properties closer to the object in the prototype chain override prototypes' properties). 译文: 循环将遍历对象自己的全部可枚举属性以及对象从其构造函数的原型继承的属性(更靠近原型链中对象的属性覆盖原型的属性)。 所以,你可能得到对象原型上你不想要的属性。ide

Example

Solution

相关文章
相关标签/搜索