Beginner
A Value That May Be Missing
displayName should show a user's nickname in capital letters, or their real name in capital letters when they have no nickname. The first version crashes for users without a nickname, and strictNullChecks already points at the line.
Fix it without ! (the non-null assertion) so the console prints ASH and BO.
What Check tests
- Your code has no type errors
- The console prints
ASHandBO - A user with no name is rejected
- You did not use the
!assertion
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.