小编Tom*_*dos的帖子

在数组内映射数组

我正在尝试将所有项目映射到一个数组中:

[
  [
    { id: 0, name: 'New Project', apiKey: '.'},
    { id: 1, name: 'New Project', apiKey: '.}
  ],[
    { id: 3, name: 'New Project', apiKey: '.'},
    { id: 4, name: 'New Project', apiKey: '.}
  ]
]
Run Code Online (Sandbox Code Playgroud)

全部在一个数组中(输出):

[
 { id: 0, name: 'New Project', apiKey: '.'},
 { id: 1, name: 'New Project', apiKey: '.},
 { id: 3, name: 'New Project', apiKey: '.'},
 { id: 4, name: 'New Project', apiKey: '.}
]
Run Code Online (Sandbox Code Playgroud)

我试过了,var result = allUserProjects.map(user => {user.map(project …

javascript

0
推荐指数
1
解决办法
60
查看次数

标签 统计

javascript ×1