title: How do you sort an array on multiple columns?
body: <p>I have a multidimensional array. The primary array is an array of </p>
  
  <pre><code>[publicationID][publication_name][ownderID][owner_name] 
  </code></pre>
  
  <p>What I am trying to do is sort the array by <code>owner_name</code> and then by <code>publication_name</code>.  I know in JavaScript you have <code>Array.sort()</code>, into which you can put a custom function, in my case i have:</p>
  
  <pre><code>function mysortfunction(a, b) {
      var x = a[3].toLowerCase();
      var y = b[3].toLowerCase();
  
      return ((x &lt; y) ? -1 : ((x &gt; y) ? 1 : 0));
  }
  </code></pre>
  
  <p>This is fine for just sorting on the one column, namely owner_name, but how do I modify it to sort on <code>owner_name</code>, then <code>publication_name</code>?</p>