title: Update prototype property in JavaScript
body: <p>I'm trying to implement prototypal inheritance but I'm not understanding it's behavior. </p>
  
  <p>Consider the following example:</p>
  
  <pre><code>var config = {
    writable: true,
    enumerable: true,
    configurable: true
  };
  
  var defineProperty = function( obj, name, value ) {
    config.value = value;
    Object.defineProperty( obj, name, config );
  }
  
  var man = Object.create( null );
  defineProperty( man, 'sex', 'male' );
  
  var yehuda = Object.create( man );
  defineProperty( yehuda, 'firstName', 'Yehuda' );
  defineProperty( yehuda, 'lastName', 'Katz' );
  </code></pre>
  
  <p>When I access to <code>yehuda.sex</code> returns <code>male</code> which is correct, but when I try to update the value what actually happens it's the creation of a new property <code>sex</code> on <code>yehuda</code>.</p>
  
  <p>One possible solution is to access directly the prototype property (<code>Object.getPrototypeOf(yehuda).sex = 'female'</code>) but that implies that I need to know the property to which object belongs.</p>