I am just learning Ruby and I want to know the difference between
a += b
and
a =+ b
a += b is syntactic shorthand for a = a + ba =+ b is similar to a = + bSo, firstValue = firstValue + secondValue is the same as firstValue = firstValue.+(secondValue) in ruby.
firstValue + = secondValue – increment Add the value of secondValue to the value of firstValue , store the result in firstValue, and return the new value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With