title: Cannot access 'rainDrop' before Initialization
body: <p>I am creating a Purple Rain Sim in Sublime Text using classes and object-oriented programming (which I am not used to). When I try to create a new object in the code below, my chrome console throws the error, &quot;Cannot access 'rainDrop' before Initialization&quot;. 'rainDrop' is a class that creates raindrop objects. The rainDrop class is in the same .html file as the function, and the rainDrop class is coded before the function code.</p>
  <p>This is the rainDrop class:</p>
  <pre><code>class rainDrop {
      constructor(x, yV, color) {
          this.x = x;
          this.y = 0 - rainH;
          this.yV = yV;
          this.color = color;
      }
  }
  </code></pre>
  <p>This function throws the error:</p>
  <pre><code>function create_rain_drop() {
      var x = Math.floor(Math.random() * canvasHeight);
      var yV = Math.floor(Math.random() * 5);
      var alpha = Math.random();
      var color = &quot;rgb(148,0,211,&quot; + alpha + &quot;)&quot;;
      new rainDrop(x, yV, color); // This line throws the error
  // I don't believe the arguments in the function are throwing the error
  }
  </code></pre>
  <p>Why is this error thrown?
  Thank You in advance.</p>