Why does it pick heads or tails TWICE randomly? (Code link in description below here) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why does it pick heads or tails TWICE randomly? (Code link in description below here)

https://code.sololearn.com/WF2YoX6Jy5KZ/?ref=app

9th Mar 2022, 9:57 AM
Lego in Motion
Lego in Motion - avatar
3 Answers
+ 2
You are added to listeners 1st by inline 2nd by javascript
9th Mar 2022, 10:07 AM
Jayakrishna 🇮🇳
+ 4
It seems to be related to the fact that you added the same event twice to the button: once in html, once in js tab.
9th Mar 2022, 10:07 AM
Lisa
Lisa - avatar
+ 3
Thank you! (And you too Brave Tea for trying to help)
9th Mar 2022, 10:08 AM
Lego in Motion
Lego in Motion - avatar