I've been hitting my head on JavaScript's Async behavior when scaling functions from my test data to production work.
I have a for
loop that I know will range in the hundreds of thousands, will Node pause a for
loop and come back to it or can I safely assume that Node will execute the loop to completion before returning my function?
Here is the loop in question:
function fixData(dataset, blockcount){
for (var i = 0, len = dataset.length; i < len; i++) {
var obj = dataset[i];
obj._id = obj.name;
obj.expires = blockcount + obj.expires_in;
delete obj.expires_in;
}
return dataset;
}