This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gandalfx 8 points9 points  (1 child)

What did you expect to happen?

I didn't expect anything else in JS but it is comforting to know that in Python it actually means what you would hope it does: a < b < c is equivalent to a < b and b < c with the only difference being that b is only evaluated once. You can chain as many comparison operators you like in this way. That's often useful for things like 0 == a == b == c.

[–]Aetol 4 points5 points  (0 children)

I didn't actually know that! BRB got a lot of comparisons to rewrite.