Usually we can do loops for arrays and objects to iterate over properties / values. But the loops are blocking. However, timeouts can be used to simulate an asynchronization cycle. I managed to do this for an array .
(function asyncLoop(i){
if(++i < array.length){
setTimeout(function(){asyncLoop(i);}, 1);
} else {
callback();
}
}(0));
but this model only works during a loop in an array where there is a delimiter - iwhich is passed. is there any way to do this on an object? let me just say that the object has 50k keys for repetition, which makes it unreasonably long.
I already know about this setImmediate(afaik, only new IE) and WebWorkers (not yet in IE), but I just want to know if it is possible to use the same strategy for an object.