js 通过下面这种这种方式获取对象长度
var obj = {a:1,b:2,c:3};Object.getOwnPropertyNames(obj).length;会有点问题,比正常长度 +1正确的姿势:var obj = {a:1,b:2,c:3}; var arr = Object.keys(obj); console.log(arr); //["a", "b", "c"] console.log(arr.length); //3