title: Concept of subclassing in JS without using class
body: <p>I am looking to learn about class inheritance and how it may be emulated without using the <code>class</code> keyword. It's just an academic/learning exercise.</p>
  <p>Does the following method work for doing class inheritance, or am I missing some core concepts?</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>function Person(name, age) {
      let person = Object.create(Person.prototype);
      person.name = name;
      person.age = age;
      return person;
  }
  Person.prototype.get_birth_year = function() {
      console.log(new Date().getFullYear() - this.age);
  }
  
  
  function Kid(name, age, dad, mom) {
      let kid = Object.create(Person.prototype);
      kid.dad = dad;
      kid.mom = mom;
      for (let key in Kid.prototype) {
          kid[key] = Kid.prototype[key];
      }
      return kid;
  }
  Kid.prototype.callMom = function() {
      console.log(`MOM!!! (${this.mom})`);
  }
  
  
  function KidToy(name, age, dad, mom, toyname) {
      let toy = Object.create(Kid.prototype);
      toy.toyname = toyname;
      for (let key in KidToy.prototype) {
          toy[key] = KidToy.prototype[key];
      }
      return toy;
  }
  KidToy.prototype.findToy = function() {
      console.log('Looking to find the', this.toyname);
  }
  
  let p = Person('Bob', 33);
  p.get_birth_year();
  let k = Kid('Billy', 12, 'Bob', 'Margot');
  k.callMom();
  let t = KidToy('Billy', 12, 'Bob', 'Margot', 'Potatohead');
  t.findToy();</code></pre>
  </div>
  </div>
  </p>
  <p>The only things I'm doing here to subclass are:</p>
  <ul>
  <li>Create an object with the parent prototype.</li>
  <li>Iterate through the current prototype and tack on those properties to the object.</li>
  </ul>
  <p>Or, am I missing some things?</p>