Answers for "incrementing by 1 ruby"

0

increment in ruby

a = 5
# a++ WRONG: ++ (or --) is not a reserved operator
a += 1 # correct (increment)
a -= 1 # correct (decrement)
Posted by: Guest on August-27-2021

Browse Popular Code Answers by Language