- Preparing search index...
- The search index is not available
pgul
- addMethod<T>(obj: T, prop: string, methodFunc: ((this: T, ...args: any) => any)): void
-
Parameters
-
obj: T
-
prop: string
-
methodFunc: ((this: T, ...args: any) => any)
-
- (this: T, ...args: any): any
-
Parameters
-
this: T
-
Rest
...args: any
Returns any
Returns void
thisの型参照を残しながら任意のメソッドを拡張する
Foo.prototype[methodName] = function (){...}
とほぼ同等