call、bind、apply二刷

55 阅读1分钟

1、call

call(obj,str1,str2)/call(obj,...params)

A.call(B,obj)目的: this指向B,obj作为A的参数及A(obj)

2、bind

bind(obj,str1,str2) 返回的是一个数组

3、apply

apply(obj,[])