3 ms·
You haven't got it wrong, the first example in the article behaves the same in JS, see https://jsfiddle.net/L5w2q1p7/ https://jsfiddle.net/L5w2q1p7/.
by gildas 10mo ago
You haven't got it wrong, the first example in the article behaves the same in JS, see https://jsfiddle.net/L5w2q1p7/ https://jsfiddle.net/L5w2q1p7/.
- krackers 10mo agoI think in JS it's easier to see because of the correspondence between Promises and async/await. So in your example the behavior is much more obvious if you sort of desugar it as async function parent() { print("parent before"); const p = child(); await p print("parent after"); }