Intermediate
Make the type tests pass
The file has Equal, Expect and three type tests for a helper type IsString<T>. The helper is a stub that always says false, so two tests fail.
Write IsString<T> so IsString<"a"> is true, IsString<1> is false, and IsString<string | number> is false (a union containing a non-string is not a string).
What Check tests
- Your code has no type errors
- Plain string is true
- A wrong expectation fails
- A union with a non-string is false
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.