 <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/break">break</a> is to break out of a loop like for, while, switch etc which you don't have here, you need to use <code>return</code> to break the execution flow of the current function and return to the caller.</p> <pre><code>function loop() { if (isPlaying) { jet1.draw(); drawAllEnemies(); requestAnimFrame(loop); if (game == 1) { return } } } </code></pre> <p>Note: This does not cover the logic behind the if condition or when to return from the method, for that we need to have more context regarding the <code>drawAllEnemies</code> and <code>requestAnimFrame</code> method as well as how <code>game</code> value is updated</p>