title: JS: What's the difference between a ! closure and () closure?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3755606/what-does-the-exclamation-mark-do-before-the-function">What does the exclamation mark do before the function?</a>  </p>
  </blockquote>
  
  
  
  <p>So I was going back and looking over some of my own code as well as some other javascript code and I realized that a while back when I started writing javascript libraries I was using closures that looked something like this:</p>
  
  <pre><code>(function( window, document, undefined ) {
      // code
  })( window, document );
  </code></pre>
  
  <p>But then I saw some bootstrap code and I changed to this syntax:</p>
  
  <pre><code>! function (window, document, undefined) {
      // code
  }(window, document);
  </code></pre>
  
  <p>Now, if I'm not wrong (and please correct me if I am), placing the '!' in front of my anonymous function just causes it to be treated as '()' then returns (into nowhere?) a boolean value of whether the value returned by the function was not undefined, null, or empty.</p>
  
  <p>What I'm wondering is, is there really a difference between using the '!()' syntax over '()()'? Are there certain browsers that will complain?</p>
  
  <p>Any thoughts are appreciated, thanks! XD</p>