Command Palette

Search for a command to run...

Hectal
Phase 3: Type Aliases and Interfaces
TypeScript · Exercise 3 of 6 PreviousNext
Beginner

Build an Employee from Pieces

Person and Worker are small interfaces. Declare Employee so that it has everything from both, plus a number salary. Use extends.

The checks build an employee, pass it where a Person is expected, and expect an employee without a salary to be rejected.

What Check tests

  1. Your code has no type errors
  2. The console prints Asha works at Hectal
  3. Employee is declared with extends
  4. An employee can be used as a Person
  5. An employee without a salary is rejected

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Console

Nothing printed yet.