JavaScript Comparison Operators

JavaScript Comparison Operators are used to compare two values, like if they are equal or not equal, or greater than the other or less than the other, etc.

Comparison Operator – Symbol – Example

JavaScript supports the following Comparison Operators.

Comparison OperationOperator SymbolExample
Equal to==a == b
Equal Value and Equal Type===a === b
Not-equal!=a != b
Greater-than>a > b
Less-than<a < b
Greater-than or Equal-to>=a >= b
Less-than or Equal-to<=a <= b
ADVERTISEMENT

Tutorials

The following JavaScript tutorials cover each of these Comparison Operators in detail.

Example

In the following example, we take two values, and perform different Comparison Operations on these values.

index.html

Conclusion

In this JavaScript Tutorial, we learned about Comparison Operators, their syntax, and usage with examples.