Is this in correct form of JavaScript?
<p>Is the script below in correct form of JavaScript?</p>

<pre><code>function foo(){
    return function(x){
        alert(x)
    }
}
foo()("bar");
    ↑   ↑
   There are 2 parenthesis.
</code></pre>

<p>It <a href="http://jsfiddle.net/vuuqp/" rel="nofollow">works</a> but I don't know if it is in a correct form.<br>
If yes, then is that mean this is also correct?</p>

<pre><code>function foo(){
    return function(){
        return function(){
            return function(){
                return function(x){
                    alert(x)
                }
            }
        }
    }
}
foo()()()()("?!?!?!");
</code></pre>

<p>It looks strange to me but it does work...</p>
