Creating an object with two properties address and distance. Pushing this object into darr array.
Code:
var object=new Object();
object.address=add;
object.distance=distance;
darr.push(object);
All good till now. Now I want to sort darr by each object's distance. I have tried sortOn but it gives out no results at all. Any idea how to do this?
And just to make my mind clear. Is this some kind of associative array?