Less-than-or-equal test

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

This test checks whether a value is less than or equal to another. In terms of semantics, this test is equivalent to the less than or equal operation.

Syntax

This test has the following syntax:

/*<value>*/ is less than or equal to /*<reference>*/
Try in Playground

To negate the test, you can write:

/*<value>*/ is not less than or equal to /*<reference>*/
Try in Playground

Parameters

These are the supported parameters:

value

The value to compare with the reference value.

reference

The value to compare against.

Examples

Here is a basic example of how to check whether a value is less than or equal to another:

1 + 2 is less than or equal to 3 // true
Try in Playground