Type aliases

type City = ...

type City = string names a synonym. Prefer unions for cities.

Goal

Alias City and log it.

type City = string;
const city: City = "Nairobi";
console.log(city);
type Sale = { city: string; units: number };
const row: Sale = { city: "Mombasa", units: 8 };
console.log(row.units);
type Id = number;
const id: Id = 1;
console.log(id);
type Label = `Kiosk in ${string}`;
const label: Label = "Kiosk in Kisumu";
console.log(label);