title: How to create array of objects of ES6 class while calling constructor of this class?
body: <p>I would like to create array or object of objects while calling constructor of class? I mean, everytime I'm calling class constructor it adds new object to array or object. </p>
  
  <p>f.e.</p>
  
  <pre><code>let blocks = {};
  
  class Block(){
  
      constructor(X,Y,width,height){
          this.X = X;
          this.Y = Y;
          ...
          and now I would like to add this created object to "blocks"
          something like: blocks.push(and this object here)
      }
  }
  </code></pre>
  
  <p>How can I implement something like this? Or should it be another function? </p>