title: Closure with for loop
body: <p>Here is the code with works perfectly, what is <code>(i)</code> after curly bracket</p>
  
  <pre><code>for (var i = 0; i &lt; 5; i++) {
    setTimeout(function(j) { 
      console.log(j);
    }(i), 1000);
  }
  </code></pre>
  
  <p>Is this the way to pass the parameter value in an anonymous function?</p>