basic_assignment
📝 Basic Assignment
The =
operator is used to assign values to variables in Ruby. It creates the variable if it doesn’t exist and stores the value on the right-hand side. You can reassign at any time to change what the variable holds.
# Assigning an integer
count = 5
# Assigning a string
message = "Hello, world!"
# Reassigning later
count = 10