In the previous example, I used the negation operator (!
) in the expression !working_overtime
, which can be read as “not working_overtime.” The negation operator can be used at the start of an expression; as an alternative, you can use the “not equals” (!=
) operator between the left and right sides of an expression:
negation.rb
!(1==1) #=> false 1!=1 #=> false
Alternatively, you can use not
instead of !
:
not( 1==1 ) #=> false