🔙 All posts

How are JavaScript and TypeScript related?


Planted October 16, 2020

TypeScript is a typed superset of JavaScript and, when compiled (or transpiled), emits pure JavaScript.

What’s that mean?

  • If there are no syntatic errors in your JS, it is valid TS
  • Migrating existing codebases can be done piece by piece
  • All JavaScript is TypeScript but not all TypeScript is JavaScript

All this means that you can (like I am) gradually learn TS and gradually add it to more of your projects. The typing will hopefully catch errors sooner - at compile time rather than run time - but it won’t necessarily catch every problem.

Like what you see?

I send out a (semi) regular newsletter which shares the latest from here and my reading from around the web. Sign up below.

    Your next read?