The >
operator returns true
if the left operand is greater than the right operand, and false
otherwise.
The >
operator returns true
if the left operand is greater than the right operand, and false
otherwise.
The operands are compared using the same algorithm as the Less than operator, except the two operands are swapped. x > y
is generally equivalent to y < x
, except that x > y
coerces x
to a primitive before y
, while y < x
coerces y
to a primitive before x
. Because coercion may have side effects, the order of the operands may matter.
Desktop | Mobile | Server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | Deno | Node.js | ||
Greater_than |
1 | 12 | 1 | 3 | 1 | 18 | 4 | 10.1 | 1 | 1.0 | 4.4 | 1.0 | 0.10.0 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Greater_than