Javascript anonymous function argument passing (wrox professionnal javascript p188)
<p>Wrox Profesionnal Javascript p188
I don't understand this part at line 8 where the anonymous function already have an argument of num, but how can (i) is copied into the argument num. Normally a function would stop at the closing bracket }, adding (i) doesn't make sense for me.</p>

<pre><code>function createFunctions(){
    var result = new Array();
    for (var i=0; i &lt; 10; i++){
       result[i] = function(num){
         return function(){
           return num;
         };
       }(i);
    }
    return result;
}
</code></pre>
