Both techniques optimize application performance by limiting how often a function executes, typically during high-frequency events like scrolling, resizing, or typing.
A function that retains access to variables from its outer scope even after the outer function has finished executing. What is the Event Loop? happy rawat javascript interview questions pdf free best
A closure is a function having access to the parent scope, even after the parent function has closed. They are heavily tested in "currying" and data-hiding scenarios. 2. Asynchronous JavaScript typically during high-frequency events like scrolling
Hoisted but placed in a "Temporal Dead Zone" (TDZ). Accessing them before initialization throws a ReferenceError . 3. Closures and Lexical Scoping happy rawat javascript interview questions pdf free best