Dynamically Create Javascript Classes

  2014-08-12


Problem

Recently, I was asked to think of a way to dynamically create classes, which have static methods that are slightly different among dynamically created classes.

Solution

I used a factory-like function to generate class with a static method that closes on the parameter name.