Comment Comment by zanethomas closures can encapsulate state and methods classes are syntactic sugaremulating classes is, imo, exactly the problemusing factory functions which create and return an object, with variables passed to and created in the function, handles encapsulationand there is no `this` to deal with parent zanethomas 2 years ago
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