For example, if I have these arrays:
var name = [\"Bob\",\"Tom\",\"Larry\"];
var age = [\"10\", \"20\", \"30\"];
And I use name.sort
Simplest explantion is the best, merge the arrays, and then extract after sorting: create an array
name_age=["bob@10","Tom@20","Larry@30"];
sort the array as before, then extract the name and the age, you can use @ to reconise where name ends and age begins. Maybe not a method for the purist, but I have the same issue and this my approach.