<!DOCTYPE html><html><head><meta charset="utf-8"><title></title><script src="./call2.js"></script><script src="./apply2.js"></script><script src="./bind2.js"></script></head><body><script>// function add(a,b) {// console.log('this',this);// return a+b+this.c// }// let obj = {// c: 5// }// window.c = 3// console.log(call(add, obj, 10,20));// console.log(call(add, null, 10,20));function add(a, b) {console.log('add-this', this, arguments);return a + b + this.c}let obj = {c: 5}window.c = 3// console.log('apply', apply(add, obj, [10, 20]));// console.log('apply', apply(add, null, [10, 20]));console.log('bind', bind(add, obj, 10, 20)(66));// 也可以在返回函数调用时传参console.log('bind', bind(add, obj,)(10, 20));console.log('bind', bind(add, null, )(10, 20));</script></body></html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。