Javascript – Why does `promise.finally` execute after its caller's `then`?
Consider this: const a = () => { return new Promise((resolve) => { resolve(1); }); }; const b = () => { return new Promise((resolve) => { a() .then((aR) => { console.log(aR); resolve(2); }) .finally(() => { console.log("A"); }); });…