title: overwrite object property Javascript
body: <p>I basically having hard times understanding why I cannot overwrite an object property when using inheritance from another object, it goes like this.</p>
  
  <pre><code>var Person = function(firstName, lastName) {
    this.firstName = firstName;
    this.lastName = lastName;
  };
  
  Object.defineProperties(Person.prototype, {
    sayHi : {
     value :function() {
       return "Hi there";
     },
     enumerable : true,
     writable : true
    },
   fullName : {
     get : function() {
      return this.firstName + " " + this.lastName;  
     },
     enumerable : true
    }                      
  });
  
  
  var createEmployee = function(firstName, lastName, ocupation) {
    var employee = new Person(firstName, lastName);
    employee.ocupation = ocupation;  
  
   Object.defineProperty(employee, "sayHi", {
     sayHi : {
      value : function() {
       return "Hey I am " + this.firstName;
      }
     }
   });
  
   return employee;
  };
  
  var janeDoe = createEmployee('Jane', 'Doe', 'Actress');
  </code></pre>
  
  <p>So, accoding to what I understand, I should overwrite the sayHi property on the employee object, however, I get it as undefined.</p>
  
  <p>Could please some1 show me money?</p>
  
  <p>here is the <a href="http://jsfiddle.net/andresmijares/jzMGu/" rel="nofollow" title="fiddle">jsfiddle</a></p>
  
  <p>Best Regards.</p>