标签:ice length key col class color names 个数 property
for (var i = 0; i < dt.length; i++) { if (Object.keys(dt[i]).length <= 1) { dt.splice(i, 1); i--;//splice删除后,数组长度会改变 } }
js获取对象的属性个数
var obj = {
key1:1,
key2:2,
key3:3
};
Object.getOwnPropertyNames(obj).length //3
Object.keys(obj).length //3
标签:ice length key col class color names 个数 property
原文地址:https://www.cnblogs.com/Cengjianwei/p/11899719.html