I would like to sort a multidimensional array of doubles.
The array looks like this : [[1,2],[2,3],[5,6],[8,9]]
I would like to sort it by the X value, and keep the x,y values paired.
I searched the site for multidimentional sorting and found threads like these where the sort function is modified like so:
location.sort(function(a,b) {
// assuming distance is always a valid integer
return parseInt(a.distance,10) - parseInt(b.distance,10);
});
I'm not sure how to modify this function to work for me, however.