title: Javascript array sorting problem
body: <p>I have an JavaScript arraylike this:</p>
  
  <pre><code>a[0][0] = "apple";
  a[0][1] = 6.5;
  a[1][0] = "orange";
  a[1][1] = 4.3;
  a[2][0] = "pear";
  a[2][1] = 3.1;
  </code></pre>
  
  <p>I want to sort by the float number field in ascending order and assign the content in ascending order as well.</p>
  
  <p>i.e.</p>
  
  <pre><code>a[0][0] = "pear";
  a[1][1] = 3.1;
  a[1][0] = "orange";
  a[1][1] = 4.3;
  a[2][0] = "apple";
  a[2][1] = 6.5;
  </code></pre>
  
  <p>I have tried sorted the content but the code seems does not allow float number.</p>
  
  <p>Also, I do not know how to reassign the content in ascending order.
  Can anyone help me?</p>
  
  <pre><code> a.sort(function(a,b){return a[1] - b[1];});
  </code></pre>