Grouping operator ( ) (Delimiter)

A means of controlling precedence of evaluation in expressions.

Availability:

ECMAScript edition - 2

The grouping operator is a pair of parentheses placed around an expression or expressions to control the precedence of evaluation in expressions so that the sub-expressions are evaluated in the correct order. It is also used to enclose the arguments to a function or method.

Placing parentheses around expressions controls the order in which they are evaluated and can override the normal precedence that operators assume. This allows delete and typeof operations to be applied to expressions in parentheses for example.

Controlling the precedence of expressions allows operators with lower precedence to be evaluated ahead of the higher priority expression operators. For example:

A + B * C

by implication is executed like this:

A + (B * C)

A and B can be added before the multiplication like this:

(A + B) * C

This forces the addition to occur before the multiplication and is functionally equivalent to:

A*C + B*C

The associativity is left to right.

Refer to the operator precedence topic for details of execution order.

See also:Associativity, delete, Function call operator ( ), Operator, Operator Precedence, Parentheses ( ), Primary expression, typeof

Cross-references:

ECMA 262 edition 2 - section - 11.1.4

ECMA 262 edition 3 - section - 11.1.6