Interfaces
Interfaces
Section titled “Interfaces”interface Person { name: string; age?: number }const p: Person = { name: "Ada" };Notes
- Use
readonlyfor immutability and?for optional properties.
interface Person { name: string; age?: number }const p: Person = { name: "Ada" };Notes
readonly for immutability and ? for optional properties.