Choose where you’d like to start

Overview

Relational operators compare two given values and return a boolean value, most commonly used in conditional statements.

The following is a list of Relational Operators:

  • < (Lesser than) 

    Example:

    (x < y)            // True if x is lesser than y, otherwise false
    (1 < 2)            // True
  • > (Greater than)

    Example:

    (x > y)           // True if x is greater than y, otherwise false
    (1 > 2)           // False
  • <= (Lesser than or equal to) 

    Example:

    (x <= y)        // True if x is lesser than or equal to y, otherwise false
    (1 <= 2)        // True
  • >= (Greater than or equal to) 

    Example:

    (x >= y)        // True if x is greater than or equal to y, otherwise false
    (1 >= 2)        // False
  • == (Equals)

    Example:

    (x == y)       // True if x is equal to y, otherwise false
    (1 == 2)       // False
  • != (Not equals) 

    Example:

    (x != y)        // True if x is not equal to y, otherwise false
    (1 != 2)        // True

Data types applicable to Relational Operators

  • Number
  • Decimal
  • Date-time
  • Text (only for 'Equals' operator)

Get Started Now

Execute