control_flow/bang_operator.rb

tests/_examples/control_flow/bang_operator.rb in the metorex repository.

# Bang (!) unary not operator
x = true
y = false

puts !x
puts !y
puts !nil
puts !!true
puts !false || true

Output:

false
true
true
true
true