What is TypeScript?
Definition
TypeScript is an open-source programming language developed by Microsoft that adds a static type system to JavaScript. Its syntax is a superset of JavaScript; type annotations are removed during compilation or type stripping, so what runs in the browser or on the server is plain JavaScript. The aim is to catch a class of errors before code runs and to enable reliable autocompletion and refactoring in large codebases.
Also known as: TS, tsc

Types exist only at compile time
In TypeScript you describe the shape of variables, function parameters and return values, and the compiler checks that the code honours that contract. Mistakes like "this field might be undefined" or "this function expects a string and you passed a number" surface before anything runs.
interface Order {
id: string;
amount: number;
coupon?: string;
}
function total(o: Order): number {
return o.amount - (o.coupon ? 50 : 0);
}
total({ id: "A1", amount: "120" });
// Error: Type 'string' is not assignable to type 'number'The crucial detail: type information is erased after compilation. At runtime there is no Order. TypeScript cannot guarantee that JSON coming back from an API actually has the expected shape; annotating it only tells the compiler to assume so. Anything from outside the program, whether API responses, form input or environment variables, still needs runtime validation.
Ways to run TypeScript
- The official compiler (
tsc): checks types and emits JavaScript. This is where type checking really happens. - Bundlers and transpilers: tools such as esbuild, SWC and Babel strip types very quickly but don't check them. Projects therefore usually run type checking as a separate step in the build process or CI.
- Running directly in Node.js: since v22.18.0 and v23.6.0, Node.js strips types from
.tsfiles by default, and the feature became stable in v24.12.0 and v25.2.0. It performs no type checking and supports only erasable syntax, so constructs that need code generation, such asenumor anamespacewith runtime code, throw an error. See the Node.js documentation for current details.
TypeScript 7 and the native compiler
Microsoft ported the compiler from TypeScript to Go and released TypeScript 7 on 8 July 2026. The release announcement reports typical full-build speedups of 8x to 12x. The language rules didn't change; what changed is how fast type checking and editor tooling run on large codebases. For teams that skipped type checks because they took too long, that is a practical difference.
When it pays off, and when it doesn't
In an application several developers will maintain for years, especially one with data models shared between frontend and backend, TypeScript earns its keep: rename a field and every affected call site becomes a compile error. The costs are real too: an extra build step, a learning curve and the temptation to write type definitions nobody can read. any quietly switches checking off, and a codebase that reaches for it often is less type-safe than it looks.
Types don't replace tests either. The compiler confirms a function returns a number, not that it returns the right number, so business rules still need unit tests. For a short script or a throwaway prototype, plain JavaScript is often enough.

