11.1.6 Grouping Operator

2010-05-15

PrimaryExpression : ( Expression )

Code: (Meta Ecma)
function evaluate(( Expression )) {
return evaluate(Expression); // always returns a Reference
}

Note that "the grouping operator" is nothing more than two parenthesis (when not part of an invocation or declaration). Also note that these don't return the actual value, but rather a Reference to whatever is being grouped. The specification notes that this is to allow parens after delete and typeof (which don't actually use parens). Otherwise delete would simply not work and typeof would try to get the value of the value of the Reference.

There are some minor side effects to this operator which are usually not observed but can be exposed like this:

Code: (Ecma)
window.z = 5;
var x = {z:6,f:function(){ alert(this.z); }};
x.f(); // 6 (as expected)
(x.f)(); // 6 (not what I would expect)
(0, x.f)(); // 5 (what I'd expect, but not after the previous line)

(I learned this quirk from @kangax' quiz)