Variable Types in Ruby



examples/intro/variable_types.rb
height = 187
puts height.class # Integer

weight = 87.3
puts weight.class # Float

text = "Some text"
puts text.class # String

empty = nil
puts empty.class # NilClass

debug = true
puts debug.class # TrueClass

debug = false
puts debug.class # FalseClass

names = ["Anna", "Bea", "Cecil", "David"]
puts names.class # Array

grades = {"math" => 99, "biology" => 87}
puts grades.class # Hash