12. implement ReturnType<T>

TypeScript
Is this helpful ?

  - accepted / - tried

Similar to Parameters<T>, ReturnType<T>, as the name says itself, returns the return type of function type T.

Please implement MyReturnType<T> by yourself.

type Foo = () => {a: string}

type A = MyReturnType<Foo> // {a: string}

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

Discuss(5)