Greater-than operation

Learn how to check if a value is greater than another.

The greater than operation checks whether one value is greater than another. You can use it to compare numbers, strings, dates, or any other value that has a concept of order.

To compare two values, place the > operator between them:

/*<operand>*/ > /*<operand>*/
Try in Playground

Here's a practical example involving numbers:

1 > 0 // true
Try in Playground

You can also compare strings alphabetically:

"b" > "a" // true
Try in Playground

And dates chronologically:

tomorrow > today // true
Try in Playground

Although there is no natural language equivalent to the > operator, you can use the greater than test for a more natural reading:

/*<operand>*/ is greater than /*<operand>*/
Try in Playground

Note that operations and tests may differ in their behavior and precedence. Please refer to the documentation of each specific operation and test for more information.