How to allow arbitrary 'update' functions to be passed to a requestAnimationFrame loop?
<p>Here is what I have at the moment:</p>

<pre><code>function animateLetter(letter, type){
    letter.css(type, '50%');
    var j = 50;
    loop(function(){
    letter.css(type, (j =- 5) + '%'); 
    return j &lt; 0;
    });
   }

   function loop(run) {
       if(run.apply()) requestAnimationFrame(loop(run));
   }
</code></pre>

<p>Why would this not work? I'm new to JS so might be missing something obvious. </p>
