5 ms·
> [It's a term established in the language specification.] I'd say JS getters/setters are syntactic sugar for the OOP concept the author is talking about.
by ponyfleisch 8y ago
> [It's a term established in the language specification.]
I'd say JS getters/setters are syntactic sugar for the OOP concept the author is talking about.
- masswerk 8y agoIt's the main mechanism in JS to define functional accessors, at least since ECMA-Script 3. Before this, the terms have been used loosely, as well, for explicit accessor methods (like in Java). [Edit] Correction: should have been, at least since ECMA-262 5th Ed.