15. 实现OmitThisParameter<T>

  -通过 / -执行

Function.prototype.bind()返回一个this已经bind过后的function。 对于这种情况,可以用OmitThisParameter<T>来增加type信息。

请自行实现MyOmitThisParameter<T>

function foo(this: {a: string}) {}
foo() // Error

const bar = foo.bind({a: 'BFE.dev'})
bar() // OK


type Foo = (this: {a: string}) => string
type Bar = MyOmitThisParameter<Foo> // () => string

争取5分钟以内搞定这个问题

(1)
(24)