So, I have this array:
distances = [[Obj1, Obj2, Obj3, Obj4], [15,221,9,2]];
I want to sort the two dimensional array based on the second array so it should look like this:
distances = [[Obj4, Obj3, Obj1, Obj2], [2, 9, 15, 221]];
I know I can use this method: How to sort 2 dimensional array by column value?, but I can't seem to adapt the code.