(method) Function.call(this: Function, thisArg: any, ...argArray: any[]): any
Calls a method of an object, substituting another object for the current object. // 引用一个对象的方法,把那个对象替换为当前对象(传进来的那个)
@param thisArg — The object to be used as the current object.
@param argArray — A list ofarguments to be passed to the method.
apply:
1 2 3 4 5 6
(method) Function.apply(this: Function, thisArg: any, argArray?: any): any Calls the function, substituting the specified object for the this value of the function, and the specified array for the argumentsof the function. // 引用函数值,替换函数的this 为指定的对象。指定数组作为函数的参数
@param thisArg — The object to be used as the this object.
@param argArray — A set ofarguments to be passed to the function.
bind:
1 2 3 4 5 6
(method) Function.bind(this: Function, thisArg: any, ...argArray: any[]): any For a given function, creates a bound function that has the same body as the original function. Thethis object of the bound function is associated with the specified object, and has the specified initial parameters. // 对于被给定的函数,创建一个和原始函数有相同主体的绑定了的函数,这个绑定了的函数和指定的对象相关联,有着明确的初始化参数。
@paramthisArg — An object to which the this keyword can refer inside the newfunction.
@paramargArray — A list ofarguments to be passed to the newfunction.