Notifications
Clear all
BugOverflow
1
Posty
1
Users
0
Reactions
456
Widok
0
06/03/2023 9:13 pm
Topic starter
how to sort VUE / JS attribute that contains list of object insted of array
1 Answer
0
06/03/2023 9:15 pm
Topic starter
example code (sorting districts by demand for industry object)
industry.districts = Object.values(industry.districts); industry.districts.sort((a, b) => a.demand < b.demand ? 1 : b.demand < a.demand ? -1 : 0 );