Thank you for reading and your feedback. I am aware it's a very contrived one, but I wanted it to be extremely short as I wanted to copy paste it many times over to show every step.
That would be value * 2 + 1, not value + 2
# Code blocks break numeration on DEV.to
That's a very different language, and without going into how recursion is memory-performant there and other niceties like pattern matching, the fact it's the only way justifies it already.
Coming back to this case, I'd like to note that there's no iteration in the task at hand, yet when we first got rid of the switch case, we got a little runtime recursion.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thank you for reading and your feedback. I am aware it's a very contrived one, but I wanted it to be extremely short as I wanted to copy paste it many times over to show every step.
value * 2 + 1
, notvalue + 2