SOURCE

class EventEmitter {
  // 实现代码
}

function test(a) {
  console.log(a);
}
const event = new EventEmitter();

event.on("test", test);// 1
event.on("test", test);// 1
event.on("test", test);// 1
event.emit("test", 1);
console 命令行工具 X clear

                    
>
console