3 ms·
It should be noted that there are some caveats to TypeScript, namely that it's type-safety is only compile-time and not at run-time. It is best-effort type-safe
by ihsw 11y ago
It should be noted that there are some caveats to TypeScript, namely that it's type-safety is only compile-time and not at run-time. It is best-effort type-safety.
That said, the edge cases are few and far between. TS is a fantastic language to work with.
- djur 11y agoI think the issue you're mentioning isn't so much that TS only enforces type safety at compile time, because that's true of Haskell, OCaml, C++, etc. as well, but that by its nature it can't enforce any type contracts with the large quantity of dynamically-typed JavaScript you're probably going to be dealing with. Of course, this is also an issue when safe Haskell, OCaml, etc. code interacts with compiled C code at runtime as well.