Difference between Events and Functions?
<p>I am new to Node, and I am struggling to understand the main difference between Events and Functions. Both need to be triggered, so why do we need an Event at all if we have to trigger it anyway?</p>

<p>How is it different than having a Function triggered?</p>

<p>Example code:</p>

<pre><code>var events = require('events');
var eventEmitter = new events.EventEmitter();

eventEmitter.on('event1', function () {
    console.log('Event 1 executed.');
    eventEmitter.emit('event2');
});

eventEmitter.on('event2', function() {
    console.log('Event 2 executed.');
});

eventEmitter.emit('event1');
console.log('Program Ended.');
</code></pre>

<p>We can achieve the same result by functions, right?</p>

<p>I am sure this has some serious importance in Node (otherwise it would not exist, lol), but I am struggling to understand it.</p>

<p>Help appreciated! :)</p>