Advanced
Typed Handler Names
Write Handler<E> that turns an event name such as "click" into the handler name "onClick", using a template literal type and Capitalize.
It must work for a union too: Handler<"click" | "hover"> is "onClick" | "onHover".
What Check tests
- Your code has no type errors
- "onClick" is accepted
- "onclick" is rejected
- A union gives both names
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.