Ruby doesn't have an increment operator

Written on October 19, 2015

Coming from JavaScript, I had no idea that Ruby doesn’t have an increment operator like ++. It turns out that the author of Ruby, matz suggests the official way to increment and decrement variables in ruby is by using the += and -= operators.

Stay in touch

Thanks for reading this article. I'd love to stay in touch and share articles like this one in your inbox. Sign up for my newsletter.