When would you use javascript closures?



When would you use javascript closures?..

Answer / Meenakshi Agarwal

JavaScript closures are used when a function returns another function that has access to its outer (enclosing) function's variables. This is useful in situations like event handling, memoization, and managing state data across multiple functions.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

What is difference between api and library?

1 Answers  


What is local scope in javascript?

1 Answers  


How to call a function inside a function in javascript?

1 Answers  


Explain the working of timers in javascript?

1 Answers  


How to capture the Image width and height using QTP script ? Kindly answer plz.... Thanx in adavance...

1 Answers  


What are different types of inheritence? Which inheritance is followed in javascript.

1 Answers  


Is javascript enabled on my computer?

1 Answers  


Write a program to check whether a given number is a palindrome or not?

13 Answers  


What is difference between array.splice() and array.slice() method in javascript?

1 Answers  


Write a program that inputs a 5-digit integer from the keyboard and prints if the input number is a palindrome or not. A palindrome is a number which has the same digit from either end.

1 Answers  


Should I learn java first or javascript?

1 Answers  


What is difference between ajax and javascript?

1 Answers  


Categories