📜  用于应用的 polyfill - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:15.749000             🧑  作者: Mango

代码示例1
Function.prototype.myCall = function (...args) {
  let obj = args[0]
  const params = args.slice(1)

  obj = {
    ...obj,
    fn: this
  }

  return obj.fn(params)
}