Typescript is Javascript that scales with added types. It uses compiler flags and strict typing to catch errors at compile time rather than runtime. Typescript allows for generic functions, union and intersection of types, and discriminated unions to enforce business logic rules. Features like type inference, type guards, and nominal typing help reduce bugs and improve code quality and maintainability compared to plain Javascript.
7. STRICT NULL CHECKS
Thomas Hoare, a famous and influential computer scientist
innumerable errors, vulnerabilities, and system crashes, which
have probably caused a billion dollars of pain and damage in
the last forty years.
15. DISCRIMINTATED UNION TYPES
Creating discriminated unions is an extremely powerful way of
composing types.
Discriminated unions let you enforce some business logic
rules at compile-time.