title: Can't push an object into an array Javascript
body: <p>I'm building a game, and for my players I have a player class. This class defines things like their name, xpos, ypos etc. In my main game loop, I have to iterate over all of the current players (it's multiplayer) and update/draw them.</p>
  
  <p>Problem is, I don't know how to store the players in the game class. I tried doing this in the game class:</p>
  
  <pre><code>this.players = [];
  </code></pre>
  
  <p>And then:</p>
  
  <pre><code>game.players.push(new player(name));
  </code></pre>
  
  <p>But I get this error:</p>
  
  <pre><code>Uncaught TypeError: object is not a function
  </code></pre>
  
  <p>I always thought I could have objects as array elements, but apparently not.</p>
  
  <p>Could someone advise a better way to do what I want?</p>