Appearance
What is TypeScript?
TypeScript is a superset of JavaScript that adds static type checking to catch errors before code runs. It improves code quality with features like type annotations, better autocompletion, and clearer error messages.
Since browsers only run JavaScript, TypeScript must be compiled, or more accurately "transpiled", which means converting from one high-level language to another. Tools like Vite handle this automatically and generate source maps so you can debug your original TypeScript code directly in the browser.
🔥 Don't get confused by online demos that use the
tsctranspiler: it isn't needed with Vite.
We'll explore key TypeScript language features most relevant to this course. We'll see how TypeScript enhances JavaScript features introduced in the previous sections with type annotations and other features like interfaces and generics.