3 ms·
closures can encapsulate state and methods classes are syntactic sugar emulating classes is, imo, exactly the problem using factory functions which create and
by zanethomas 2y ago
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