git
ask
hub
Privacy
Terms
Sign in with GitHub
rohan-paul/javascript-tricky-interview-questions
↗
Stars ·
7
Language ·
JavaScript
Simplify and Visualize This Repo
Scan the safety of this repo
Self Host this repo
Check out more work of Developer: rohan-paul
Ask anything about this repo to start.
Walk me through why a for loop with setTimeout doesn't print the expected numbers, using closures to explain the behavior step by step.
Show me how to create private variables in JavaScript without classes, and explain why this pattern works using closures.
Give me three tricky JavaScript closure interview questions similar to the setTimeout-in-a-loop problem and walk me through each solution.
Explain the difference between how setTimeout captures variables in a loop versus using let, and show code examples of both.
Full explanation on explaingit →
📎
Send
By chatting or signing in you agree to the
Terms
and chat-message logging (revocable in
History
).