TypeScript is a superset of JavaScript that adds static type annotations. Every valid JavaScript program is also valid TypeScript, but TypeScript catches errors at compile time that JavaScript would only catch at runtime. Type annotations describe the shape of your data: function add(a: number, b: number): number tells the compiler (and your IDE) that add takes two numbers and returns a number. If you try to pass a string, TypeScript flags the error before your code runs.
glossary2 min read
What is TypeScript?
TypeScript adds static types to JavaScript. Learn why it matters and how to start.
Try these tools
More glossary articles
What is WebP?
WebP is a modern image format by Google offering superior compression. Learn when and how to use WebP images.
What is HEIC?
HEIC is the default photo format on iPhones. Learn what it is, why Apple uses it, and how to convert it.
What is JSON?
JSON (JavaScript Object Notation) is the standard data format for web APIs. Learn the syntax and common uses.
What is Regex?
Regular expressions (regex) are patterns for matching text. Learn the basics and common use cases.