call、apply 和 bind 是挂在 Function 对象上的三个方法,调用这三个方法的必须是一个函数。 func.call(thisArg, param1, param2, ...) func.apply(thisArg, [param1,param2,...]) func.bind(thisArg, param1, param2, ...) 在浏览器里,在全局范围内this 指向window对象; 在函数中,this永远指向最后调用他的那个对象; 构造函数中,this指向new出来的那个新的对象; call、apply、bind中的this被强绑定在指定的那个对象上; 箭头函数中this比较特殊,箭头函数this为父作用域的this,不是调用时的this.要知道前四种方式,都是调用时确定,也就是动态的,而箭头函数的this指向是静态的,声明的时候就确定了下来; apply、call、bind都是js给函数内置的一些API,调用他们可以为函数指定this的执行,同时也可以传参。 let a = { value: 1 } function getValue(name, age) { console.log(name) console.log(age) console.log(this.value) } getValue.call(a, 'poe', '24') getValue.apply(a, ['poe', '