- call(), apply() 都是立即調(diào)用了對(duì)應(yīng)的函數(shù)村刨,而 bind() 會(huì)生成一個(gè)新的函數(shù),
- bind() 生成的新函數(shù)返回后打洼,你想什么時(shí)候調(diào)就什么時(shí)候調(diào)
const m = {
'x': 1
};
function foo(y) {
console.log(this.x + y);
}
foo.apply(m, [5]);
foo.call(m, 5);
const foo1 = foo.bind(m, 5);
foo1();