I’m working on the Rock, Paper, Scissors exercise and keep getting a “math is not defined at getComputerChoice” error.
console.log(‘hi’);
const getUserChoice = userInput => {
userInput = userInput.toLowerCase();
if (userInput === ‘rock’ || userInput === ‘paper’ || userInput === ‘scissors’) {
return userInput;
} else {
console.log(‘Error!’);
}
};
const getComputerChoice = () => {
const randomNumber = math.floor(math.random() * 3);
switch (randomNumber) {
case 0:
return ‘rock’;
case 1:
return ‘paper’;
case 2:
return ‘scissors’;
}
};
console.log(getComputerChoice());
is what I have up to this point. Any help would be appreciated. Thanks