📜  将对象的属性转换为对象数组 js - Javascript 代码示例

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

代码示例1
let data = {
  '1536135941922': 'true',
  '1536135962942': 'false',
  '1536135986966': 'false',
  '1536135989968': 'true'
};
  
let result = Object.entries(data).map(( [k, v] ) => ({ [k]: v }));

console.log(result);