Wish me luck, I’m diving into JavaScript!
As much as I want to start using JavaScript right away, and create applications, I know that...
For further actions, you may consider blocking this person and/or reporting abuse
As @AndrewBuntine said, this operator seems to originate from the world of C, or maybe even assembly language before that. I am not a big fan of it for general-purpose programming, and probably I would be inclined to suggest
counter += 1
as a better idiom thancounter++
Nice article! This is thanks to C and has always been a gotcha in every language that implemented it.
Although, because of the semantic difference and the confusion it can cause, you will very rarely see auto-increment used inside other expressions in typical industry code - it would never pass a code review. You will see the postfix variant from time to time, but it's typically just run as a single statement on it's own line for the the side-effect (+ 1).
:)
@AndrewBuntine @nestedsoftware Thank you for the feedback. It's always interesting to hear how the topics I'm studying are used in the real world!