🟦 TypeScript Interfaces

An interface in TypeScript defines the shape of an object β€” the properties and their types β€” without creating actual implementation.

πŸ“š Example Code: Defining & Using an Interface

Console output will appear here...
πŸ’‘ Interfaces are purely for type-checking at compile time β€” they don’t exist in the compiled JavaScript.

πŸ”§ Interface Syntax

πŸ“‘ Extending Interfaces

interface Admin extends User {
  role: string;
}

const admin1: Admin = {
  name: "Jamie",
  age: 30,
  isActive: true,
  role: "Moderator"
};
  
⚑ Interfaces are perfect for structuring data models and making your TypeScript code safer and scalable.