1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
---
title: Gruppierungsoperator
slug: Web/JavaScript/Reference/Operators/Grouping
tags:
- JavaScript
- Operator
- Primary Expressions
translation_of: Web/JavaScript/Reference/Operators/Grouping
---
<div>{{jsSidebar("Operators")}}</div>
<p>Der Gruppierungsoperator <code>( )</code> kontrolliert die Priorität beim Auswerten von Ausdrücken.</p>
<div>{{EmbedInteractiveExample("pages/js/expressions-groupingoperator.html")}}</div>
<h2 id="Syntax">Syntax</h2>
<pre class="syntaxbox"> ( )</pre>
<h2 id="Beschreibung">Beschreibung</h2>
<p>Der Gruppierungsoperator besteht aus einem runden Klammernpaar um einen Ausdruck oder Teilausdruck, um die normale <a href="/de/docs/Web/JavaScript/Reference/Operators/Operator_Precedence">Operator Priorität</a> zu überschreiben, so dass Ausdrücke mit niedriger Priorität vor Ausdrücken mit hoher Priorität ausgewertet werden können. So wie es klingt, gruppiert dieser Operator alles in den Klammern.</p>
<h2 id="Beispiele">Beispiele</h2>
<p>Überschreiben von Multiplikation und Division zu erst, wenn Addition und Subtraktion als erstes ausgewertet werden sollen.</p>
<pre class="brush:js">var a = 1;
var b = 2;
var c = 3;
// normale Priorität
a + b * c // 7
// wird wie folgt ausgewertet
a + (b * c) // 7
// überschreiben der Priorität
// Addition vor Multiplikation
(a + b) * c // 9
// was äquivalent zu folgendem ist
a * c + b * c // 9
</pre>
<h2 id="Spezifikationen">Spezifikationen</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Spezifikation</th>
<th scope="col">Status</th>
<th scope="col">Kommentar</th>
</tr>
<tr>
<td>{{SpecName('ESDraft', '#sec-grouping-operator', 'The Grouping Operator')}}</td>
<td>{{Spec2('ESDraft')}}</td>
<td> </td>
</tr>
<tr>
<td>{{SpecName('ES6', '#sec-grouping-operator', 'The Grouping Operator')}}</td>
<td>{{Spec2('ES6')}}</td>
<td> </td>
</tr>
<tr>
<td>{{SpecName('ES5.1', '#sec-11.1.6', 'The Grouping Operator')}}</td>
<td>{{Spec2('ES5.1')}}</td>
<td> </td>
</tr>
<tr>
<td>{{SpecName('ES1', '#sec-11.1.4', 'The Grouping Operator')}}</td>
<td>{{Spec2('ES1')}}</td>
<td>Initiale Definition. Implementiert in JavaScript 1.0.</td>
</tr>
</tbody>
</table>
<h2 id="Browserkompatibilität">Browserkompatibilität</h2>
<p>{{Compat("javascript.operators.grouping")}}</p>
<h2 id="Siehe_auch">Siehe auch</h2>
<ul>
<li><a href="/de/docs/Web/JavaScript/Reference/Operators/Operator_Precedence">Operator Priorität</a></li>
<li>{{jsxref("Operators/delete", "delete")}}</li>
<li>{{jsxref("Operators/typeof", "typeof")}}</li>
</ul>
|