Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. list_of_things.reduce(function(accumulator, link) {
  2. return accumulator.then(function(results) {
  3. return doSomething(link).then(function(result) {
  4. results.push(result);
  5. return results;
  6. });
  7. }), Promise.resolve([])).then(function(results){
  8. console.log('all results', results );
  9. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement