Frontend Developer Roadmap
Step 7 / 18120 min

TypeScript

Programming Essentials

Explanation

TypeScript adds static types to JavaScript so you catch bugs earlier and write clearer APIs.

Code example

typescript
type User = {
  id: string;
  name: string;
  email: string;
};

function greet(user: User): string {
  return `Hello, ${user.name}`;
}

const learner: User = {
  id: "1",
  name: "Amina",
  email: "amina@example.com",
};

console.log(greet(learner));

Exercise

Convert a small JavaScript utility file to TypeScript with typed functions and interfaces.