call,apply和bind之間的共同點(diǎn)是都可以改變this指向
語法如下:
```
var?obj?=?{
????????????name:'zhangsan',
????????????say:function(str,str2){
????????????????console.log(this.name+'?'+str+'?'+str2)??//?this??{name:'李四'}
????????????}
????????}
//?obj.say('hello')
????????//?obj.say.call({name:'李四'},'hello','world');//?obj.say?函數(shù)中的?this?變成了{(lán)name:'李四'}
????????//?obj.say.apply({name:'李四'},['hello','world'])
????????//obj.say.bind({name:'李四'},'hello','world');
???????var?f?=??obj.say.bind({name:'李四'},'hello','world');
???????f();
```
但是他們也有不同點(diǎn):
1.apply的第二個(gè)參數(shù)是一個(gè)數(shù)組?
2.bind需要二次調(diào)用