Please see this fiddle. For me, it's just a self-executing empty function:
function(){}()
Google Chrome 16.0.912.4 dev-m returns the error:
Uncaught SyntaxError: Unexpected token (
Why? This is especially strange because adding extraneous brackets will remove the error:
(function(){})()
ExpressionStatement :
[lookahead ∉ {{, function}] Expression ;
Because a function () {}() is not a statement as defined in ES5.1
And a valid program has to be a statement.
Expression Statement.
however the following
!function () {}();
is a valid statement, so is using () and so is var ret = function () {}()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With