Booleans
Goals
Step 1
IRB15 < 5 15 > 5 15 >= 5 10 == 12
Step 2
IRBa = 'apple' b = 'banana' a == b puts a + b a = b puts a + b
Step 3
IRBa = 'apple' b = 'banana' a != bIRB!true !false !(a == b)
Step 4
IRByes = true no = falseIRByes and yes yes && yesIRByes and no no and yes no and noIRByes or no yes || no yes or yes
Step 5
IRB'sandwich'.end_with?('h') 'sandwich'.end_with?('z') [1,2,3].include?(2) [1,2,3].include?(9) 'is my string'.empty? ''.empty? 'is this nil'.nil? nil.nil?
Explanation
Further Reading
Next Step:
Go on to Conditionals
Back to Numbers And Arithmetic