Javascript - Comparison operators
Code Life
By Pierre Marsaa
What are Comparison Operators?
When coding, you often need to compare values. Is your Codémon's level higher than the opponent's? Does your Codémon have enough energy for a special attack? To answer these questions, you use comparison operators.
Comparison operators compare two values and always return a boolean result: either true or false.
↗️
Loading editor...
↶
↷
Notice how the comparisons return true or false! The first comparison is true (15 is greater than 10), and the second is false (15 is not less than 10).
Always Boolean Results
No matter what you compare, comparison operators always return a boolean value. Keep this in mind as it will be very useful later!
Verify