title: how to manage super() constructor parameters in javascript
body: <p>This is a short piece of code from <strong>mazeContainer.js</strong> with only necessary part-</p>
  <pre><code>import Cell from &quot;./cell.js&quot;;
  import Player from &quot;./player.js&quot;;
  
  export default class Maze {
    ....
    setup(){
      for (let rowNum = 0; rowNum &lt; this.rows; rowNum++) {
              let row = [];
  
              for (let colNum = 0; colNum &lt; this.columns; colNum++) {
                  let cell = new Cell(this.ctx, rowNum, colNum, this.cellWidth, this.cellHeight);
                  row.push(cell);
              }
              this.grid.push(row);
    }
    
    drawMap(){
      ....
      let player = new Player(this.goal, this.lastRow, this.lastColumn);
      ....
    }
  }
  
  </code></pre>
  <p>And <strong>player.js</strong>-</p>
  <pre><code>import Cell from &quot;./cell.js&quot;;
  
  export default 
  class Player extends Cell {
      constructor(goal, lastRow, lastColumn) {
          super();                                    // need to manage this statement
          this.goal = goal;
          this.lastRow = lastRow;
          this.lastColumn = lastColumn;
      }
      ....
  }
  </code></pre>
  <p>Now here's what I'm having trouble with.</p>
  <p>I've just encountered the <code>super</code> keyword and what I've got to know so far is that I need to call <code>super</code> method before using <code>this</code>. That's not an issue. But here I also need to provide all parameters for <code>Cell</code>'s constructor.</p>
  <p>As you can see, the <code>Cell</code> class has got many parameters in its constructor, so how do I hand them over to <code>new Player(....)</code>?</p>
  <p>Is there a better way to achieve this?</p>