title: Object vs. function prototype properties - which should predominate?
body: <p>I have the following code:</p>
  
  <pre class="lang-js prettyprint-override"><code>Object.defineProperty(Object.prototype, 'json', {
      configurable: true, enumerable: false, writable: true,
      value: function() { return 'Object.json' }
  });
  function Body() {
      return 1
  }
  Object.defineProperty(Body.prototype, 'json', {
      configurable: true, enumerable: false, writable: true,
      value: function() { return 'Body.json' }
  });
  console.log(Body.json())
  </code></pre>
  
  <p>which, when I run I get an unexpected result:</p>
  
  <blockquote>
    <p>Object.json</p>
  </blockquote>
  
  <p>I gather that a function is an object, in the loosest sense of the word (because <code>typeof</code> will return different values) and that therefore, functions may inherit from objects, but if a function is derived from object, I would expect its properties to override or hide those of the base class.  yet, the result shows otherwise</p>
  
  <p>how can this be and how can I get the property defined on the function to override that defined on object?</p>