Mid JavaScript

How do closures work in JavaScript?

Closures work because functions remember the scope in which they were created,

allowing access to outer function variables even after the outer function finishes.

More from JavaScript Tutorial

All questions for this course