For example, if I have these arrays:
var name = [\"Bob\",\"Tom\",\"Larry\"]; var age = [\"10\", \"20\", \"30\"];
And I use name.sort
name.sort
I was having the same issue and came up with this incredibly simple solution. First combine the associated ellements into strings in a seperate array then use parseInt in your sort comparison function like this: