title: Var gives latest data in async callback
body: <p>There is a different behaviour between Internet Explorer and Google Chrome for when using async callbacks. For this function I load data from the server with a  for-loop for the year 2017 until the current year.</p>
  
  <p>The code I have is:</p>
  
  <pre><code>        for (var y = 2017; y &lt;= crrntYr; y++) {
              cnt++;
              var rtrn = evalExpression(sssn, "call('rp/ajax/wkChrt','" + y + "')", function (data) {
                      console.log(y);
                  });
          }
  </code></pre>
  
  <p>The problem exists in Internet Explorer, when the callback is done:
   y == 2019
  So for every year when the data is retrieved, the for loop is already ended and y=2019.</p>
  
  <p>In Google Chrome it works as intented, when the callback is done, y is the value of when the evalExpression() was started, so it is the year is is processing.</p>
  
  <p>How can I set y to the right value in the callback function?</p>
  
  <p>Edit 10:42: Simplified the function to the basics</p>