--- title: Affectation après division (/=) slug: Web/JavaScript/Reference/Operators/Division_assignment tags: - Assignment operator - JavaScript - Language feature - Operator - Reference browser-compat: javascript.operators.division_assignment translation-of: Web/JavaScript/Reference/Operators/Division_assignment ---
L'opérateur de division et d'affectation (/=
) divise la variable fournie par l'opérande gauche par la valeur indiquée par l'opérande droit puis affecte le résultat à la variable représentée par l'opérande gauche.
Opérateur : x /= y Signification: x = x / y
let truc = 5; truc /= 2; // 2.5 truc /= 2; // 1.25 truc /= 0; // Infinity truc /= 'toto'; // NaN
{{Specifications}}
{{Compat}}