Comparison operators | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Comparison operators

What’s the difference between comparison operators and a Boolean

11th Apr 2018, 3:44 PM
2 Answers
+ 2
boolean is just True or False. With comparison operators you compare two variables which result is boolean. For example var a = 3; var b = 4; b > a will return true b == a will return false b < a will return false b != a will return true
11th Apr 2018, 4:00 PM
Damyan Petkov
Damyan Petkov - avatar
Boolean only has 2 values: true or false. comparison operators are those like equal to(=), greater than(>), less than(<), less than or equal to(<=) and greater than or equal to(>=). sorry if this doesn't help because it's only a definition. also pls add if i forgot any comparison operators.
11th Apr 2018, 3:57 PM
[Adenosine] - avatar