title: Using `super()` when extending `Object`
body: <p>I'm creating a class that extends <code>Object</code> in JavaScript and expect <code>super()</code> to initialise the keys/values when constructing a new instance of this class.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class ExtObject extends Object {
    constructor(...args) {
      super(...args);
    }
  }
  
  const obj = new Object({foo:'bar'});
  console.log(obj); // { foo: 'bar' }
  
  const ext = new ExtObject({foo:'bar'});
  console.log(ext); // ExtObject {}
  
  console.log(ext.foo); // undefined</code></pre>
  </div>
  </div>
  </p>
  
  <p>Why isn't <code>foo</code> defined as <code>'bar'</code> on <code>ext</code> in this example? </p>
  
  <p><strong>EDIT</strong></p>
  
  <p><strong>Explanation</strong>: <a href="https://stackoverflow.com/questions/51439332/using-super-when-extending-object#answer-51443624">Using `super()` when extending `Object`</a></p>
  
  <p><strong>Solution</strong>: <a href="https://stackoverflow.com/questions/51439332/using-super-when-extending-object#answer-51439586">Using `super()` when extending `Object`</a></p>