Hacker News new | ask | show | jobs
by cstrahan 2660 days ago
Define a set of functions that close over their lexical environment, then treat the closed-over variables as internal/private state, and treat those functions as you would methods in OOP (reading/mutating the aforementioned variables).
1 comments

That's basically the same level of OOP compared to how one can implement numbers and numeric operations as functions.