TypeScript makes JavaScript classes actually useful ^^
By fixing a fatal ES6 class flaw
The conspicuous absence of a way to reference constructor arguments within inline class property initializers
Which IMO after a year of struggles completely hobbles ES6 classes
But TypeScript classes literally solve that exact problem
Tangential but concerning classes, ES6 classes are incredibly unsafe due to ESLint's inability to catch mis-uses of this
the way ESLint catches "usage before definition" errors for local scope variables
But TypeScript is capable of identifying that exact category of issue even with this
, which is demonstrated in the above example by the error in bar = this.init2;
So not only are TypeScript classes not broken, this
is as safe as using local scope variables
I'd go so far as to call ES6 classes an antipattern within any stack that supports TypeScript, and very questionable even in a stack that doesn't support TypeScript