News for hackers. Stuff that matters.
Re:A Modern JavaScript Tutorial by DrScientist on Monday December 07, 2020 @02:49PM (#25336367)
As I said, it's not a bad attempt, and it's presence has probably given renewed impetus to js lang improvements.

Though the attempts at close compatibility mean it's not properly type safe despite it's name.

In the end, it's still a 'splitter' to quote Monty Python.

Re:A Modern JavaScript Tutorial by rictic on Monday December 07, 2020 @03:47PM (#25337269)
> Though the attempts at close compatibility mean it's not properly type safe despite its name.

Every type checked language I've used, from Haskell to Java to Idris to C++ to Rust has ways to override the type checker (and either do the type checking at runtime, or, as C++ is often want to do, just YOLO it). It's not just the language but the codebase and the norms it and its dependencies use.

Some TypeScript codebases, the types are usually accurate, but not enough to rely on them, so you still need to do runtime checks in many places. In others, if something says (string|null) then you know with confidence that it is either a string or the null value, nothing more and nothing less.