News for hackers. Stuff that matters.
Re:Replacing ‘that = this’ assignments in JavaScript with Ar... by WorldMaker on Friday April 14, 2017 @03:04PM (#14116403)
Plus the prototype pattern is more idiomatic JS and combines better with other OO libraries than the class constructor pattern in top comment.

Also, the ES2015 class keyword is syntactic sugar for the best of both worlds of the prototype pattern, combined with the private variable support of the class pattern. It does the right thing with both `this` and `super` (which is possible but tough with the prototype pattern and nearly impossible or at least crazy tough to do right with the class constructor pattern) and is as useful/important to replacing that = this/self = this antipatterns as arrow functions are.

There are no comments on this comment yet.