标签:rgba 没有 code 一个 rom The shu rgb filter
let val = { shu: [1, 2, 3] };
for (let item in val) {
if (val.hasOwnProperty(item)) {
console.log(item);
}
}
因为我们在遍历一个对象之前应该判断一下这个对象是否有自身的属性(非继承),如果这个对象是个空对象,那么就没有必要遍历了呗~,提升代码的效率。
The body of a for-in should be wrapped in an if statement to filter unwanted properties from the pro
标签:rgba 没有 code 一个 rom The shu rgb filter
原文地址:https://www.cnblogs.com/qianxiaoPro/p/14703058.html