As the title suggests. How do I do this?
I want to call whenAllDone() after the forEach-loop has gone through each element and done some asynchronous p
whenAllDone()
You shouldn't need a callback for iterating through a list. Just add the end() call after the loop.
end()
posts.forEach(function(v, i){ res.write(v + ". Index " + i); }); res.end();