title: javascript type error "is not a constructor"
body: <p>I have several classes for representing different types of tables. I put names of classes to the dictionary. I take class name from the dictionary by key and try to create instance of class by using construction "new var_with_class_name()" but get an error "TypeError: dictionary[model_name] is not a constructor". 
  This code is packed as require.js module. 
  Code: </p>
  
  <pre><code>define("models", ["jquery", "ui"], function($, ui){
  
  var TimeTableRow = function()
  { /* class methods definitions */ }
  var WayTableRow = function()
  { /* ... */ }
  var ModelsDictionary = function()
  {
     var self = this;
     self.getModel = function(model_name)
     {
        var dictionary = {'time':"TimeTableRow", 'way':"WayTableRow"};
        return new dictionary[model_name]();
     }
  }
  return new ModelsDictionary();
  });
  </code></pre>
  
  <p>Example of usage from another require.js module (I skip all requirejs configs and imports, just line of code that throws described error):
      <code>var tableRow = models.getModel(item_type);</code></p>