Answers for "how to order an array of objects depending on the value of its attribute"

1

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));
Posted by: Guest on June-06-2021

Code answers related to "how to order an array of objects depending on the value of its attribute"

Code answers related to "Javascript"

Browse Popular Code Answers by Language