react / javascript中的解构数组

问题描述 投票:0回答:1

我有数组enter image description here

如您所见,它有4个元素(created_at,first_name,id,last_name)。

我的问题是,如何将其分解为具有2个元素(id,名称)的数组

((名称应为名字+姓氏)] >>

我有一个数组,您可以看到,它有4个元素(created_at,first_name,id,last_name)。我的问题是,如何将其分解为具有2个元素(id,名称)的数组(名称应为...

javascript arrays reactjs destructuring
1个回答
6
投票

只需使用map


0
投票

您可以使用map

© www.soinside.com 2019 - 2024. All rights reserved.