const events = [
[{
createdAt: "2021-12-06T16:32:59.260Z"
location: "Off-Site"
name: "Viewing"
}],
[{
createdAt: "2021-12-06T16:32:59.260Z".}
..........
]嗨我有问题。从上面可以将数据转换成类似的东西
const events = [
{
createdAt: "2021-12-06T16:32:59.260Z"
location: "Off-Site"
},
{
createdAt: "2021-12-06T16:32:59.260Z". }
..........
]如果有人知道,请回答
发布于 2021-12-24 05:37:07
使用Array.flat方法
平面()方法创建一个新数组,将所有子数组元素递归连接到指定的
const arr = [[1,2,3],[4,5]];
const res = arr.flat()
console.log(res)
https://stackoverflow.com/questions/70469862
复制相似问题