DEV Community

Discussion on: Execute Promise-based code in order over an array

Collapse
 
anduser96 profile image
Andrei Gatej

‘How would I use .then() and jump to the next iteration step within that then?’.

I’d get the next item in the array before using then() on the current item.

I really liked your idea, thank you for sharing!

Collapse
 
4nduril profile image
Tobias Barth

Thanks for your reply. I would love to see your version in code. Because I fear I do not understand how that would work with an unknown array length.

I'm happy that you liked my take on that.

Collapse
 
anduser96 profile image
Andrei Gatej

Hi! Here is what I meant.

I also linked the resource where I've found out the idea.
Hope you find it useful.