Snake game not loading

My snake game isn’t finished yet but it should be working as it is. The page won’t load for some reason. The problem started when I put all my desktop folders into one desktop folder. It wouldn’t load in Visual Studio live server. The code won’t even work in codepen. It seems like the JS is causing the problem somehow since the page displays without it. Here’s the link to my codepen. I really appreciate any effort anyone puts into helping me with this.

You have an (almost) infinite loop in generateApples function.

1 Like

Thanks for responding. I commented that part out and the problem persists.

Well, now the snake in your codepen moves, so what is the problem now?

1 Like

I had to refresh the page. It works now. Thank you!