Comparison Operators

← Back to documentation


Operators

Operator Description Example Result
== Equal 5 == 5
"hello" == "hello"
1
1
!= Not equal 5 != 3 1
< Less than 3 < 5 1
<= Less than or equal 5 <= 5 1
> Greater than 10 > 5 1
>= Greater than or equal 10 >= 10 1

Examples

Numbers

print(5 == 5)     # 1
print(5 == 3)     # 0
print(5 != 3)     # 1
print(5 < 10)     # 1
print(5 > 10)     # 0
print(5 <= 5)     # 1
print(10 >= 5)    # 1

Strings

print("Jaf" == "Jaf")       # 1
print("Jaf" == "Python")     # 0
print("Jaf" != "Python")     # 1

Mixed types

print(42 == "42")    # 0 (different types)
print(42 == 42.0)    # 1 (number comparison)

In conditions

x = 10
if (x > 5) {
    print("Greater")
}
# Output: Greater

See Also


© 2026 elliktronic · Jaf Language