> optional chaining and null coalescence are core language features of some very good languages
They are features of Maybe/Option too, just in a more consistent extensible way.
val a = Some(thing)
val b = a.flatMap(_.part).flatMap(_.subpart)
val c = Some(None) // look Ma! a nested option!
> While JS might get this stuff one dayI appreciate the attempt at pedantry, but TypeScript general only implements JS language features or TC39 Stage 3 proposals.
> I hope they do the pipe operator next!
Great example. After many hundreds of upvotes, the status is "waiting for TC39". [1] I.e. it will not be implemented until JS has it or is close to having it.
TypeScript is typed JavaScript, end of story.
Show me where decorators are in the ecmascript standard.
How about private variables in classes? (Hint: they're different)
Typescript is a superset not just typed JavaScript.
1. Decorators are currently TC39 Stage 2. [1]
2. Because of its unusual status, TypeScript lists decorators as "experimental, subject to change". Once the EcmaScript proposal advances, TS will ensure it is compatible with the ES standard and then remove the experimental sticker.
3. If it doesn't affect runtime, then you shouldn't expect JS to have the feature. TS private members are no different than public members at runtime; there is no need for JS to have that feature. (Note that TypeScript deliberately chooses not to name-mangle members.)
4. Sure call it a "feature and syntactic superset", but that doesn't make TS any less beholden to JS. Dedicated adherence to that property commits them to support every feature and syntax that JS adds; future-proofing means they can't really add anything that JS doesn't have or is going to have.
5. Note that TS abandoned having a standard long ago. The behavior and validity of TypeScript program is determined by "whatever tsc does" and the ES standard.
6. Again, if you need convincing that TS effectively only implements JS features, refer the linked pipeline issue, locked as "waiting for TC39."