Greater than (>) (Operator/relational)

Compares two operands to determine which is nearer to +Infinity.

Availability:

ECMAScript edition - 2
JavaScript - 1.0
JScript - 1.0
Internet Explorer - 3.02
Netscape - 2.0
Netscape Enterprise Server - 2.0
Opera - 3.0
Property/method value type:Boolean primitive
JavaScript syntax:-anOperand1 > anOperand2
Argument list:anOperand1A value that can be compared numerically or lexically
anOperand2A compatible value

Returns true if the left operand is numerically greater than the right operand or is sorted later in the Unicode collating sequence when two string values are compared.

In numeric comparisons, the presence of NaN in either or both operands will yield undefined instead of true or false.

When comparing two strings, a prefixing plus sign is present, then a numeric coercion of a string takes place before the comparison. Numeric coercion takes place when either of the operands is numeric.

In ECMA-compliant JavaScript implementations, string values are simply compared according to the Unicode character code point values, with no attempt to provide the more complex semantically oriented definitions of character and string equality defined in the Unicode version 2.0 specification.

The associativity is left to right.

Refer to the Operator Precedence topic for details of execution order.

The result is the Boolean value true if anOperand1 is numerically or lexically greater than anOperand2 otherwise false is returned.

See also:ASCII, Associativity, Equal to (==), Greater than or equal to (>=), Identically equal to (===), Less than (<), Less than or equal to (<=), Logical expression, Logical operator, NOT Equal to (!=), NOT Identically equal to (!==), Operator Precedence, Relational expression, Relational operator, Unicode

Cross-references:

ECMA 262 edition 2 - section - 11.8.2

ECMA 262 edition 2 - section - 11.8.5

ECMA 262 edition 3 - section - 11.8.2

ECMA 262 edition 3 - section - 11.8.5