-
Notifications
You must be signed in to change notification settings - Fork 8k
/
index.md
40 lines (26 loc) · 1021 Bytes
/
index.md
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
---
title: Affectation après exponentiation (**=)
slug: Web/JavaScript/Reference/Operators/Exponentiation_assignment
---
{{jsSidebar("Operators")}}
L'opérateur d'exponentiation et d'affectation (`**=`) élève la valeur de la variable fournie par son opérande gauche à la puissance indiquée par son opérande droit puis affecte le résultat à la variable représentée par l'opérande gauche.
{{EmbedInteractiveExample("pages/js/expressions-exponentiation-assignment.html")}}
## Syntaxe
```js
Opérateur: x **= y;
Signification: x = x ** y;
```
## Exemples
### Utiliser l'opérateur d'exponentiation et d'affectation
```js
let truc = 5;
truc **= 2; // 25
truc **= "toto"; // NaN
```
## Spécifications
{{Specifications}}
## Compatibilité des navigateurs
{{Compat}}
## Voir aussi
- [Les opérateurs d'affectation dans le guide JavaScript](/fr/docs/Web/JavaScript/Guide/Expressions_and_Operators#assignment)
- [L'opérateur d'exponentiation](/fr/docs/Web/JavaScript/Reference/Operators/Exponentiation)