1.示例
var obj = {
a:"hello",
b:"world",
c:"hehe"
}
var key = 0;
for(var oj in obj) {
console.log(oj);
console.log(obj[oj]);
key++;
}
console.log(key); console.log(obj.size);
console.log(obj.length);
console.log(Object.keys(obj));
console.log(Object.keys(obj).length );
2.nodejs 运行结果: