Asynchronous for loop with Javascript
<p>I have this code that I need to convert to async loop since obviously this code for-loop will block the UI/Browser:</p>

<pre><code>    $wnd.mainbuff = [];
    $wnd.update = setInterval(function(){
            // fetches everything in the buffer (csv), including old data
            var temp = $wnd.Recorder.audioData().toString();
            var arr = temp.split(',');
            // so, copy new elements only (must be async) 
            for (var i=$wnd.mainbuff.length; i &lt; arr.length; i++) {
                console.log(arr[i]);
                $wnd.mainbuff[i] = arr[i];  
            }
        }
    ,25)
</code></pre>
