Learn TypeScript

Introduction

Introduction

Using Types in TypeScript

A type is a representation of a value we use in our program. Types do exist in JavaScript, and we will learn about these in the first lesson. TypeScript adds a very rich type system on top of the types that JavaScript provides.

We learned in the last chapter that types enhance code quality and understandability. It’s much more efficient for the TypeScript compiler to catch errors than to have things fail at runtime. Types also inform the developer about the values a program is expected to deal with without running the code.

In this module we will learn how to explicitly declare types on variables with type annotations before understanding how TypeScript can cleverly infer types.

In this module we will cover:

© 2023 Carl Rippon
Privacy Policy
This site uses cookies. Click here to find out more