How can jquery $ act as an object as well as a function in javascript?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8734115/how-can-jquery-behave-like-an-object-and-a-function">How can jQuery behave like an object and a function?</a>  </p>
</blockquote>



<p>In jquery we can use $ as a function as well as a namespace. for example both of these use-cases are valid.  </p>

<ol>
<li><code>$("div").html("&lt;b&gt;Wow!&lt;/b&gt; Such excitement...");</code>  </li>
<li><code>var trimmed = $.trim(someString);</code></li>
</ol>

<p>How can one identifier $ act as an <strong>object</strong> as well as a <strong>function</strong> at the same time? </p>
