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
2
Community EvaluationsNo one has reviewed this question yet, be the first!
8
What is the best practice to apply in your code to improve the performance of your application?1
When creating an HTTP server with Node, we use the **createServer()** function. We can pass a function to **createServer()** that will react to incoming requests. What arguments does this function receive?4
How to start a NodeJS server2
Install a NPM package via CLI2
Which class is used to create custom events in Node.js?1
Start a REPL session on Node.js1
What does npm mean?