Understanding what appears to be an instantiation of a method
<p>I am currently trying to understand how well regarded lightbox, ColorBox, works so that I can attempt to make a development to it. However I am struggling with a couple of concepts within the code. The following is where I am stuck:</p>

<p>I have the following function being declared:</p>

<pre><code>publicMethod = function() {…}
</code></pre>

<p>Then after all that this function:</p>

<pre><code>publicMethod.init = function() {…}
</code></pre>

<p>And finally at the end of the script the following command is run:</p>

<pre><code>$(publicMethod.init);
</code></pre>

<p>Now I am not 100% sure what this last command is doing, I assume it is instanciating the method. But I would assume that you should be able to do that by just doing:</p>

<p>publicMethod.init;</p>

<p>Why is it wrapped inside a jQuery parentheses? What is the result of this?</p>

<p>Also, if I am correct in saying that it is instanciating <code>publicMethod.init</code>, does that mean that <code>publicMethod</code> is being instanciated first before <code>publicMethod.init</code>?</p>
