03 2022 档案
摘要:https://juejin.cn/post/6844903887464300552
阅读全文
摘要:1. 实现一个call函数 // 思路:将要改变this指向的方法挂到目标this上执行并返回 Function.prototype.mycall = function (context) { if (typeof this !== 'function') { throw new TypeError
阅读全文
摘要:// 发布订阅Pub/Sub class EventBus { constructor() { // 1.处理事件对应的处理函数 this.sub = {} } $on(event,fn) { if(!this.sub[event]) { this.sub[event] = [] } this.su
阅读全文