Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sort object array javascript

//using es6, simply:
data.sort((a, b) => a.city.localeCompare(b.city) || b.price - a.price);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sort #object #array #javascript
ADD COMMENT
Topic
Name
5+3 =