Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to sort an array of objects by a property value in javascript

let x = list.sort((a, b) => (a.name > b.name ? 1 : -1));
 
PREVIOUS NEXT
Tagged: #sort #array #objects #property #javascript
ADD COMMENT
Topic
Name
1+4 =