Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var allPromises = (async function loop() {
- const promises = [];
- for (let i = 0; i < 10; i++) {
- const promise = new Promise(resolve => resolve(i));
- promises.push(promise);
- }
- return promises;
- })();
- allPromises.then(allPromisesResult => Promise.all(allPromisesResult).then(final => console.log('finalResult', final)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement