title: Passing string parameter into constructor to call function
body: <p>I have come across this programming style where:
  Instead of calling an object method directly, they pass in its constructor method a string, the constructor method then check this string and call the function associate with it.</p>
  
  <pre><code>function MySimpleObject(option){
    if (typeof option === 'String'){
      pluginMethods[String].apply(this, arguments);
    }
    else {
      init();
    }
  }
  </code></pre>
  
  <p>This seem to be used with jQuery as extend function a lot.</p>
  
  <pre><code>jQuery.fn.extend({simpleObj: MySimpleObject});
  </code></pre>
  
  <p>I would really appreciate if someone could enlighten me on this.</p>