Interfaces
Defining the shape of objects (what fields, what types) and optional fields.
Simple enough for a 5-year-old to understand
Object shape with interface
You define what fields an object should have using an interface.
interface Person { name: string; age: number;}const k: Person = { name: "Alex", age: 36 };console.log(k.name);🎯 Exercise & Practice
Test what you've learned — answer, write code, check instantly. (1 left)
🎯 Expected output: 25