Why does the expression (true == true == true) produce a syntax error?
问题 Ruby : true == true == true syntax error, unexpected tEQ vs. JavaScript : true == true == true // => true vs. C : 1 == 1 == 1 // => 1 回答1: Association direction, which controls the order of operators having their arguments evaluated, is not defined for the == method, same as for === , != , =~ and <=> methods as well (all of which have the same precedence and form a separate precedence group exclusively). Documentation Thus evaluation order in case of multiple operators from the list mentioned