Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

sort array elements in descending order based on object key

homes.sort((a, b) => parseFloat(a.price) - parseFloat(b.price));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sort #array #elements #descending #order #based #object #key
ADD COMMENT
Topic
Name
6+6 =