Answer the question
In order to leave comments, you need to log in
Is there a sequential Promise.all?
Here is an array of promises:
var arr = ['a', 'b', 'c'];
var promises = arr.map(function(str) {
return new Promise(function(resolve, reject) {
console.log(str);
setTimeout(resolve, 1000);
});
});
Answer the question
In order to leave comments, you need to log in
No.
It can be done in a loop, like we take a promise, execute it and return the next one in it. Then there will be a chain. I don't understand about 3 seconds.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question