title: Destructure a nested object, but keep a reference to the nested object
body: <p>I have a simple use-case, but I think it's not possible with ES6 syntax. I'd like to use object destructuring to retrieve certain known properties from a nested object, but I'd also like a reference to that nested object so that I can pass it along to other functions which may care about other properties.</p>
  
  <p>Here's an example object:</p>
  
  <pre><code>var record = {
      name: "foo",
      metadata: {
          createdDate: "2017-02-19",
          lastModifiedDate: "2018-07-24",
          type: "bar"
      }
  };
  </code></pre>
  
  <p>At a certain point in my code, I'd like to extract some values from the metadata. At the same time, I'd also like to extract the entire metadata object:</p>
  
  <pre><code>let {
      metadata: {
          createdDate
      }
  } = record;
  
  if ( date( createdDate ).before( NEW_FEATURE_DATE ) ){
      oldFeature( metadata );
  } else {
      newFeature( metadata );
  }
  </code></pre>
  
  <p>Unfortunately, my reference to the <code>metadata</code> property is used purely for destructuring... it's value is <code>undefined</code> (technically, being undefined, it has no value).</p>
  
  <p>I know I can solve this with something like</p>
  
  <pre><code>let {
          metadata: {
              createdDate
          }
      } = record,
      metadata = record.metadata;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>let {
          metadata
      } = record,
      {
          createdDate
      } = metadata;
  </code></pre>
  
  <p>... but that seems kind of clumsy, doesn't it? Is there something I'm missing, or is this just a "gap" in the syntax?</p>