aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/javascript/reference/operators/greater_than/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/fr/web/javascript/reference/operators/greater_than/index.html')
-rw-r--r--files/fr/web/javascript/reference/operators/greater_than/index.html100
1 files changed, 100 insertions, 0 deletions
diff --git a/files/fr/web/javascript/reference/operators/greater_than/index.html b/files/fr/web/javascript/reference/operators/greater_than/index.html
new file mode 100644
index 0000000000..84d44509a0
--- /dev/null
+++ b/files/fr/web/javascript/reference/operators/greater_than/index.html
@@ -0,0 +1,100 @@
+---
+title: Supérieur strict (>)
+slug: Web/JavaScript/Reference/Operators/Greater_than
+tags:
+ - JavaScript
+ - Language feature
+ - Operator
+ - Reference
+browser-compat: javascript.operators.greater_than
+translation-of: Web/JavaScript/Reference/Operators/Greater_than
+---
+<div>{{jsSidebar("Operators")}}</div>
+
+<p>L'opérateur supérieur strict (<code>&gt;</code>) renvoie <code>true</code> si l'opérande gauche est strictement supérieur à l'opérande droit et <code>false</code> sinon.</p>
+
+<div>{{EmbedInteractiveExample("pages/js/expressions-greater-than.html")}}</div>
+
+<h2 id="syntax">Syntaxe</h2>
+
+<pre class="brush: js">
+x &gt; y
+</pre>
+
+<h2 id="description">Description</h2>
+
+<p>Les opérandes sont comparés avec l'algorithme de <a href="https://tc39.es/ecma262/#sec-abstract-relational-comparison">comparaison abstraite relationnelle</a>. Voir la documentation de <a href="/fr/docs/Web/JavaScript/Reference/Operators/Less_than">l'opérateur inférieur strict</a> pour un résumé de cet algorithme.</p>
+
+<h2 id="examples">Exemples</h2>
+
+<h3 id="number_to_number_comparison">Comparaison numérique</h3>
+
+<pre class="brush: js">
+console.log(5 &gt; 3); // true
+console.log(3 &gt; 3); // false
+console.log(3 &gt; 5); // false
+</pre>
+
+<h3 id="number_to_bigint_comparison">Comparaison entre un nombre et un BigInt</h3>
+
+<pre class="brush: js">
+console.log(5n &gt; 3); // true
+console.log(3 &gt; 5n); // false
+</pre>
+
+<h3 id="string_to_string_comparison">Comparaison entre chaînes de caractères</h3>
+
+<pre class="brush: js">
+console.log("a" &gt; "b"); // false
+console.log("a" &gt; "a"); // false
+console.log("a" &gt; "3"); // true
+</pre>
+
+<h3 id="string_to_number_comparison">Comparaison entre nombres et chaînes de caractères</h3>
+
+<pre class="brush: js">
+console.log("5" &gt; 3); // true
+console.log("3" &gt; 3); // false
+console.log("3" &gt; 5); // false
+
+console.log("coucou" &gt; 5); // false
+console.log(5 &gt; "coucou"); // false
+
+console.log("5" &gt; 3n); // true
+console.log("3" &gt; 5n); // false
+</pre>
+
+<h3 id="comparing_boolean_null_undefined_nan">Comparaison avec des booléens, null, undefined, NaN</h3>
+
+<pre class="brush: js">
+console.log(true &gt; false); // true
+console.log(false &gt; true); // false
+
+console.log(true &gt; 0); // true
+console.log(true &gt; 1); // false
+
+console.log(null &gt; 0); // false
+console.log(1 &gt; null); // true
+
+console.log(undefined &gt; 3); // false
+console.log(3 &gt; undefined); // false
+
+console.log(3 &gt; NaN); // false
+console.log(NaN &gt; 3); // 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/Greater_than_or_equal">L'opérateur supérieur ou égal</a></li>
+ <li><a href="/fr/docs/Web/JavaScript/Reference/Operators/Less_than">L'opérateur inférieur strict</a></li>
+ <li><a href="/fr/docs/Web/JavaScript/Reference/Operators/Less_than_or_equal">L'opérateur inférieur ou égal</a></li>
+</ul>