title: Javascript create new object from class name in string
body: <p>I've got this little bit of non working code:</p>
  
  <pre><code>PackageLoader.prototype.activate = function(name) {
      this.activePackages.push(new name());
  }
  </code></pre>
  
  <p>What I'd like this to do is to push a new instance to the activePackages array, if the name it gets is a string. How to achieve this?</p>