title: Looping array for largest number using forEach()
body: <p>I am trying to pull the largest number of an array using a forEach Javascript method. This is what I have so far, but I know it's not correct.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var arr = [2,3,4];
  var largest = 0;
   
  arr.forEach(function(elem){
    if(largest &lt; elem) 
    largest = elem;
    console.log(largest);
  });</code></pre>
  </div>
  </div>
  </p>