Using Self Calling Anonymous Functions and $(document).ready
<p>I just recently learned about self calling anonymous functions.  Some snippets of code that I came across used the self calling function along with the $(document).ready.  It seems redundant, or pointless, to use both.</p>

<p>Is there a case where you'd use</p>

<pre><code>(function(){
   $(document).ready();
})();
</code></pre>

<p>vs.</p>

<pre><code>$(document).ready(function(){
   (function(){})();
});
</code></pre>

<p>I figure that you'd either want the script to be executed right away or after the DOM loaded.  I can't see why you'd use both together.</p>

<p>Thanks.</p>
