Skip to main content
D
TypeScript
TypeScript Interfaces

TypeScript Interfaces

Interfaces define the strict shape of a JavaScript object.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

JavaScript objects hold multiple pieces of data. An Interface acts like a strict blueprint for an object. It guarantees that the object has exactly the right properties, and that each property holds the correct type of data.

Example

Example
1/* this creates an interface */
2interface User {
3  name: string;
4  age: number;
5}
6
7const player: User = {
8  name: "Bob",
9  age: 25
10};

Key Points

  • Interfaces start with a capital letter.
  • They define the names and types of object properties.
  • They prevent typos in property names.
  • They do not compile into the final JavaScript code.

Up Next

Continue your journey with the next topic.

Go to TS Type Aliases