Answer: No
As we have 2 == operators, so they are executed from left to right.
a == b == c
⇒ (a == b) == c
⇒ (10 == 10) == 10
⇒ true == 10
⇒ 1 == 10
⇒ false
Why is true converted to 1?
The rule for == says if one of the operands is boolean, it's converted to number before the comparison.
true is converted to its number value, which is 1.
Post #783
1.51K

- ❤ 5