title: What is Event Emitter Call?
body: <p>I am learning Node Js. I have encountered a snippet of code in my book that stated as follow:</p>
  
  <pre><code>var EventEmitter = require("events").EventEmitter;
  var inherits = require('util').inherits;
  
  //Custom class
  function Foo(){
     EventEmitter.call(this);
  }
  inherits(Foo, EventEmitter);
  
  Foo.prototype.connect = function(){
      this.emit('connected');
  }
  
  var foo = new Foo();
  foo.on('connected', function(){
      console.log("connected raised!');
  }
  
  foo.connect();
  </code></pre>
  
  <p>My question is that what is "call" here do? Why does the class Foo inherits from EventEmitter? Does that mean that Foo is a child of Event Emitter? If so whu must it be a child of the EventEmitter? I have found another question in Stackoverflow regarding the call (<a href="https://stackoverflow.com/questions/15040717/what-does-eventemitter-call-do">What does EventEmitter.call() do?</a>) However, I did not understand the answer provided... Thanks</p>
  
  <p>Source of the code: Beginning Node.js by Basarat Ali Syed</p>