9. implement NonNullable<T>

TypeScript

  - 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 | undefinedtype A = MyNonNullable<Foo> // 'a' | 'b'

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