function decideWinner() {
comChoice = generateComputerChoice();
userChoice = "Rock";
if (userChoice === comChoice) {
console.log("game drew");
} else {
if (userChoice === "Rock" && comChoice === ("Scissor" || "Lizard")) {
console.log("you win")
} else if (userChoice === "Paper" && comChoice === "Rock" || "Spock") {
console.log("you win")
} else if (userChoice === "Scissors" && comChoice === "Paper" || "Lizard") {
console.log("you win")
} else if (userChoice === "Lizard" && comChoice === "Spock" || "Paper") {
console.log("you win")
} else if (userChoice === "Spock" && comChoice === "Scissor" || "Rock") {
console.log("you win")
} else {
console.log("you lose")
}
}
}
decideWinner()
The comChoice is generated from another function. userChoice is set to "Rock" first part should return draw if both are the same and 2nd returns a win or loss depending on the outcome of the comChoice. But this is not happening i am getting a draw if "Spock" is drawn by the computer and a win in all other circumstances. can anyone see what ive done wrong please ?
(comChoice === 'Scissor" || commChoice === 'Lizard')or['Scissor', 'Lizard'].includes(comChoice).