title: Add method on a list of object
body: <p>Ok guys, object developer newbie here. I try to do an animation of falling cube as explain here : <a href="https://stackoverflow.com/questions/46768826/falling-animation-to-fill-a-webpage">Falling animation to fill a webpage</a></p>
  
  <p>I have some algorithmic issues. I follow the model of a tetris game but I want multiple pixels falling at the same time. So I have a constructor with some methods to move my pixel.</p>
  
  <p>But now I use my constructor to create an array of object like :</p>
  
  <pre><code>var a_player = [];
  
  function addPlayer(pos){
    var player = new Player(pos);
    a_player.push(player);
  }
  
  addPlayer({x: 3, y: 3});
  addPlayer({x: 0, y: 0});
  </code></pre>
  
  <p>And I want to use some public methods like a collide() method :</p>
  
  <pre><code>function collide(arena, player) {
    const [m, o] = [player.matrix, player.pos];
    for (let y = 0; y &lt; m.length; ++y) {
      for (let x = 0; x &lt; m[y].length; ++x) {
        if (m[y][x] !== 00 &amp;&amp;
            (arena[y + o.y] &amp;&amp;
            arena[y + o.y][x + o.x]) !== 0) {
              return true;
            }
      }
    }
    return false;
  }
  </code></pre>
  
  <p>But I don't know what's the best way to do it. I can use a "for" like </p>
  
  <pre><code>for (i = 0; i &lt; a_player.length; i++){
              console.log(a_player[i].pos);
  }
  </code></pre>
  
  <p>but I have to apply it on all my methods, or I can duplicate my method by the number of player I have in my array (but in the ends I want more than 20k players...). So can you help me with that kind of problematic ?</p>