Bootcamp
Search…
⌃K

4.3: TypeScript

Learning Objectives

  1. 1.
    TypeScript is a programming language and syntactic superset of JavaScript that adds optional static typing of variables
  2. 2.
    Static typing means every variable can only store values that adhere to a specific, pre-defined data type. This allows for more robust error checking prior to runtime, reducing bugs due to variables storing unexpected values

Introduction

TypeScript is a popular programming language and syntactic superset of JavaScript that adds optional static typing of variables. TypeScript is developed and maintained by Microsoft. Many companies large and small choose to use TypeScript over JavaScript today due to the robustness it provides over vanilla JavaScript. Static typing in TypeScript is also similar to typing in other common languages such as Java and Go.
Static typing means every variable needs to be declared with a specific data type, and cannot store values that do not adhere to that data type. While requiring more upfront effort to define the type of each variable, static typing can increase development speed in the long term by reducing bugs due to ambiguous typing of variables. Popular languages like Java and Go require static typing, and their robustness due to static typing is a large reason for their popularity.
Robert Kolsek, esteemed section leader at Rocket delivered this intro to TypeScript with hands-on examples during one of his classes. The majority of the video demonstrates type checking with TypeScript and how it yields benefits compared with vanilla JavaScript.
Introduction to TypeScript by Robert Kolsek, Rocket Academy Section Leader

Additional Resources

  1. 1.
    Official TypeScript Handbook with tutorials and walkthroughs of the most important TypeScript features for beginners