【发布时间】:2023-01-25 14:40:40
【问题描述】:
我需要从 array of array 中获取所有对象,但我无法找到,我有任何 array 方法可以从 array of array 中找出对象。
const array1 = [
[{
id:1,
name:"test1"
},
{
id:2,
name:"test2"
},
{
id:3,
name:"test3"
},
],
[{
id:4,
name:"test4"
},
{
id:5,
name:"test5"
},
{
id:6,
name:"test6"
},
],
[{
id:7,
name:"test7"
},
{
id:8,
name:"test8"
},
{
id:9,
name:"test9"
},
],
]
我只需要我可以使用数组方法获取数组中的所有对象
【问题讨论】:
-
你到底想要什么?将所有对象放在一个数组中?
-
也许
.flat -
是的,我需要单个数组中的所有对象
标签: javascript reactjs angular vue.js