The revealing module pattern is a great pattern. That is how I used to write my JavaScript classes before going fully functional.
And yes, that pattern is a really good way to still create an Object without the need for this.
this
It would actually be better to switch your class to use the revealing module pattern. And if you can't, there's always nothis :)
nothis
Cheers!
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.
The revealing module pattern is a great pattern. That is how I used to write my JavaScript classes before going fully functional.
And yes, that pattern is a really good way to still create an Object without the need for
this
.It would actually be better to switch your class to use the revealing module pattern. And if you can't, there's always
nothis
:)Cheers!