迅雷前端的两道题目还是可以做的!!!不过第二题我不知道为啥一直不能通过...我测试是可以完全通过的~跟大家交流一下~ //第一道 EventEmitter类 class EventEmitter { on(event, fn) { this._callbacks = this._callbacks || {}; (this._callbacks['$' + event] = this._callbacks['$' + event] || []).push(fn); return this; } ...