title: What would be the simplest way to get "the other" of 2 static values?
body: <p>I have a game with 2 players. They are called <code>p1</code> and <code>p2</code>. Each turn I have to switch between them. This is what I do now</p>
  
  <pre><code>var currentPlayer = "p1";
  var nextPlayer = (currentPlayer === "p1") ? "p2" : "p1";
  </code></pre>
  
  <p>But is seems not elegant. Is there a way to just get "the other one" out of 2 predefined values.</p>