The Grouping operator consists of a pair of parentheses around an expression or sub-expression to override the normal operator precedence so that expressions with lower precedence can be evaluated before an expression with higher priority. This operator can only contain expressions. The parameter list is passed to a function within this operator which will treat it as an expression.
This ( ) operator controls the precedence of evaluation in expressions
Example 1: Below is an example of the Grouping operator.
Uncaught SyntaxError: Function statements require a function name
Example 3: With and without grouping operator.
Without grouping operator: 30 With grouping operator: 50
- Chrome 1 and above
- Edge 12 and above
- Firefox 1 and above
- Internet Explorer 3 and above
- Opera 3 and above
- Safari 1 and above