Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Learn how to unleash the full potential of the type system of TypeScript. Parent comment
type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends < T >() => T extends Y ? 1 : 2 ? true : false;
Understanding this requires a bit more context, but I'll explain why we need something so complicated in the Advanced Union Types chapter :)
I picked it from https://github.com/type-challenges/type-challenges which is an awesome resource too
There are no comments on this comment yet.
type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends < T >() => T extends Y ? 1 : 2 ? true : false;
Understanding this requires a bit more context, but I'll explain why we need something so complicated in the Advanced Union Types chapter :)
I picked it from https://github.com/type-challenges/type-challenges which is an awesome resource too