#32 后端数据处理

从某数据库接口得到如下值:

{
  rows: [
    ["Lisa", 16, "Female", "2000-12-01"],
    ["Bob", 22, "Male", "1996-01-21"]
  ],
  metaData: [
    { name: "name", note: '' },
    { name: "age", note: '' },
    { name: "gender", note: '' },
    { name: "birthday", note: '' }
  ]
}

rows 是数据,metaData 是对数据的说明。现写一个函数 parseData,将上面的对象转化为期望的数组:

[
  { name: "Lisa", age: 16, gender: "Female", birthday: "2000-12-01" },
  { name: "Bob", age: 22, gender: "Male", birthday: "1996-01-21" },
]

本题来源:github


JavaScript
登录提交答案

与 的连接断开,我们正在尝试重连,请耐心等待