I am trying to sort one array, but have a second array stay in sync with the first.
Example:
var a1 = ["human", "animal", "plant"];
var a2 = ["person", "beast", "nature"];
a1.sort();
After the sort I need to arrays to look like this:
a1 = ["animal", "human", "plant"];
a2 = ["beast", "person", "nature"];
Is there an easy way to do this, Maybe using a custom sort function?