Why is `function () {{` legal in JS?
I recently saw some JS forms:
function f(x) {{ return x + 1; }}
To my surprise, this is syntactically legal and works great. At first I thought they were C-style anonymous scopes, but it doesn't introduce a new scope:
function f(x) {{ var y = x + 1; } return y;} // no error
Why does JS accept these extra parentheses? How are they interpreted / what do they mean?
+3
source to share