From 844f5103992238c0c23203286dad16a466e89c97 Mon Sep 17 00:00:00 2001 From: julieng Date: Tue, 3 Aug 2021 08:03:09 +0200 Subject: move *.html to *.md --- .../operators/addition_assignment/index.html | 66 ---------------------- 1 file changed, 66 deletions(-) delete mode 100644 files/fr/web/javascript/reference/operators/addition_assignment/index.html (limited to 'files/fr/web/javascript/reference/operators/addition_assignment/index.html') diff --git a/files/fr/web/javascript/reference/operators/addition_assignment/index.html b/files/fr/web/javascript/reference/operators/addition_assignment/index.html deleted file mode 100644 index c0a2136c3d..0000000000 --- a/files/fr/web/javascript/reference/operators/addition_assignment/index.html +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: Affectation après addition (+=) -slug: Web/JavaScript/Reference/Operators/Addition_assignment -tags: -- Assignment operator -- JavaScript -- Language feature -- Operator -- Reference -translation-of: Web/JavaScript/Reference/Operators/Addition_assignment -browser-compat: javascript.operators.addition_assignment ---- -
{{jsSidebar("Operators")}}
- -

L'opérateur d'addition et d'affectation (+=) calcule la somme ou la concaténation de ses deux opérandes puis affecte le résultat à la variable représentée par l'opérande gauche. C'est le type des opérandes qui détermine s'il y a somme ou concaténation.

- -
{{EmbedInteractiveExample("pages/js/expressions-addition-assignment.html")}}
- -

Syntax

- -
-Opérateur : x += y
-Signification :  x  = x + y
-
- -

Exemples

- -

Utiliser l'opérateur d'addition et d'affectation

- -
-let toto = "toto";
-let truc = 5;
-let machin = true;
-
-// nombre + nombre -> addition
-truc += 2; // 7
-
-// booléen + nombre -> addition
-machin += 1; // 2
-
-// booléen + booléen -> addition
-machin += false; // 1
-
-// nombre + chaîne de caractères -> concaténation
-truc += 'toto'; // "5toto"
-
-// chaîne de caractères + booléen -> concaténation
-toto += false // "totofalse"
-
-// chaîne de caractères + chaîne de caractères -> concaténation
-toto += 'truc' // "tototruc"
- -

Spécifications

- -

{{Specifications}}

- -

Compatibilité des navigateurs

- -

{{Compat}}

- -

Voir aussi

- - -- cgit v1.2.3-54-g00ecf