title: How to document a function generator with jsdoc?
body: <p>I am trying to document a function generator but without success, this is an example:</p>
  
  <pre><code>function genericObjectGenerator(tagname) {
    var specificObject = function () {};
  
    specificObject.getClassName = function () {
      return tagname;
    }
  
    specificObject.prototype.sayHello = function(name) {
      return tagname + " says hello to " + name;
    }
  
    return specificObject;
  }
  
  var MyObject = genericObjectGenerator("object1");
  
  var myObjectInstance = new MyObject();
  
  myObjectInstance.sayHello();
  </code></pre>
  
  <p>How should i document the genericObjectGenerator and its specificObject functions in order to get JSDoc (and IntelliJ) to resolve the sayHello properly.</p>