以下是我的主要数组示例:
[
{
'data': [{'value': 'Red'}, {'value': 'Small'}, {'value': 'Good'}]
},
{
'data': [{'value': 'Black'}, {'value': 'Medium'}, {'value': 'Bad'}]
},
{
'data': [{'value': 'White'}, {'value': 'Large'}, {'value': 'Best'}]
}
]
And I want as output:
[
['Red', 'Black', 'White'], // all values from first index of data array
['Small', 'Medium', 'Large'], // all values from second index of data array
['Good', 'Bad', 'Best'] // all values from third index of data array
]
我已经尝试使用forEach
、for...in
、filter
等方法,但是我没有成功地得到之前的输出。