前端小结:javaScript - call() apply() bind() 简析
我们都知道,在javaScript中定义的函数最外层中如果有this对象,则this就指向函数调用者,例如:
const student = {
name: '赵六',
address: '杭州',
greeting: function() {
console.log(`我叫 ${this.name},来自 ${this.address}`);
},
};
stude...
原创
2018-10-09 17:17:36 ·
183 阅读 ·
0 评论