nodejs push is not a function : <p>I have difficulty making a collection of a class</p>

<p>Match example</p>

<p>and matches</p>

<p>matches is a collection of match</p>

<p>my class match:</p>

<pre><code>const uuid = require("uuid");
// Match class is a single game Match structure
class Match {
    constructor(players) {
      this.id = uuid.v4().toString();
      this.players = players;
    }
    // Match rest methods...
    // I.E: isMatchEnded, isMatchStarted ...
  }

  module.exports = Match;
</code></pre>

<p>my class Matches</p>

<pre><code>class Matches {
    constructor() {
      this.matches = {};
    }

    addMatch(match) {
      this.matches.push(match);
    }
    // Matches rest methods...   }

  module.exports = Matches;
</code></pre>

<p>my main:</p>

<pre><code>    const matches = new Matches();
    const queue = new Queue();
    queue.addPlayer(new Player(1,'spt',970));
    queue.addPlayer(new Player(2,'test2',1000));
    queue.addPlayer(new Player(3,'test3',1050));
    queue.addPlayer(new Player(4,'test4',70));
    const playerOne = queue.players.find((playerOne) =&gt; playerOne.mmr === 970);
    const players = queue.searching(playerOne);
    if(players){
      const match = new Match(players);
      matches.addMatch(match);
    }
console.log(matches);
</code></pre>

<p>But I am getting this error:</p>

<pre><code>Matches.js:7
      this.matches.push(match);
                   ^

TypeError: this.matches.push is not a function
</code></pre>
