Rock, Paper, Scissors functions problems

Can anyone tell me where the issue lies with this exercise. i just can’t seem to get it right

Hello @giga8856184506, welcome to the forums! It looks like you’ve closed (put a closing curly-brace }) your getComputerChoice function before the switch statement:

 const getComputerChoice = () => {
    const randomNumber = Math.floor(Math.random() * 3);
//See here-you've closed the function before the switch

  switch (randomNumber) {
    case 0:
    return 'rock';
    case 1:
    return 'paper';
    case 2:
    return 'scissors';

I hope this helps!

1 Like

That did the trick :slight_smile: thanks a million

1 Like