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
- Your code has no type errors
- The console prints
Asha works at Hectal Employeeis declared withextends- An employee can be used as a
Person - 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.
Press Run to see the page.
Console
Nothing printed yet.