Math Killed the JavaScript Star! | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Math Killed the JavaScript Star!

Hi community! Hope youā€™re all doing fine. Im practicing with JS, and Im writing this simple program that generates a random Math operation, on which the user verifies if the answer is correct or not, clicking a button. The problem comes when the result is correct. The program outputs correct or incorrect each time the buttom is clicked. The issue is no replicated when the result is incorrect, the output works, telling the user the answer is incorrect. I wasn't able to paste my code here, so you can go here for a full working sample: https://code.sololearn.com/WI525ZXKx1O8 I'm beginner. Any help its greatly appreciated. ;-)

7th Aug 2018, 12:04 AM
pierre pucheu
pierre pucheu - avatar
2 Respostas
+ 3
You call printSymbol twice - so the user will be asked one thing and validator will choose another random symbol and calculate something completely different!
7th Aug 2018, 12:19 AM
Schindlabua
Schindlabua - avatar
0
Hey, thanks for your answer @Schindlabua. Im gonna try and let you know )
7th Aug 2018, 1:33 PM
pierre pucheu
pierre pucheu - avatar