After working exclusively with TypeScript for 3.5 years, I had a chance to work on a project that uses JavaScript.

Here are some points that I noted about why I prefer working with TypeScript.

  • Refactoring becomes much faster and easier
  • Make changes with more confidence
  • Helps new team members dive quicker
  • Serves as documentation and makes code more comprehensible
  • Diminishes psychological overhead by showing the I/O of different code parts
  • Faster development iteration by catching small mistakes, typos and bugs before running the app
  • More predictable and robust code
  • Better autocomplete and IDE support

Of course there are some downsides as in all things, but for me personally the pros outweigh the cons, especially in large code-bases with multiple team members.