遍历对象并且移除属性

for(let i:number = 0, keys = Object.keys(props),len =keys.length;i<len;i++){
    let it = props[keys[i]];
    let condition = it.replace(/\s*/g, "");
    if (!condition) {
        delete props[keys[i]]
    }
    if (PlatformHandler.INVALID_SET.indexOf(it)!==-1) {
        delete props[keys[i]]
    }
}
    

tips

 如果还不清楚或者想交个朋友的同学可以微信联系我:qq981145483(备注:csdn fe)

发布了57 篇原创文章 · 获赞 5 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/qq_33807889/article/details/100929320
今日推荐