Type aliases let you create custom names for types. Unions let a variable accept multiple possible types.
// Type alias - give a name to a type
type UserID = number;
type Email = string;
// Union - can be either type
type ID = string | number;
// Using them
let userId: UserID = 123;
let email: Email = "user@example.com";
let id: ID = "abc123"; // Can be string
let id2: ID = 456; // Or number