title: Advanced JavaScript: Why is this function wrapped in parentheses?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong> <br/>
    <a href="https://stackoverflow.com/questions/8228281/what-is-this-construct-in-javascript">What is the (function() { } )() construct in JavaScript?</a></p>
  </blockquote>
  
  
  
  <p>I came across this bit of JavaScript code, but I have no idea what to make out of it. Why do I get "1" when I run this code? What is this strange little appendix of (1) and why is the function wrapped in parentheses?</p>
  
  <pre><code>(function(x){
      delete x;
      return x;
  })(1);
  </code></pre>