1.

What is the difference between events and callbacks in Node.js?

Answer»

ALTHOUGH Events and CALLBACKS appear to be the same, the difference is that CALLBACK functions are invoked when an ASYNCHRONOUS function delivers a result, whereas event handling uses the observer pattern. When an event is fired, the listener function begins to run. The events module and the EVENTEMITTER class, which are used to bind events and event listeners, provide a number of built-in events in Node.js.



Discussion

No Comment Found