手写call,apply和bind函数 Travis_0_0 2023-12-19 83 阅读1分钟 手写call方法: 手写apply方法: 手写bind方法: 其中返回函数里的this由于是箭头函数没有this,回去上层作用域找this,上层作用域的this也就是mybind函数的this,mybind的this是指向调用者也就是func.myBind ,也即是func,所以myBind返回的函数的this就是func,然后将func的this通过call换为person对象。