BooleanOperators: &&


How does this return a true value? true && 100>=100
Would true>=100 be true as well?

I am not sure of how "true" can be accounted for in a numerical expression.

Thank you for your help!


true is a Boolean primitive; naturally, always true. 100 >= 100 is a Boolean expression, which in this instance yields true.

    true && true

is always true.


Oh! I see. I was reading it as:
true is greater than or equal to 100
100 is greater than or equal to 100.

Thank you for your answer :relaxed:


It's important to note order of operations in expressions.

    true && 100     # true

but, the comparison expression takes precedence to the logical one, so,

    100 >= 100

is evaluated first, which then leaves,

    true && true