15. implement OmitThisParameter<T>
Share
- accepted / - tried
When Function.prototype.bind() is used, the returned function has a bound this.
OmitThisParameter<T> could be used to type this.
Please implement MyOmitThisParameter<T> by yourself.
function foo(this: {a: string}) {}foo() // Errorconst bar = foo.bind({a: 'BFE.dev'})bar() // OKtype Foo = (this: {a: string}) => stringtype Bar = MyOmitThisParameter<Foo> // () => string