
BY Simmi Kava
Comparison of Numbers
JavaScript: Comparison of 3 Numbers
Ever wondered why the below comparison of numbers gives the following output?
1 < 22 < 33
Output:
true
But,
33 > 22 > 1
Output:
false
Isn't this strange? Well, not really!
33 > 22 //true
true > 1 // 1 > 1 = false
So, how do we fix this? Relational Operator Greater than or equal operator (>=)
.
33 > 22 >= 1
Output:
true
BY Simmi Kava
![]() | ![]() | ![]() | ![]() |
Like | Comment | Save | Share |
ARCHIVES
2025
2024
2023
2022