title: random number between 0 - 8 JavaScript
body: <p>I am trying to generate 40 random numbers between 0 to 8</p>
  
  <p>This is my code --</p>
  
  <pre><code>&lt;body&gt;
      &lt;h1&gt;This is a page for randomize number between 0 - 8 &lt;/h1&gt; &lt;br /&gt;
  
  &lt;button onclick="randomize()"&gt;Random number&lt;/button&gt;
  
  &lt;p id="Output"&gt;&lt;/p&gt;
  
  &lt;script&gt;
  function randomize() {
  
      var arr = []
  while(arr.length &lt; 40){
    var randomnumber=Math.floor((Math.random() * 8) + 1)
    arr.push(randomnumber) 
  }
  document.getElementById("Output").innerHTML = arr;
  }
  &lt;/script&gt; 
  &lt;/body&gt;
  </code></pre>
  
  <p>I am expecting 40 random numbers to be Output like --</p>
  
  <blockquote>
  <pre><code>4
  4
  5
  7
  8
  1
  5
  7
  </code></pre>
  </blockquote>
  
  <p>What I am doing wrong can someone correct me please and also I want the result to be outputted by the next line !</p>
  
  <p>Can someone help !</p>