title: setTimeout inside for loop with Interval 0
body: <p>when I print "i" inside setTimeout with time diff 0. why does it print "n" the same number always?</p>
  
  <pre><code>for(i = 0; i &lt; 5; i++) {
     setTimeout(function() {console.log(i)}, 0);
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>5
  5
  5
  5
  5
  </code></pre>