On 12/31/10, fernando trasvina <[email protected]> wrote:
> Hi. very nice explanation but what i don't fully understand is why the
> grouping operator makes the parenthesis following the function declaration
> work as call.
>

Did you read the last message I posted?

> (function(x){alert(x)}(1));
>

That is a FunctionExpression which is an ExpressionStatement.

> why this is not treated the same way as:
>
> function(x){}(1);
>
That is a SyntaxError. The most recent message on this thread (mine),
explains that the production for ExpressionStatement explicitly
forbids an ExpressionStatement to begin with the function keyword.

Please do not top post.
-- 
Garrett

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to