手写一个 bind 方法
手写一个 bind 方法
/**
* 手写一个 bind 方法
* 函数名字为 myBind
*/
Function.prototype.myBind = function (targetObj, ...args) {
return (...argus) => this.call(targetObj, ...args, ...argus)
}
本文来自博客园,作者:jialiangzai,转载请注明原文链接:https://www.cnblogs.com/zsnhweb/articles/17764808.html

浙公网安备 33010602011771号