If one wanted to return rock for 0 and so on, it would be like this.
What if one wanted to return rock for 3 and so on, would the first case still be 0 or 3 ?
// Define a 'const' function for computer choice.
const getComputerChoice = () => {
const randomNumber = Math.floor(Math.random() * 3);
switch (randomNumber) {
case 0:
return "rock";
case 1:
return "paper";
case 2:
return "scissors";
}
};