title: What is wrong in my Math max functions?
body: <pre><code>  &lt;button onclick="myFunction()"&gt;Try it&lt;/button&gt;
    &lt;p id="demo"&gt;&lt;/p&gt;
    &lt;script&gt;
      var numberArray = [1, 2, 3, 4, 10, 5, 6, 7];
          var i,
              len = numberArray.length,
              imGreater = numberArray[0];
       for (i = 0; i &lt; len; i++) {
         maxNumber = Math.max(len)   
      }       
      function myFunction() {
          document.getElementById("demo").innerHTML =  console.log(maxNumber );
      }
    &lt;/script&gt;
  </code></pre>
  
  <p>What is wrong with it? Is it about Javascript scope? </p>