15. OmitThisParameter<T> を実装する

  - accepted / - tried

Function.prototype.bind()を使うと、thisは固定される。 こういうケースのため、OmitThisParameter<T>を使うと良い。

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)