Using Typescript in Projects

This post was flagged by the community and is temporarily hidden.

That ‘heavy lifting’ is not lost when compiling into JS. The JS is the exact same logic the developer wrote converted into code that the browser/engine can run. TS is not about runtime behavior, its about catching developer bugs.

The purpose of TS is type checking during the compilation process to prevent errors due to the developer using incompatible variables types, such as in function calls.

TS will complain when you misuse a function like this:

const result = thisFunctionOnlyAcceptsAString(5);

Developers write bugs. Tools and languages that help developers catch bugs let the developer focus on the ‘big picture’ more.