03 2022 档案

摘要:https://juejin.cn/post/6844903887464300552 阅读全文
posted @ 2022-03-11 22:45 我是前端QQ942031558 阅读(10) 评论(0) 推荐(0) 编辑
摘要:1. 实现一个call函数 // 思路:将要改变this指向的方法挂到目标this上执行并返回 Function.prototype.mycall = function (context) { if (typeof this !== 'function') { throw new TypeError 阅读全文
posted @ 2022-03-11 10:52 我是前端QQ942031558 阅读(38) 评论(0) 推荐(0) 编辑
摘要:// 发布订阅Pub/Sub class EventBus { constructor() { // 1.处理事件对应的处理函数 this.sub = {} } $on(event,fn) { if(!this.sub[event]) { this.sub[event] = [] } this.su 阅读全文
posted @ 2022-03-02 10:53 我是前端QQ942031558 阅读(89) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示