How would you sort this array with these objects by distance. So that you have the objects sorted from smallest distance to biggest distance ?
Object { dista
Use Array's sort() method, eg
myArray.sort(function(a, b) { return a.distance - b.distance; });