possible alternative using bind :
var asyncConfig = {}; var a, b; for(var i = 0; i < someValue; i++) {
Be sure to check if the environments in which you use this support are tied. Also, I bind the value of "this" to asyncConfig , this may not be right for you.
edit: Reading the question again - a or b primitives or objects / arrays? If they are not primitives, then you will want to clone them.
source share