title: Design question: Polymorphism in javascript
body: <p>I'm trying to design an easily extendable form system in javascript, but am having some issues laying it out. </p>
  
  <p>Imagine a web form where you could fill in recipes, put them in some order, and then submit them for a chef to cook.  Then, let's say you have 3 classes of recipes: salad, appetizers, and main course. Obviously each form will have a different number of fields and different forms.</p>
  
  <p>What I'm trying to do is have one overall form manager that essentially takes in a base class Recipes and calls various things on it, like .saveForm(), .fillForm(), or createNewForm() but I'd like each of these things to be implemented in the derived classes.  </p>
  
  <p>What is the best way to go about implementing this OO structure in Javascript? Or is this not the correct way to do it? After writing a bit of code, I found myself assigning my own types and constantly doing manual type checking, but this makes it harder to extend.</p>