TypeScript

TypeScript is a strongly-typed superset of JavaScript developed by Microsoft in 2012. It compiles to plain JavaScript.

Why TypeScript?

History

TypeScript was created by Anders Hejlsberg (also creator of C#) and released by Microsoft in 2012. It became the language of choice for Angular 2+ and is now widely used with React/React Native.

TypeScript vs JavaScript

// JavaScript
function add(a, b) {
  return a + b
}
add('1', 2) // '12' — silent bug!

// TypeScript
function add(a: number, b: number): number {
  return a + b
}
add('1', 2) // Error at compile time!

Key Features