title: Remove specific element from array in Knockout.JS
body: <p>I am creating a multiplayer game over network so I have to react on network events. </p>
  
  <p>I have this simple code, but the removePlayer method doesnt work. The addPlayer() works fine.</p>
  
  <pre><code>&lt;table id="userlist2" class="tablesorter" cellspacing="0"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Name&lt;/th&gt;
              &lt;th&gt;Queue&lt;/th&gt;
              &lt;th&gt;Points&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody data-bind="foreach: players"&gt;
          &lt;tr&gt;
              &lt;td data-bind="text: name"&gt;&lt;/td&gt;
              &lt;td data-bind="text: queue"&gt;&lt;/td&gt;
              &lt;td data-bind="text: score"&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  
  
  function PlayerViewModel() {
      var self = this;
      self.players = ko.observableArray();
  
      self.addPlayer = function (Name, QueuePos, Score) {
          self.players.push({
              name: Name,
              queue: QueuePos,
              score: Score
          });
      }
  
  
      self.removePlayer = function (Name) {
          for (var i = 0; i &lt; self.players().length; i++) {
  
              if (self.players()[i].name == Name) console.log(i);
              self.players().splice(i, 1);
          }
      }
  }
  
  
  players = new PlayerViewModel();
  ko.applyBindings(players);
  
  players.addPlayer('Player1', '0', '0');
  players.addPlayer('Player2', '0', '0');
  players.removePlayer('Player2');
  </code></pre>
  
  <p>Heres the <a href="http://jsfiddle.net/xseTc/">http://jsfiddle.net/xseTc/</a></p>