From 9f030ef5fd3a0dc15d94c01d0e1bbd1aba1eed54 Mon Sep 17 00:00:00 2001 From: SphinxKnight Date: Sun, 27 Jun 2021 15:03:56 +0200 Subject: Fix #756 by updating the JS operators in fr (#1306) * Update Operators landing + revamp L10N for 4 operators * Added NOT / ! - * +multiplication * Addition, exponentiation and comparison * Operateurs de comparaison * Binary ops * Missing newline, thx GH UI * Logical AND / OR * Assignment ops * Conflicting clean-up * Missing EOF newline * Fix history and redirects * FIX: fix flaws * FIX: minox typo fix * FIX: link flaws * FIX: fix tags detection Co-authored-by: tristantheb --- .../reference/operators/decrement/index.html | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 files/fr/web/javascript/reference/operators/decrement/index.html (limited to 'files/fr/web/javascript/reference/operators/decrement') diff --git a/files/fr/web/javascript/reference/operators/decrement/index.html b/files/fr/web/javascript/reference/operators/decrement/index.html new file mode 100644 index 0000000000..291f46393f --- /dev/null +++ b/files/fr/web/javascript/reference/operators/decrement/index.html @@ -0,0 +1,70 @@ +--- +title: Décrémentation (--) +slug: Web/JavaScript/Reference/Operators/Decrement +tags: + - Decrement + - JavaScript + - Language feature + - Operator +browser-compat: javascript.operators.decrement +translation_of: Web/JavaScript/Reference/Operators/Decrement +--- +
{{jsSidebar("Operators")}}
+ +

L'opérateur de décrémentation (--) permet de décrémenter (c'est-à-dire de soustraire un) son opérande et renvoie une valeur qui est le résultat avant ou après la modification.

+ +
{{EmbedInteractiveExample("pages/js/expressions-decrement.html")}}
+ +

Syntaxe

+ +
+Opérateur : x-- ou --x
+
+ +

Description

+ +

Utilisé comme suffixe (l'opérateur étant placé après l'opérande), comme dans x--, l'opérateur décrémentera la valeur et renverra la valeur avant l'incrément.

+ +

Utilisé comme préfixe (l'opérateur étant placé avant l'opérande), comme dans --x, l'opérateur décrémentera la valeur et renverra la valeur après l'incrément.

+ +

Exemples

+ +

Décrément en suffixe

+ +
let x = 3;
+let y = x--;
+
+// y = 3
+// x = 2
+
+ +

Décrément en préfixe

+ +
let a = 2;
+let b = --a;
+
+// a = 1
+// b = 1
+
+ +

Spécifications

+ +

{{Specifications}}

+ +

Compatibilité des navigateurs

+ +

{{Compat}}

+ +

Voir aussi

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