-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Description
url:https://elemefe.github.io/node-interview/#/sections/zh-cn/event-async
Events 中
有下面的描述
以及这样会不会死循环?
const EventEmitter = require('events');
let emitter = new EventEmitter();
emitter.on('myEvent', function sth () {
// 下面的代码是不是写错了?应该是 emitter.emit('myEvent')吧
emitter.on('myEvent', sth);
console.log('hi');
});
emitter.emit('myEvent');能否再进一步解释一下,两种事件触发有啥区别?
Metadata
Metadata
Assignees
Labels
No labels