title: Anyone know an eloquent way to make a constructor constructor?
body: <p>I'm trying to tackle this from the command line: Is there an elegant way to use a constructor to create constructors with parameters named via arguments provided to the first constructor?
  Let's say we want a constructor for groupings of animals. The grouping constructor takes arguments that name any parameters the new constructor will take. The new constructor is named with a variable assignment. Then in the new constructor we can set those parameters as properties on an object (previously named with our variable assignment). I would expect that functionality to look a little something like this:</p>
  
  <pre><code>var herd = new grouping("species", "color", "cattle");
  var school = new grouping("species", "color", "dolphins");
  console.log(new herd(20, "Angus", "black"));
  herd({
    cattle: 20,
    species: "Angus",
    color: "black"
  })
  console.log(new school(2, "Bottlenose", "grey"))
  school({
    dolphins: 2,
    species: "Bottlenose",
    color: "grey"
  })
  </code></pre>
  
  <p>In the searching I've done on "constructor constructors", "dynamic function name assignment", and "dynamic javascript constructor", it seems to me this is unavoidably messy. If so, does that makes this an instance to forget DRY?</p>