title: JavaScript Descriptors: enumerable/configurable/writable are not true by default?
body: <p>I was reading one of John Resig's blogs on <a href="http://ejohn.org/blog/ecmascript-5-objects-and-properties/" rel="nofollow noreferrer">new ES5 features</a>, one being <code>Object</code> descriptors. Earlier in his blog, John writes: </p>
  
  <blockquote>
    <p>The three attributes (writable, enumerable, and configurable) are all
    optional and all default to true. Thus, the only property that you’ll
    need to provide will be, either, value or get and set.</p>
  </blockquote>
  
  <p>Later on he provides an example: </p>
  
  <pre><code>var obj = {};
  
  Object.defineProperty( obj, "propertyname", {
      value: true,
      writable: false,
      enumerable: true,
      configurable: true
  });
  
  (function() {
      var name = "John";
  
      Object.defineProperty( obj, "name", {
          get: function(){ return name; },
          set: function(value){ name = value; }
      });
  })();
  </code></pre>
  
  <p>However, when checking the property descriptor for <code>name</code>, it is not configurable or enumerable and consequently I am unable to access it in a for loop. </p>
  
  <pre><code>console.log(Object.getOwnPropertyDescriptor(obj, 'name'))
  &gt; Object {enumerable: false, configurable: false}
  </code></pre>
  
  <p>Shouldn't <code>name</code> be both enumerable and configurable? What am I missing here?</p>