ルック:ソート以下のコードで配列
var exemples = [
{
'name' : 'd',
'index' : 3
},
{
'name' : 'c',
'index' : 2
},
{
'name' : 'a',
'index' : 0
},
{
'name' : 'b',
'index' : 1
}
];
const list = exemples.map((exemple, index, array) => exemple.name)
console.log(list)
は、それは私にその配列を与える:
["d", "c", "a", "b"]
私はインデックスを尊重し、取得したいと思い結果は次のようになります。
["a", "b", "c", "d"]
基本的な質問のようですが、私はあなたの助けが必要です。ありがとう。