A practical, easy-to-follow guide from JavaScript to TypeScript
These notes follow the topics in the uploaded TypeScript Full Course
PDF. I've rewritten the explanations in a more natural, student-friendly
way and kept the examples close to the original material.
1. What is TypeScript?
TypeScript is JavaScript with an extra layer of type checking.
In JavaScript, a variable can hold different kinds of values as your
program runs. That flexibility is useful, but it can also lead to
mistakes that are difficult to spot.
TypeScript lets us describe what kind of value a variable should
contain. It checks those rules while we are writing and compiling the
code.
One important thing to remember: TypeScript does not run directly in
the browser or Node.js. It is compiled into JavaScript first.…