TypeScript is an open-source language from Microsoft that adds static types to JavaScript and compiles down to plain JavaScript. It was announced on October 1, 2012, with version 0.8, and its lead designer is Anders Hejlsberg, the architect of C# and Turbo Pascal. The most important decision in its history was also the first one, and it explains why Microsoft made TypeScript a superset of JavaScript: every valid JavaScript program is valid TypeScript, so teams could adopt it one file at a time without rewriting anything.

Why Microsoft made TypeScript a superset of JavaScript

Around 2010, Microsoft teams building large browser applications, including web versions of Office tools, found JavaScript hard to scale. Refactoring was risky, editors could offer little help and bugs surfaced at run time. Other projects tried to escape JavaScript entirely: Google's Dart and GWT, and CoffeeScript with its new syntax. Hejlsberg's team took the opposite route.

By staying a strict superset, TypeScript kept compatibility with the entire JavaScript ecosystem, from npm packages to browser APIs. Its types are erased at compile time, so the output is ordinary JavaScript with no runtime library. The team also aligned with ECMAScript standards, implementing upcoming JavaScript features early instead of inventing incompatible ones. Declaration files (.d.ts) let developers describe existing JavaScript libraries with types, and the community DefinitelyTyped project grew into a huge collection of them.

Design and key features

  • Structural typing: two types are compatible if their shapes match, which fits how JavaScript code actually passes objects around.
  • Type inference and gradual typing, with any and unknown as escape hatches.
  • Union and intersection types, literal types and control-flow narrowing.
  • Generics, mapped types, conditional types and template literal types, which make the type system expressive enough to model complex APIs.
  • A language service that powers autocompletion and refactoring in VS Code and other editors.

A short TypeScript example

This snippet models success and failure as a discriminated union. The compiler narrows the type inside each branch:

type Result<T> =
  | { ok: true; value: T }
  | { ok: false; error: string };

function parseYear(input: string): Result<number> {
  const n = Number(input);
  return Number.isInteger(n) && n > 1940
    ? { ok: true, value: n }
    : { ok: false, error: `Not a valid year: ${input}` };
}

const r = parseYear("2012");
if (r.ok) {
  console.log(r.value + 1);
} else {
  console.error(r.error);
}

Where TypeScript is used

A major boost came when Google's Angular team chose TypeScript for Angular 2, announced in 2015, after merging its own AtScript plans into TypeScript. Since then TypeScript has become the default for serious frontend work in React, Vue, Svelte and Angular projects, and it is widely used on the server with Node.js, Deno and Bun. VS Code itself is written in TypeScript, as are large parts of products at Microsoft, Google, Slack, Airbnb and many others. GitHub's Octoverse reports have tracked TypeScript climbing to the top tier of languages on the platform.

Milestones

YearMilestone
2012TypeScript 0.8 announced
2014TypeScript 1.0 released; project moves to GitHub
2015Angular 2 adopts TypeScript
2016TypeScript 2.0 adds strict null checks
2024Node.js gains experimental support for running TypeScript by stripping types
2025Microsoft announces a native port of the compiler to Go

Limitations

TypeScript's types disappear at run time, so data from APIs or user input still needs validation; libraries like Zod exist largely to fill that gap. The type system is deliberately unsound in places to stay practical, and advanced types can become hard to read. On very large codebases the JavaScript-based compiler has been slow, which is why Microsoft announced in March 2025 that it was porting the compiler and language service to Go, reporting roughly tenfold speedups in early builds. That native compiler is planned as TypeScript 7.

Should you learn TypeScript?

If you write JavaScript professionally, yes. Most job listings for frontend and Node.js roles now expect it, and the editor support alone pays for the learning time. Understanding why Microsoft made TypeScript a superset of JavaScript also helps you use it well: treat it as a powerful layer of documentation and checking over JavaScript, not as a different language with its own runtime.

Frequently asked questions

Is TypeScript a separate language from JavaScript?

TypeScript is a superset of JavaScript, so it is best seen as JavaScript plus a type system. The compiler checks your types and then outputs normal JavaScript that runs in any browser or runtime.

Does TypeScript make code run faster?

No. Types are removed during compilation, so runtime performance is the same as equivalent JavaScript. The benefits are fewer bugs, safer refactoring and better editor tooling.

Who created TypeScript?

TypeScript was created at Microsoft by a team led by Anders Hejlsberg, who also designed C#. It is open source under the Apache 2 license and developed on GitHub.