title: javascript array find highest value
body: <p>I have an array that I need to find the highest value of so when I apply it to a Highchart I can color the background if it exceeds some dynamic number a user inputs.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>&lt;div id="highest"&gt;&lt;/div&gt;
  
  var array = {
      data: [123, 234, 456, 789],
      data: [321, 654, 987],
      data: [963, 852, 741]
  };
  
  for (var i=0; i &lt; array.data.length; i++){
      var m = Math.max.apply(Math, array.data);
      $('#highest').append('&lt;div&gt;'+m+'&lt;/div&gt;');
  }
  </code></pre>
  
  <p>all I get is the number </p>
  
  <pre><code>&lt;div&gt;963&lt;/div&gt;
  &lt;div&gt;963&lt;/div&gt;
  &lt;div&gt;963&lt;/div&gt;
  </code></pre>