r/ProgrammerTIL • • Sep 12 '17

Python [Python] TIL that you can chain comparisons

69 Upvotes

16 comments sorted by

View all comments

Show parent comment

1

u/j-frost Sep 27 '17

JavaScript (as usual) actually doesn't behave very well. For instance,

j-frost@1 ~ node
> -1 < 0 < 1
false

because -1 < 0 === true and since true == 1, true < 1 === false.