Hmm I am not sure your test case is showing the same thing. Here is a simpler one:

```
for (var i=0; i < 5; i++) {
    console.log('main on iteration ' + i);
    setTimeout(function() {
        console.log('setinterval on iteration ' + i);
    }, 250);
}
```

This does not use jquery so should work in node, here is the output:

```
main on iteration 0
main on iteration 1
main on iteration 2
main on iteration 3
main on iteration 4
setinterval on iteration 5
setinterval on iteration 5
setinterval on iteration 5
setinterval on iteration 5
setinterval on iteration 5
```

A small change to get the desired behavior is to put each async call into it's own closure:

```
for (var i=0; i < 5; i++) {
    console.log('main on iteration ' + i);
    (function (i) {
        setTimeout(function() {
            console.log('setinterval on iteration ' + i);
        }, 250);
    })(i);
}
```

Which returns:

```
main on iteration 0
main on iteration 1
main on iteration 2
main on iteration 3
main on iteration 4
setinterval on iteration 0
setinterval on iteration 1
setinterval on iteration 2
setinterval on iteration 3
setinterval on iteration 4
```