TypeScript allows you to specify types for your variables. This means the value of a variable cannot be changed to another type that wasn't specified beforehand. Otherwise, the compiler would throw an error. See the example below.
TypeScript especially shines in big projects because it supports object-oriented programming concepts such as classes, interfaces, inheritance, etc., which make it easier to organize your code and keep it modular.
Code Editor Support
Code editors (IDEs) such as VS Code provide documentation, auto-suggest and highlight errors directly before compiling the code.