JavaScript Comparison Operators
JavaScript Comparison Operators
The comparison operators
enable you to test conditions.
The comparison operator is also called as relational operator.
Equal To Operator
Equal To operator is used to check whether the given values are equal irrespective of its type.
Example
JavaScript Comparison Operators
The following are the list of comparison operators available in JavaScript.
Operator | Explanation | Operation | Result |
---|---|---|---|
== | equal to | 5 == "5" | true |
=== | strict equal to | 5 === "5" | false |
!= | not equal to | 5 != "5" | false |
!== | strict not equal to | 5 !== "5" | true |
> | greater than | 5 > 3 | true |
< | less than | 5 < 3 | false |
>= | greater than or equal to | 5 >= 5 | true |
<= | less than or equal to | 5 <= 5 | true |
Strict Equal To Operator
Strict Equal To operator is used to check whether the given values are equal with respect to its type.
Example
Not Equal To Operator
Not Equal To operator is used to check whether the given values are not equal irrespective of its type.
Example
Strict Not Equal To Operator
Strict Not Equal To operator is used to check whether the given values are not equal with respect to its type.
Example
Greater Than Operator
Greater Than operator is used to check whether the first value is greater than the second value.
Example
Lesser Than Operator
Lesser Than operator is used to check whether the first value is lesser than the second value.
Example
Greater Than or Equal To Operator
Greater Than or Equal To operator is used to check whether the first value is greater than or equal to the second value.
Example
Greater Than or Equal To Operator
Greater Than or Equal To operator is used to check whether the first value is greater than or equal to the second value.
Example
Reminder
Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in JavaScript.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.