Matthew Meinzer
Nov 1 · 1 min read

Yes — this particular part is very confusing at best.

Every .then() call returns a promise — which is the only reason you can chain the .then calls.

Each call will wait for the previous promise to resolve as it calls the next function with the result of the previous one. In the case where you don’t return anything — like in your example — the next function in the chain just gets called with undefined. You can easily verify this by putting conosole.log statements in each callback and see that they log out in order.

    Matthew Meinzer

    Written by