Echo JS 0.11.0

<~>
GrosSacASacs 3090 days ago. link 1 point
I am also exploring different ways to create "classes" of objects. 

1 way I came up with is to use plain function that just returns a plain Object without prototype, without common functionality.

Methods are instead stored as plain functions as properties of the factory function(in JavaScript a function is also an object), with an explicit 1st argument taking the instance.

It plays well with higher order functions (forEach, Map, Some)

Example:

https://github.com/GrosSacASac/JavaScript-Set-Up/blob/master/js/examples/class/class5.js

Replies