title: What does the leading semicolon in JavaScript libraries do?
body: <p>In several JavaScript libraries I saw this notation at the very beginning:</p>
  
  <pre><code>/**
   * Library XYZ
   */
  ;(function () {
    // ... and so on
  </code></pre>
  
  <p>While I'm perfectly comfortable with the "immediately executed function" syntax</p>
  
  <pre><code>(function(){...})()
  </code></pre>
  
  <p>I was wondering what the leading semicolon is for. All I could come up with is that it is an insurance. That is, if the library is embedded in other, buggy code, it serves as an "the last statement ends here at the latest" kind of speed bump.</p>
  
  <p>Has it got any other functionality?</p>