📜  javascript object toarray - Javascript 代码示例

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

代码示例5
const numbers = {
  one: 1,
};

const objectArray = Object.entries(numbers);

objectArray.forEach(([key, value]) => {
  console.log(key); // 'one'
  console.log(value); // 1
});