List of Comparison Operators

suggest change
Operator Comparison Example
== Equal i == 0
=== Equal Value and Type i === "5"
!= Not Equal i != 5
!== Not Equal Value or Type i !== 5
> Greater than i > 5
< Less than i < 5
>= Greater than or equal i >= 5
<= Less than or equal i <= 5

== and != coerce types before comparing. === and !== do not. If i is the number 5, then i === "5" and i == "5" are not the same test: the first is false and the second is true.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents