Why TypeScript with JavaScript
Why TypeScript with JavaScript
The most common kinds of errors that programmers write can be described as type
errors: a certain kind of value was used where a different kind of value
was expected. This could be due to simple typos, a failure to understand the
API surface of a library, incorrect assumptions about runtime behavior, or
other errors. The goal of TypeScript is to be a static type checker for
JavaScript programs - in other words, a tool that runs before your code runs
(static) and ensures that the types of the program are correct (type
checked).
What is TypeScript?
https://www.typescriptlang.org/
TypeScript is a “flavor” or “variant” of JavaScript.
TypeScript adds additional syntax to JavaScript to support
a tighter integration with your editor. Catch errors
early in your editor.
TypeScript code converts to JavaScript, which runs
anywhere JavaScript runs: In a browser, on Node.js or
in your apps.
TypeScript understands JavaScript and uses type
inference to give you great tooling without additional
code.