我正在尝试将所有项目映射到一个数组中:
[
[
{ 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 ×1