ARRANGE AN OBJECT OF ARRAY BASED ON ONE ELEMENT code example
Example 1: sort array of objects javascript
list.sort((a, b) => (a.color > b.color) ? 1 : -1)
Example 2: javascript sort array of objects by key value
arr.sort((x, y) => x.distance - y.distance);