finding largest integer in array javascript
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1379553/how-might-i-find-the-largest-number-contained-in-a-javascript-array">How might I find the largest number contained in a JavaScript array?</a>  </p>
</blockquote>



<p>I am having trouble getting this code to work I have been at it for a while trying to figure it out. When I look at the console it just displays 0 can someone help me figure out what I did wrong. Here is my code:</p>

<pre><code>var array = [3 , 6, 2, 56, 32, 5, 89, 32];
var largest= 0;

for (i=0; i&lt;=largest;i++){
    if (array&gt;largest) {
        var largest=array[i];
    }
}




console.log(largest);
</code></pre>
