Advanced
Challenge: Includes and MyAwaited
Write Includes<T, U>: true if the tuple T has an element that is exactly U, else false. Includes<[boolean], true> must be false (the element is boolean, not true).
Write MyAwaited<T>: unwrap nested promises, so MyAwaited<Promise<Promise<string>>> is string, and a non-promise like number stays number.
What Check tests
- Your code has no type errors
- Includes is false for an empty tuple
- Includes finds the last element
- MyAwaited leaves a plain value alone
- A wrong expectation 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.