When we're creating a variable in Ruby, we're also assigning a data type to it. For example, when we write something like this:
car = "Tesla"
We're actually telling our program to create a variable whose value is a . But is just one data type available.
Ruby, however, is . That means you don't need to tell your program what type your variable has. When you do it will automatically figure out you're creating a variable. If later on, you decide to change the type, you can do it by reassigning that variable. For example, if you do it , the same variable will be a now.
In Ruby, you can have the following types:
- String (text)
We'll cover those data types in the following chapters.