Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

FeLiX Leonard
FeLiX Leonard
847 Points

does anyone know how to make a variable?

I forgot how.

1 Answer

Everett Caldwell
Everett Caldwell
4,627 Points

Hi Felix,

There are a few ways to declare variables in different programming languages. In Ruby, a global variables begins with $, and has a dynamic type by the value assigned. For instance, $variable = 10, will be an integer. Then there are instance variables, which are declared with an @. Here is some more detail about ruby variables.

Cheers, Everett.