5 curated questions
JavaScript & TypeScript
Language semantics, execution, types, and the runtime model.
- 01foundation · 10 min
How do closures retain access to variables after a function returns?
Explain closure capture through lexical environments, reachability, and mutation—not a vague “function remembers variables” rule.
- 02foundation · 9 min
What actually happens when JavaScript executes a function?
Trace execution from the call site through execution contexts, lexical environments, and the call stack.
- 03intermediate · 14 min
How does the event loop order tasks, microtasks, and rendering?
Reason about observable ordering without relying on slogans such as “promises always run first.”
- 04intermediate · 12 min
How should asynchronous operations be composed with Promises?
Choose between sequential work, fail-fast aggregation, settled aggregation, and bounded concurrency.
- 05intermediate · 11 min
What does TypeScript mean by structural typing?
Explain compatibility through member shape, excess-property checks, and the limits of compile-time guarantees.