Programming languages · Comparison

JavaScript vs TypeScript

TypeScript is JavaScript with a type checker on top, so this is less a choice between languages than a choice of how much the tools check for you before the code runs.

2 options · 8 questions side by side · updated

CompareJavaScriptTypeScript
What it isThe language browsers runJavaScript plus types, compiled to JavaScript
TypesDynamic, checked as the code runsStatic, checked before the code runs
SetupNone, runs as writtenA compiler or a tool that strips types
Mistakes caughtAt run time, sometimes by usersIn the editor and at build time
Editor helpAutocomplete based on guessesPrecise autocomplete and safe renames
Learning curveGentler startMore to learn: types, generics, config
Runs in the browserDirectlyAfter the types are removed
Best forSmall scripts and quick experimentsApps that grow and code shared by a team

How to choose between JavaScript and TypeScript

  • Pick JavaScript for small scripts, quick experiments and pages with a little interactivity.
  • Pick TypeScript for anything that will grow, be shared by a team or be maintained for years.
  • TypeScript accepts plain JavaScript, so a project can move over one file at a time.

The options

More comparisons

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.