Very straight-forward, so the question is why
(function(){ console.log('a'); }()); // 'a'
or
(function(){ console.log('a'); })(); // 'a'
work, but
function(){ console.log('a'); }() // SyntaxError: Unexpected token (
gives an error? What's the meaning behind this behavior? Or what's the purpose of those extra parentheses?