Easy
In the following Node.js code, what will be the result?
const EventEmitter = require('events');
class MyEmitter extends EventEmitter {}
const myEmitter = new MyEmitter();
myEmitter.on('event', () => {
console.log('an event occurred!');
});
myEmitter.emit('event');
Edit
4
Community EvaluationsNo one has reviewed this question yet, be the first!
3
In which request header is a token usually sent?12
What is the best practice to apply in your code to improve the performance of your application?3
Which class is used to create custom events in Node.js?3
What is NPM?3
Install a NPM package via CLI3
What types of databases can a node.js application access?4
How to start a NodeJS server