title: Better understanding of JavaScript closure inside loops
body: <p>I'm dealing with the closure issue right now and I need a little help on the topic:
  Using this code for my training:</p>
  
  <pre><code>for (var i = 1; i &lt;= 10; i++) {
      setTimeout(function(j) {
          console.log(j);
      }(i), 1000);
  }
  </code></pre>
  
  <p>This solution timeouts for a second and then prints 1-10 in ascending order (as expected).
  Now, I want it to print j once every second:  </p>
  
  <blockquote>
    <p>1 (second passed...)<br>
    2 (second passed...)<br>
    3 (second passed...)<br>
    etc..</p>
  </blockquote>
  
  <p>How can I make this happen without changing the formation of the loop?</p>
  
  <p>Thanks in advance</p>