Skip to main content
FREE Mock interview & resume review with Sumit. Free right now, no payment needed.Book a slot

JavaScript Question 2

Question 2 of 0JavaScript

What's the output?

Login Required

Please login to select answers and solve this question. You can view the question without logging in.

Code:
for (var i = 0; i < 3; i++) {
  setTimeout(() => console.log(i), 1);
}

for (let i = 0; i < 3; i++) {
  setTimeout(() => console.log(i), 1);
}

Select the correct option:

Question discussion

(0)

Join the discussion — login to comment and help other developers.

Login to comment