title: Find index of object in array with highest value in property
body: <p>I've got an array with objects:</p>
  
  <pre><code>var articles = [];
  var article = {};
  
  Simple loop that iterates x times {
          article.text = "foobar";
          article.color = "red";
          article.number = 5;
          articles.push(article);
  }
  </code></pre>
  
  <p>I have no idea how many objects there will be in my array but they will all have different values for their properties, I just gave some examples here.</p>
  
  <p><strong>Question</strong></p>
  
  <p>I need to find a way to go through all these objects and retrieve the index of the object that has the highest value in article.number. How can I achieve this? I may only use javascript, jQuery, etc.. no other languages. </p>
  
  <p>I'm guessing this will involve using both $.grep and Math.max but I'm stuck, I've never worked with $.grep before.</p>
  
  <p><strong>In short:</strong></p>
  
  <pre><code>var highestNumber = index of object where article.number is highest
  </code></pre>