Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list_of_things.reduce(function(accumulator, link) {
- return accumulator.then(function(results) {
- return doSomething(link).then(function(result) {
- results.push(result);
- return results;
- });
- }), Promise.resolve([])).then(function(results){
- console.log('all results', results );
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement