Is the script below in correct form of JavaScript?

```
function foo(){
    return function(x){
        alert(x)
    }
}
foo()("bar");
    ↑   ↑
   There are 2 parenthesis.

```

It [works](http://jsfiddle.net/vuuqp/) but I don't know if it is in a correct form.  

If yes, then is that mean this is also correct?

```
function foo(){
    return function(){
        return function(){
            return function(){
                return function(x){
                    alert(x)
                }
            }
        }
    }
}
foo()()()()("?!?!?!");

```

It looks strange to me but it does work...