Are closures just functions in JavaScript?
No. A closure is the combination of a function and its lexical environment (the variables it closes over). The function alone is not the closure; the function plus the retained outer variables is the closure.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in What Is a Closure in JavaScript?
Still have questions?
Browse all our FAQs or reach out to our support team
