在对象数组中sorted
sorted = [{…}, {…}, {…}]
(3) [{…}, {…}, {…}]
0: {firstName: "john", lastName: "Doe", age: 36, gender: "male"}
1: {lastName: "Latt", age: 40, gender: "male"}
2: {firstName: "Tom", age: 22, gender: "male"}
如何返回一个数组,"firstName+' '+lastName"如果两者都存在,则返回一个数组,如果firstName没有lastName给出,则返回现有值之一?
我想用.map.filter(true).join(' ')
例子:
["john Doe", "Latt", "Tom"]
宝慕林4294392
慕容708150
慕标琳琳
12345678_0001
相关分类