Skip to content

Instantly share code, notes, and snippets.

@cesutherland
Created February 28, 2014 16:03
Show Gist options
  • Save cesutherland/9273670 to your computer and use it in GitHub Desktop.
Save cesutherland/9273670 to your computer and use it in GitHub Desktop.
function workMyCollection(arr) {
return arr.reduce(function(promise, item) {
return promise.then(function(result) {
return doSomethingAsyncWithResult(item, result);
});
}, q());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment