Bugs on PC, but not on mobile
My code ( https://code.sololearn.com/WpCApR631liy/?ref=app) has a few bugs and I don't know why. Sometimes the moving red square seems to jump between to points very quickly (it's movement is defined in the function at line 276). [And when you lose and click "try again", the reset button is gone. (That's solved now.)] Also, sometimes the console says "TypeError: Cannot read property 'style' of null" (but nothing is wrong with the output, except for the other two bugs). Weirdly though, none of these problems appears when I run the code on my mobile phone. I couldn't find out why that happens. I hope my code isn't too messy for you. Edit: The problems seem to be gone now.