DEV Community

Discussion on: JavaScript Closures

Collapse
 
nikhilshrv profile image
Nikhil Shrivastav • Edited

You mention -

An object cannot have closure.
Only functions.

Did you know, functions too are just Objects in JavaScript?

Collapse
 
annawijetunga profile image
Anna Wijetunga

And therein lies the rub! Exactly what makes JavaScript so confusing. Good of you to mention it :).