How are JavaScript and TypeScript related?

How are JavaScript and TypeScript related?

Published on Friday 16th October, 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.

Last updated on Tuesday 30th March, 2021.

More Posts about Learning