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