JavaScript ES6 promise for loop
As you already hinted in your question, your code creates all promises synchronously. Instead they should only be created at the time the preceding one resolves. Secondly, each promise that is created with new Promise needs to be resolved with a call to resolve (or reject). This should be done when the timer expires. That … Read more