Ruby shorthand | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Ruby shorthand

i donā€™t really get += because a = 1 b = 2 a +=b So in my head it goes 1 = 1+2 I donā€™t get this. Help

26th Nov 2018, 2:11 PM
Jay
3 Respostas
+ 6
Would be more like a = a+b or you could write it a = 1+2, which now changes the value of a to 3 for any future references until changed again. I hope that helps.
26th Nov 2018, 2:24 PM
Tony
Tony - avatar
+ 6
Cheers m8
26th Nov 2018, 2:32 PM
Tony
Tony - avatar
+ 1
thanks
26th Nov 2018, 2:28 PM
Jay