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