title: I need another way to code this using arrays and a random generator
body: <p>The purpose of this codes is to create an array of one hundred block objects randomly selected but I'm not sure if this code will work </p>
  
  <pre><code>    var array_result = ();
  
      for( let i= 0; i&lt;100; i++){
        var number=  parseInt (7* Math.Random());
        switch (number) {
          case 0:
            array_result.push (new Dirt ());
            break;
          case 1:
            array_result.push (new CobbleStone ());
            break;
          case 2:
            array_result.push (new sand ());
            break;
          case 3:
            array_result.push (new IronOre ());
            break;
          case 4:
            array_result.push (new Gravel ());
            break;
          case 5:
            array_result.push (new Coal ());
            break;
          case 6:
            array_result.push (new RedStone ());
            break;
          case 7:
            array_result.push (new CraftingTable ());
            break;
        }
      }
  
      console.log(array_result)
  </code></pre>