I_Jemin

Arrow Function

Showing 1 changed file with 1 additions and 1 deletions
...@@ -2,7 +2,7 @@ const EventEmitter = require('events'); ...@@ -2,7 +2,7 @@ const EventEmitter = require('events');
2 const emitter = new EventEmitter(); 2 const emitter = new EventEmitter();
3 3
4 // Register a listener 4 // Register a listener
5 -emitter.on('messageLogged', function(arg) { // e, eventArg 5 +emitter.on('messageLogged', (arg) => {
6 console.log('Listener called',arg); 6 console.log('Listener called',arg);
7 }); 7 });
8 8
......