JSFiddle - React, Tailwind, and code Playground
JavaScript
var userChoice = prompt("Do you choose rock, paper, or scissors?")
var computerChoice = Math.random();
if(computerChoice < 0.33) {
computerChoice = "Paper";
} else if(0.34 < computerChoice && computerChoice < 0.66) {
computerChoice = "Rock";
} else {
computerChoice = "Scissors";
}
console.log(computerChoice);