Question d’entretien chez IG Group

What is a closure in JavaScript?

Réponse à la question d'entretien

Utilisateur anonyme

10 juil. 2019

A closure is when an inner function has access to the variables and parameters of its outer function, even after the outer function has returned. To use a closure, define a function inside another function and expose it. To expose a function, return it or pass it to another function.