title: How do I create a jagged array that produces a random amount arrays inside an array with random values?
body: <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 array = [];
  var list = "&lt;ul&gt;";
     
  for(var i = 0; i &lt; parseInt(Math.random() * 20); i++){
   array[i] = [parseInt(Math.random() * 10)];
   list += "&lt;li&gt;" + array[i];
       
   for(var j = 0; j &lt; array[i].length; j++){
    array[i][j] += parseInt(Math.random() * 10);
    list += " " + array[i][j];
   }
   list += "&lt;/li&gt;"
  }
      
  list += "&lt;/ul&gt;"
      
  document.getElementById("print").innerHTML += list;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="print"&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>My goal is to create a jagged array.</p>
  
  <p>I want to initialize an array and create random sets of array inside the initial array that also contains random numbers.</p>
  
  <p>The output I'm looking for is something like this:</p>
  
  <ul>
  <li>4 2 5 </li>
  <li>1 10 3 4 5 6</li>
  <li>7 1 4 8</li>
  <li>6 9 </li>
  <li>1</li>
  <li>4 6 7</li>
  </ul>
  
  <p>..but when I run the code I have so far I only receive two columns of random integers every time I run the program. How can I fix this?</p>