Skip to content

Interfaces

interface Person { name: string; age?: number }
const p: Person = { name: "Ada" };

Notes

  • Use readonly for immutability and ? for optional properties.