title: Javascript for loop, index variable in function
body: <p>I'm trying to figure out how to generate functions inside for loop.
  I have:</p>
  
  <pre><code>for (var i = fir_0_f.length - 1; i &gt;= 0; i--){
    var next = i+1;
    var N = i;
    // Attemps
        //goal0_[i](next,N);
        //eval('goal0_'+i+'('+next+', '+N+')');
  }; 
  </code></pre>
  
  <p>Have done also some searching. [] expects a string, eval() is a B.A.D practice. Is there any other way?
  How to set the timeout for each function later? So they would run sequentally?</p>
  
  <p>Thanks a lot!</p>