This is awesome! Super clean! I'm pretty much a beginner with JS but what are the benefits of using a closure implementation?
In all honesty, I'm not sure about the benefits. Previously, JS didn't have "class" syntax, therefore closures were necessary. But when the class keyword was released with ES6, I believe, that provided a new way to write this type of data structure.
Oh! That's makes a lot of sense. I remember trying to do something similar to this using prototypes and it was not fun.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is awesome! Super clean! I'm pretty much a beginner with JS but what are the benefits of using a closure implementation?
In all honesty, I'm not sure about the benefits. Previously, JS didn't have "class" syntax, therefore closures were necessary. But when the class keyword was released with ES6, I believe, that provided a new way to write this type of data structure.
Oh! That's makes a lot of sense. I remember trying to do something similar to this using prototypes and it was not fun.