title: javascript prototype method returns a string value
body: <p>While learning about object prototypes, I encountered the below example.</p>
  
  <pre><code>function Person(first, last, age, eye) {
    this.firstName = first;
    this.lastName = last;
    this.age = age;
    this.eyeColor = eye;
  }
  
  Person.prototype.name = function() {
    return this.firstName + " " + this.lastName
  };
  
  var myFather = new Person("John", "Doe", 50, "blue");
  alert(myFather.name);
  </code></pre>
  
  <p>When I tried to run via browser using html page, the following alert message popped up.</p>
  
  <pre><code>function() {
    return this.firstName + " " + this.lastName
  }
  </code></pre>
  
  <p>So, instead of returning 'John Doe', it returns the entire function as a string.
  How to resolve this?</p>
  
  <p>PS: I use VS Code, and i use node.js live-server to run in browser.</p>