|
|
|
|
|
by paulddraper
2420 days ago
|
|
> 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. [1] https://github.com/Microsoft/TypeScript/issues/17718 |
|
How about private variables in classes? (Hint: they're different)
Typescript is a superset not just typed JavaScript.