Creating Custom Types in TypeScript

JavaScript is a weakly typed language, which means we don't usually think about types. Typescript is strongly typed, which means everything has a type.

Occasionally we want to make an object or the return of a function conform to a certain format. This is where we use custom types. Typescript allows us to define our own custom types, which we can then use in our code.