JavaScript Sort Array berdasarkan Indeks

//For Ascending
a.sort((a,b)=> (a.name > b.name ? 1 : -1))

//For Descending
a.sort((a,b)=> (a.name < b.name ? 1 : -1))
Lucky Locust