There is no practical difference in those two forms, but from a grammatical point of view the difference between the two is that The Grouping Operator - the parentheses - will hold in the first example a CallExpression
, that includes the FunctionExpression
:
CallExpression
| |
FunctionExpression |
| |
V V
(function() { }());
^ ^
|--PrimaryExpression --|
In the second example, we have first a whole CallExpression
, that holds the FunctionExpression
:
PrimaryExpression
|
FunctionExpression
|
V
(function() { })();
^ ^
|-- CallExpression --|
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…