Operators

Greater than (>)

Try the free JavaScript compiler

Tests whether the left value is greater than the right according to relational comparison. Numeric text compared with a Number can be converted, while two strings compare lexically.

Formal Syntax & Structure

javascript syntaxjavascript
left > right

Parameters & Attributes

NameTypeDescription
leftexpressionLeft operand.
rightexpressionRight operand; short-circuiting may skip evaluation where applicable.

Return Value

Boolean

Result of the operation.

Working Example

Example Snippetjavascript
console.log("12" > 5);
JavaScript Reference