Paper scissors rock help with function

My code

need help!
I stucked with the defining the winner… Function doesn’t work correctly and i can’t get why… Saw the video and tried to do this in VS Code, but result the same. ‘Tie’ and first IF works good, but second and third IF doesn’t work good, they always shows that I win or Tie

Hello @aston4ever, welcome to the forums! Check this line:

    if (compChoice === 'paper') {return 'Computer wins';} } else {return 'You Win!';}

Are there too many closing }s after the return 'Computer wins'? That could be causing the error.

no, this is nested If, so it’s fine with }

OMG!!! Else goes with nested IF! and I put esle outside the nested if!!! Two days i tried to find the mistake!!!

1 Like