title: Asynchronous call in for loop cause variable to be wrong in callback
body: <p>I have the following code in a function :</p>
  
  <pre><code>for (var key in handlers) {
    var handler = new handlerClass(key);
    handler.search(user.login, function(userFound) {
      if (!userFound) {
        handler.create... //Here handler is the last handler of the loop
      }
    });
  }
  </code></pre>
  
  <p>I understand what appens, the loop finish before handler.create is called, so when it is called handler is equal to the last handler of the loop.</p>
  
  <p>How can I solve this ?</p>