title: javascript setInterval in array
body: <p>I created an array and inserted a setInterval in it, but <code>tmp[0]</code> doesn't work</p>
  
  <pre><code>tmp = new Array();
  v = new Array();
  for(i=0; i&lt;2; i++){
  j = 0;
  tmp[i] = setInterval("if(j&lt;10+(i*5)){alert(i+' '+j);j++;}else{clearInterval(tmp[i])}", 1000);
  }
  </code></pre>