Exploring the TypeScript Challenge, there is a particular problem known as IsNever. The task at hand is to create a type called IsNever that takes input of type T. If the resolved type equates to never, the output should be true; otherwise, it should be false.
type A = IsNever<never> expected result: true
type B = IsNever<undefined> expected result: false
type C = IsNever<null> expected result: false
type D = IsNever<[]> expected result: false
type E = IsNever<number> expected result: false
Here is my solution (which turned out to be incorrect):
type IsNever<T> = T extends never ? true : false;
An alternative solution proposed:
type IsNever<T> = [T] extends [never] ? true: false;
What sets these two solutions apart? I am curious about the distinctions in comparing types with tuples.