为了账号安全,请及时绑定邮箱和手机立即绑定

bind函数polyfill源码

bind函数polyfill源码

皈依舞 2018-10-03 13:27:58
Function.prototype.bind = Function.prototype.bind || function(oThis) {    var aArgs = Array.prototype.slice.call(arguments,1),        //由于bind是原型方法,fToBind指调用bind的函数对象        fToBind = this,        F = function(){},        fBound = function(){            //fBound若作为构造函数,则this就是fBound构造出来的对象            //构造函数中有return,若return的是标量,则忽略,return的是对象,则覆盖构造的实例            return fToBind.apply(this instanceof F ? this : oThis || this,aArgs.concat(Array.prototype.slice.call(arguments)))        };    F.prototype = fToBind.prototype;    fBound.prototype = new F();    return fBound;}其中的 this instanceOf F是什么意思,能举个例子说明吗,多谢?
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 423 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号