title: What is the purpose of $.fn.foo.Constructor = Foo in Twitter Bootstrap JS
body: <p>All of the jQuery plugins for Twitter Bootstrap follow the same basic pattern of defining a class that controls the behavior of the plugin. Near the end, they do this:</p>
  
  <pre><code>$.fn.alert.Constructor = Alert
  </code></pre>
  
  <p>What is this doing?</p>
  
  <p>I assume that this is defining a prototype constructor, but they use an uppercase C. Does case not matter here? Beyond that, I don't really understand what this is doing and how it's getting used by the plugin.</p>
  
  <p>As an example, here is the Alert plugin:
  <a href="https://github.com/twitter/bootstrap/blob/master/js/bootstrap-alert.js">https://github.com/twitter/bootstrap/blob/master/js/bootstrap-alert.js</a></p>