title: Why does calling requestAnimationFrame at the beginning of a loop not cause infinite recursion?
body: <p>What is going on that allows the rest of the loop to execute, and then for <code>requestAnimationFrame</code> to execute next frame?</p>
  <p>I am misunderstanding how this method works, and can't see a clear explanation anywhere. I tried reading the timing specification here <a href="http://www.w3.org/TR/animation-timing/" rel="nofollow noreferrer">http://www.w3.org/TR/animation-timing/</a> but I couldn't make out how it worked.</p>
  <p>For example, this code is taken from the threejs documentation.</p>
  <pre><code>var render = function () { 
    requestAnimationFrame(render); 
    cube.rotation.x += 0.1; 
    cube.rotation.y += 0.1;
    renderer.render(scene, camera); 
  };
  </code></pre>