Comment

Comment by zanethomas

closures can encapsulate state and methods classes are syntactic sugar

emulating classes is, imo, exactly the problem

using factory functions which create and return an object, with variables passed to and created in the function, handles encapsulation

and there is no `this` to deal with

parent zanethomas 2 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton