Hacker News new | ask | show | jobs
by orange8 1190 days ago
This kind of reminded me of the module pattern [1] popular with ye olde jQuery plugins. Just realized that hooks try to emulate what JS does natively, which is keeping track of all local variables in a functions calling scope. Meaning that if that function returns an object, that Object still has access to all the variables declared when that function run.

[1] https://stackoverflow.com/questions/17776940/javascript-modu...