How to correctly construct a loop to make sure the following promise call and the chained logger.log(res) runs synchronously through iterat
How about this one using BlueBird?
function fetchUserDetails(arr) { return Promise.each(arr, function(email) { return db.getUser(email).done(function(res) { logger.log(res); }); }); }