Get setInterval to perform an action a certain amount of times based on array
<p>I am trying to iterate through values in an array, via a setInterval(), every 10ms.</p>

<p>However because the computer cannot process the iterations that fast, my clearInterval() is in fact clearing the interval before the array has been fully iterated through.</p>

<p>The below is just an example of what I am doing, NOT the actual code which is more CPU intensive.</p>

<p>How do I fix the code so that it will iterate all the to the end, regardless of CPU performance?</p>

<pre><code>var blah = ['a','b','c'];
i=0;

int = setInterval(function(){   
    console.log(blah[i]);
    i++;
},10);

timeout = setTimeout(function(){
    clearInterval(int);
}, blah.length * 10);
</code></pre>
