`for` ordinary syntax to debug endless loop
<p>I found the function <a href="http://jsfromhell.com/math/mdc" rel="nofollow">here</a>. It accepts an array of integers and returns their greatest common divisor. Sometimes it gets into an endless loop and crashes the browser. I want to debug it to find the cause, but I don't understand the syntax used in <code>for</code>s. How could these be re-written to ordinary <code>for(var i; i&lt;max; i++)</code> loops?</p>

<pre><code>mdc = function(o){
    if(!o.length)
        return 0;
    for(var r, a, i = o.length - 1, b = o[i]; i;)
        for(a = o[--i]; r = a % b; a = b, b = r);
    return b;
}; 
</code></pre>
