0
What is the output of the following JavaScript code?
console.log(1);
setTimeout(() => console.log(2), 0);
Promise.resolve().then(() => console.log(3));
console.log(4);- A1 2 3 4
- B1 4 2 3
- C1 3 4 2
- D1 4 3 2
Correct answer: D
What is the output of the following JavaScript code?
console.log(1);
setTimeout(() => console.log(2), 0);
Promise.resolve().then(() => console.log(3));
console.log(4);