Why is 5> 4> 3! = (5> 4 && 4> 3) true in Javascript?

Why is 5 > 4 > 3 != (5 > 4 && 4 > 3)true in javascript?

So annoying!

+5
source share
2 answers

5 > 4 > 3evaluated as (5 > 4) > 3, and then true > 3which is equal false. Take a look

+17
source

JavaScript, in the great tradition of most languages ​​that come down with C, does not support a chain of relational operators.

+6
source

All Articles