title: Get array index by Max value?
body: <p>I found some solutions to get max value of indexes, but how can I get the max value when I have array like this:</p>
  
  <pre><code>myArray = [];
  myArray[1] = 10;
  myArray[2] = 99;
  
  alert(Math.max(myArray));
  </code></pre>
  
  <p>I would like to get index of max value. In this case it would be index 2 of value 99.</p>
  
  <p>The result I get now is <code>NaN.alert(Math.max(myArray));</code></p>