var aaa = { name:1, age:2, ge:2 } var bbb =[] for(let i in aaa) { bbb.push(aaa[i]) } console.log(Object.keys(aaa).length,bbb.length)