title: Can i have a infinite loop without crashing it?
body: <p>I want to make this code infinite loop (i placed it in loop.js) without crashing the browser with a really short delay</p>
  <pre><code>player.style.right = (Number(player.style.right.split(&quot;px&quot;)[0]) - dx) + &quot;px&quot;;
    player.style.top = (Number(player.style.right.split(&quot;px&quot;)[0]) - dy) + &quot;px&quot;;
    if (player.style.right.split(&quot;px&quot;)[0] &gt; 315) {
      player.style.right = 315 + &quot;px&quot;;
    }
    if (player.style.right.split(&quot;px&quot;)[0] &lt; -30) {
      player.style.right = -30 + &quot;px&quot;;
    }
    if (player.style.top.split(&quot;px&quot;)[0] &lt; 0) {
      player.style.top = 0 + &quot;px&quot;;
    }
    if (player.style.top.split(&quot;px&quot;)[0] &gt; 282) {
      player.style.top = 282 + &quot;px&quot;;
    }
  console.log(`dx:${dx}`)
  console.log(`dy:${dy}`);
  </code></pre>
  <p>How can i do it?</p>