All academies
All challenges

Interface Inheritance

mediuminterfaces100 XP

Problem

Define an interface Person with a name (string), and an interface Employee that extends Person with salary (number) and department (string). Write raiseSalary(employee: Employee, percent: number): Employee that returns a NEW employee object with the salary increased by the given percent, leaving the original untouched.

Expected output

Ada now earns 110000
Engineering

Hints

Stuck? Reveal hints one at a time.

Solution

Try solving it yourself first — revealing is always available.

Press Run in the editor — your console output is checked automatically.
No errors
Loading...

Console output appears here. Press Run or just type — the code compiles automatically.