arr.sort((x, y) => x.distance - y.distance);
myArray.sort(function(a, b) { return a.distance - b.distance; });