I'm currently learning JavaScript (Python background) and I'm having trouble on the logic behind stacking logic operators.
Let me explain.
In Python (61 <= 81 < 81)
would output False
. Which makes sense since it's basically (61 <= 81 AND 81 < 81)
.
But for some reason this same condition (61 <= 81 < 81)
outputs True
in JavaScript, almost as if it is reading it as (61 <= 81 OR 81 < 81)
which is not expected. On the other hand if I explicitly write (61 <= 81 && 81 < 81)
the output is False
as expected.
Could anyone explain?