Asynchronous Javascript Varaible Overwrite
<p>The code has an issue that the variable gets over written when the asynchronous function is called. How can it be fixed? </p>

<p>Code:</p>

<pre><code>for (x in files) {

 asynchronousFunction(var1, var2, function(){
      console.log(x.someVaraible);
  }); 

}
</code></pre>

<p>Now the issue is that when the callback function in the asynchronousFunction is called the x.files variable has been updated to the next varaible in the json array files. I want that the variable should contain the previous value.</p>

<p>The number of variables in the callback function can not be changes, so variable name can not be sent in the call back function.</p>
