Need help coding enemies to new web game in HTML/JavaScript

So, I made a few changes.
However, the WebView just disappears. this was an attempt to add collision/. If there is a collision, game is supposed to stop by calling the stop()method.
I’m not sure if I did this all right.
this code has gone through many changes. I was attempting to add circular objects that explode into smaller circles that act as projectiles to the enemy. but that was too much so I thought I could focus on collision detection.