0

I can't get this if statement to work?

I can't get this code to work. Anyone tell me why and how to correct it? https://code.sololearn.com/WuM5vVBVWrHk I want the code to let the user click a button and the code to set the players number to that button. I then want the code to generate a random number and if that number matches the players number then the player is out. eg: player clicks button 7 so player's number == 7. The random number is picked and it is 7 so it shows an alert box saying game over

14th Oct 2020, 7:02 PM
Joel Hayward
Joel Hayward - avatar
2 Answers
+ 4
What do you want to achieve and what are you getting?
14th Oct 2020, 7:46 PM
Galaxy-Coding (inactive)
Galaxy-Coding (inactive) - avatar
+ 1
First you forgot to add "( )" in function declaration (line 26) it should be: function myRandom() { ... }
14th Oct 2020, 7:08 PM
Sousou
Sousou - avatar