Why is the following a syntax error?
(()=>{console.log(1)}())
()=>{console.log(1)}
is clearly(?) an expression that evaluates to a fat arrow function, and ()
"should" call it?
Presumably because it is ambiguous. What is the ambiguity?
Obviously, I realise the following works:
(()=>{console.log(1)})()