#javascript #mcqs-R Preparing for a JavaScript interview? Enhance your knowledge and test your skills with JavaScript multiple-choice questions! 💡 Whether you're a beginner or a seasoned developer, these questions will help you brush up on important concepts and get ready for your next interview. Check them out below . For all the interview question - Follow Duvvuru Kishore for more interview questions and mcq's #frontend #JavaScript #interview R- Repeat
A) 3 3 3 B) 0 1 2 The real lesson here isn’t setTimeout, it’s scope + closures. var shares one function-scoped binding. let creates a new block-scoped binding per iteration. Small keyword. Big production difference
Option A) is correct
👏
(a) 333 (b) 012
A) 3 3 3 & B) 0 1 2
333, 012
333,012
A
A
A) 3 3 3 → var is function-scoped, so all timeouts share the same i, which becomes 3 after the loop ends. B) 0 1 2 → let is block-scoped, so each iteration gets its own i value.