📅  最后修改于: 2022-03-11 15:03:48.339000             🧑  作者: Mango
var obj = {
key1: 'value1',
key2: 'value2',
key3: 'value3',
key4: 'value4'
};
var keys = [];
for (var k in obj) keys.push(k);
alert("total " + keys.length + " keys: " + keys);