title: Issue While Prototyping In javascript
body: <pre><code>var Greeter = (function () {
      function Greeter(message) {
          this.greeting = message;
      }
      Greeter.prototype.greet = function () {
          return "Hello, " + this.greeting;
      };
      return Greeter;
  })();
  
  var Greeting = (function(){
      Greeting.prototype = new Greeter();        
      Greeting.prototype.constructor = Greeter;
      function Greeting(greeting){
      } 
      return Greeting;
  })();
  
  
  
  var greeting = new Greeting("World");
  alert(greeting.greet());
  </code></pre>
  
  <p>I'm trying to manipulate inheritance using javascript prototyping. I have a class structure like above. But when I call the greet method it display some thing like the below image shows. Can anybody guid me on this ?</p>
  
  <p><img src="https://i.stack.imgur.com/xJcfq.png" alt="enter image description here"></p>