Need some help understanding this JavaScript
<p>I have the following strange looking code in a js file and i need some help in understanding whats going on. What im confused about is why is the whole thing put in paranthesis ?. What does that mean ?</p>

<pre><code>(function() {
  var someobj = window.someobj = [];
  var parentId = '#wrapper';

  $(document).ready(function() {
    //some code here
    });


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