TypeError: “listener” argument must be a function Error in node js eventemitter

By | November 16, 2017

while executing the above code it is thowing error-TypeError: “listener” argument must be a function

Solution:this is because of the code executing sequence.if we use emit() function at the bottom, then eventemitter.on() and other function should be above.