Question d’entretien chez Bitly

Explain what a Javascript closure is.

Réponse à la question d'entretien

Utilisateur anonyme

2 avr. 2019

Closure is basically when a function returns another function. The returned function keeps a reference to it's surrounding variable environment better known as it's lexical scope. This pattern allows the function to keep track of state.