Why is this JS Syntax valid (extra braces)?
<p>So I just mistakenly typed something in a JS console and was surprised that it didn't give me a syntax error.  My question: Why is this valid?</p>

<pre><code>function foo(){
    {
        console.log('Valid Function');
    }
}
foo();
</code></pre>

<p>I would assume that it would interpret the inner <code>{ ... }</code> to be an object literal, but if that were the case the console.log wouldn't be valid... so...?</p>
