Back to Developer Roadmap

Assignment Operators

src/data/roadmaps/ruby/content/[email protected]

4.0791 B
Original Source

Assignment Operators

Assignment operators in Ruby are used to assign values to variables. The most basic assignment operator is the equals sign (=), which assigns the value on the right-hand side to the variable on the left-hand side. Ruby also provides compound assignment operators that combine assignment with arithmetic or bitwise operations, such as +=, -=, *=, /=, and %=. These operators modify the variable's value by performing the specified operation with the right-hand side operand and then assigning the result back to the variable.

Visit the following resources to learn more: