map function workMyCollection(arr) { return q.all(arr.map(function(item) { return doSomethingAsync(item); })); } reduce function workMyCollection(arr) { return arr.reduce(function(promise, item) { return promise.then(function(result) { retu
function workMyCollection(arr) { return q.all(arr.map(function(item) { return doSomethingAsync(item); })); }reduce
function workMyCollection(arr) { return arr.reduce(function(promise, item) { return promise.then(function(result) { return doSomethingAsyncWithResult(item, result); }); }, q()); }