手写一个 bind 方法

手写一个 bind 方法
/**
 * 手写一个 bind 方法
 * 函数名字为 myBind
 */
Function.prototype.myBind = function (targetObj, ...args) {
  return (...argus) => this.call(targetObj, ...args, ...argus)
}
posted @ 2023-10-14 21:50  jialiangzai  阅读(34)  评论(0)    收藏  举报