From the documentation,
Ruby has no pre/post increment/decrement operator. For instance, x++ or x– will fail to parse
So, you can do
i += 1
which is equivalent of i = i + 1
From the documentation,
Ruby has no pre/post increment/decrement operator. For instance, x++ or x– will fail to parse
So, you can do
i += 1
which is equivalent of i = i + 1