📜  获取密钥对象 javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:22.889000             🧑  作者: Mango

代码示例1
var foo = {
  'alpha': 'puffin',
  'beta': 'beagle'
};

var keys = Object.keys(foo);
console.log(keys) // ['alpha', 'beta'] 
// (or maybe some other order, keys are unordered).