title: Javascript: add methods to function prototype
body: <p>Is there a shorter way to write this: </p>
  
  <pre><code>var controller = function(){ 
      /*--- constructor ---*/
  }; 
  
  controller.prototype.function1 = function(){ 
      //Prototype method1
  }
  
  controller.prototype.function2 = function(){ 
      //Prototype method2
  }
  
  controller.prototype.function3 = function(){ 
      //Prototype method3
  } 
  
  return controller
  </code></pre>
  
  <p>I'm using require.js. I wondered if I can avoid the controller.prototype code repetition. </p>