TIL is my collection of daily learnings. Each entry is brief, technical, and lightly edited.
Keyword Precedence
The Ruby keyword not and the unary ! aren’t the same. They have a different precedence, and therefore are not interchangeable, despite seeming very similar. irb > not 3 == 4 => true irb > !3 == 4 => false The first example is evaluated as not (3 == 4), or not false, which is true. The second example is evaluated as (not 3) == 4, or false == 4, which is false. ...