Ad
Code
Diff
  • function dumbRockPaperScissors(player1, player2) {
      let win = {
        Rock:"Scissors",
        Paper:"Rock",
        Scissors:"Paper"
      }
    
      return player1 === player2 ? "Draw" 
      : player1 === win[player2] ? "Player 2 wins" 
      : "Player 1 wins"
    }
    • function dumbRockPaperScissors(player1, player2) {
    • let win = {
    • Rock:"Scissors",
    • Paper:"Rock",
    • Scissors:"Paper"
    • }
    • return player1 === player2 ? "Draw"
    • : player1 === win[player2] ? "Player 2 wins"
    • : "Player 1 wins"
    • }