DEV Community

Discussion on: Function vs Object

Collapse
 
kelleyvanevert profile image
Kelley van Evert

Yes, I love this insight, also known as: "Objects are a poor man's closures!"

For example, for better or for worse, d3 uses a lot of this (closure state instead of objects) in their API. See e.g. github.com/d3/d3-scale/blob/master...