Question PRG-JS-0016
HardWhat is the output of this program?
const out = [];
for (let i = 0; i < 3; i++) {
setTimeout(() => { out.push(i); if (out.length === 3) console.log(out.join(' ')); }, 0);
}
- A.
3 3 3
- B.
0 1 2
- C.
Sign up free to see the answer and a step-by-step explanation.