Enlist list advantages of closures in JavaScript?

Srinivas
Srinivas

Posted On: Feb 22, 2018

 

There are several advantages of using closures in JavaScript. Some of them are:

  • Closure enables the use of nested functions that are used to get the values created in the execution context of that of the parent function.
  • They can prove as a perfect solution while solving a problem of hierarchy in any program.
  • They have huge importance as far as functional programming is concerned. It solves the for loop problem of functional programming.
  • It is also used to simulate private scope for variables.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions