...

/

What are Variables?

What are Variables?

Learn about variables and variable assignments.

Naming things

To refer to the objects our program deals with, we want to assign names to them. Every practical programming language has a feature to do this, called variables. In Ruby, there are different types of variables that we’ll explore soon.

Variable assignment

In Ruby, we can give a name to something (an object) by using the so-called assignment operator, =, like so:

number = 1
...