9. implement NonNullable<T>

TypeScript
Is this helpful ?

from all members: - accepted / - tried

NonNullable<T> returns a type by excluding null and undefined from T.

Please implement MyNonNullable<T> by yourself.

type Foo = 'a' | 'b' | null | undefined

type A = MyNonNullable<Foo> // 'a' | 'b'

Let's try to solve this problem within 5 mintues.

Discuss(5)