Beginner
Describe the Shape of a User
describe receives an object, but its parameter has no type. Give user an object type: a required name (text), a required age (number) and an optional email (text).
The checks pass valid and invalid objects to describe.
What Check tests
- Your code has no type errors
- The console prints
Asha (30) no email - An object with an email is accepted
- A user without an age is rejected
- An unknown property 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.