I'm trying to make a game loop for an HTML / Javascript browser game I'm working on. I am currently using this code here as a loop:

```
while(true)
{
   (game code here)
}

```

The code is in an externally linked Javascript file, and should have a game loop which does not break the game.

After a bit of reading I found out that the loop makes the page unresponsive. What is the correct way to include a game loop in HTML / Javascript without breaking the page?