Less-than-or-equal operation

Learn how to check if a value is less than or equal to another.

The less than or equal operation checks whether one value is less than or equal to another. Like the less than operation, it works with numbers, strings, dates, and other values that have 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:

0 <= 1 // true
Try in Playground

You can also compare strings alphabetically:

"a" <= "b" // true
Try in Playground

And dates chronologically:

today <= tomorrow // true
Try in Playground

Although there is no natural language equivalent to the <= operator, you can use the less than or equal test for a more natural reading:

/*<operand>*/ is less than or equal to /*<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.