13. implement InstanceType<T>

TypeScript
Is this helpful ?

  - accepted / - tried

For a constructor function type T, InstanceType<T> returns the instance type.

Please implement MyInstanceType<T> by yourself.

class Foo {}
type A = MyInstanceType<typeof Foo> // Foo
type B = MyInstanceType<() => string> // Error

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

Discuss(4)