Complete the code to import the EventEmitter class from the 'events' module.
const [1] = require('events');
You import the EventEmitter class exactly as EventEmitter from the 'events' module.
Complete the code to create a new instance of EventEmitter.
const emitter = new [1]();You create a new EventEmitter instance by calling new EventEmitter().
Fix the error in the code to add a listener for the 'start' event.
emitter.[1]('start', () => { console.log('Started'); });
The correct method to add a listener is on. It listens for the event named 'start'.
Fill both blanks to emit the 'data' event with a message.
emitter.[1]('[2]', 'Hello World');
You use emit to send out the event named data with the message.
Fill all three blanks to create an EventEmitter, add a listener for 'end', and emit the 'end' event.
const [1] = new EventEmitter(); [1].[2]('end', () => { console.log('Finished'); }); [1].[3]('end');
You create an instance named emitter, use on to listen for 'end', and emit to trigger it.
