title: Javascript - Rock, Paper, scissors with switch statement? If not what are alternatives?
body: <p>I am running the following codes bellow it only prints 'Draw!' the other cases does not work, what am I doing wrong?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const rps = (p1, p2) =&gt; {
  var s = 'scissors';
  var p = 'paper';
  var r = 'rock';
  var ans = '';
  
  switch (rps) {
  case (p1 == p &amp;&amp; p2 == r):case (p1 == s &amp;&amp; p2 == p): case (p1 == r &amp;&amp; p2 == s):
  ans = ('Player 1 won!');
  break;
  
  case (p1 == s &amp;&amp; p2 == r): case (p1 == r &amp;&amp; p2 == p): case (p1 == p &amp;&amp; p2 == s):
  ans =  ('Player 2 won!');
  break;
  
  default: ans =  ('Draw!');
  break;
  }
  return ans
  }
  
  
   rps('paper','scissors') </code></pre>
  </div>
  </div>
  </p>