Beginner
Merge two interfaces
Account is declared once with id. The code below creates an account with a balance too, which the checker rejects.
Without editing the first declaration, add a second interface Account that adds balance: number. Interfaces with the same name merge. The program must print balance: 50.
What Check tests
- Your code has no type errors
- The program prints balance: 50
- An Account without a balance is rejected
- An Account with both members is accepted
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.