Question PRG-JS-0063
HardWhat is the output of this program?
const say = (x) => process.stdout.write(x + " ");
async function a() { say(1); await null; say(3); }
say(0);
a();
setTimeout(() => say(5), 0);
Promise.resolve().then(() => say(4));
say(2);
- A.
0 2 1 3 4 5
- B.
0 1 2 4 3 5
- C.
Sign up free to see the answer and a step-by-step explanation.