diff options
| author | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-06-27 15:03:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-27 15:03:56 +0200 |
| commit | 9f030ef5fd3a0dc15d94c01d0e1bbd1aba1eed54 (patch) | |
| tree | e6aa6c44ea4c523dbf72464e77745bed1efc8c51 /files/fr/web/javascript/reference/operators/strict_inequality | |
| parent | dc9842009bd95e0db7e058a5ebb98f27d6a3f650 (diff) | |
| download | translated-content-9f030ef5fd3a0dc15d94c01d0e1bbd1aba1eed54.tar.gz translated-content-9f030ef5fd3a0dc15d94c01d0e1bbd1aba1eed54.tar.bz2 translated-content-9f030ef5fd3a0dc15d94c01d0e1bbd1aba1eed54.zip | |
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 <tristantheb@gmail.com>
Diffstat (limited to 'files/fr/web/javascript/reference/operators/strict_inequality')
| -rw-r--r-- | files/fr/web/javascript/reference/operators/strict_inequality/index.html | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/files/fr/web/javascript/reference/operators/strict_inequality/index.html b/files/fr/web/javascript/reference/operators/strict_inequality/index.html new file mode 100644 index 0000000000..d436d5af46 --- /dev/null +++ b/files/fr/web/javascript/reference/operators/strict_inequality/index.html @@ -0,0 +1,97 @@ +--- +title: Inégalité stricte (!==) +slug: Web/JavaScript/Reference/Operators/Strict_inequality +tags: + - JavaScript + - Language feature + - Operator + - Reference +browser-compat: javascript.operators.strict_inequality +translation-of: Web/JavaScript/Reference/Operators/Strict_inequality +--- +<div>{{jsSidebar("Operators")}}</div> + +<p>L'opérateur d'inégalité stricte (<code>!==</code>) vérifie si ses deux opérandes ne sont pas égaux et renvoie un booléen correspondant au résultat. À la différence de <a href="/fr/docs/Web/JavaScript/Reference/Operators/Inequality">l'opérateur d'inégalité</a>, l'opérateur d'inégalité stricte considère toujours des opérandes de types différents comme étant différents.</p> + +<div>{{EmbedInteractiveExample("pages/js/expressions-strict-inequality.html")}}</div> + +<h2 id="syntax">Syntaxe</h2> + +<pre class="brush: js"> +x !== y +</pre> + +<h2 id="description">Description</h2> + +<p>L'opérateur d'inégalité stricte vérifie que ses deux opérandes ne sont pas égaux. Il s'agit de la négation de <a href="/fr/docs/Web/JavaScript/Reference/Operators/Strict_equality">l'opérateur d'égalité stricte</a>. Les deux expressions suivantes fourniront toujours le même résultat :</p> + +<pre class="brush: js"> +x !== y +!(x === y) +</pre> + +<p>Pour plus de détails sur l'algorithme de comparaison utilisé, voir <a href="/fr/docs/Web/JavaScript/Reference/Operators/Strict_equality">la page sur l'opérateur d'égalité stricte</a>.</p> + +<p>À l'instar de l'opérateur d'égalité stricte, l'opérateur d'inégalité stricte considèrera toujours des opérandes de types différents comme étant différents :</p> + +<pre class="brush: js"> +3 !== "3"; // true +</pre> + +<h2 id="examples">Exemples</h2> + +<h3 id="comparing_operands_of_the_same_type">Comparaison d'opérandes de même type</h3> + +<pre class="brush: js"> +console.log("hello" !== "hello"); // false +console.log("hello" !== "hola"); // true + +console.log(3 !== 3); // false +console.log(3 !== 4); // true + +console.log(true !== true); // false +console.log(true !== false); // true + +console.log(null !== null); // false +</pre> + +<h3 id="comparing_operands_of_different_types">Comparaison d'opérandes de types différents</h3> + +<pre class="brush: js"> +console.log("3" !== 3); // true + +console.log(true !== 1); // true + +console.log(null !== undefined); // true +</pre> + +<h3 id="comparing_objects">Comparaison d'objets</h3> + +<pre class="brush: js"> +const objet1 = { + name: "coucou" +} + +const objet2 = { + name: "coucou" +} + +console.log(objet1 !== objet2); // true +console.log(objet1 !== objet1); // false +</pre> + +<h2 id="specifications">Spécifications</h2> + +<p>{{Specifications}}</p> + +<h2 id="browser_compatibility">Compatibilité des navigateurs</h2> + +<p>{{Compat}}</p> + +<h2 id="see_also">Voir aussi</h2> + +<ul> + <li><a href="/fr/docs/Web/JavaScript/Reference/Operators/Inequality">L'opérateur d'inégalité</a></li> + <li><a href="/fr/docs/Web/JavaScript/Reference/Operators/Equality">L'opérateur d'égalité</a></li> + <li><a href="/fr/docs/Web/JavaScript/Reference/Operators/Strict_equality">L'opérateur d'égalité stricte</a></li> +</ul> |
