title: Encapsulation in JavaScript
body: <p>A long time ago, I saw someone encapsulate their entire JavaScript block with code something like the code below:</p>
  
  <pre><code>(function() {
    // ...
  })(this);
  </code></pre>
  
  <p>Questions:</p>
  
  <ol>
  <li>Is the code above correct?</li>
  <li>What benefit is there to encapsulating the entire JavaScript block like denoted above?</li>
  </ol>