2023秋招前端面试必会的面试题发布订阅模式(事件总线)描述:实现一个发布订阅模式,拥有<codeon,emit,once,off</code方法<pre<codeclassEventEmitter{constructor(){//包含所有监听器函数