Can someone explain the reason/importance of why javascriptlint (not jslint) gives the warning
inc_dec_within_stmt - increment (++) and decrement (--) operators used as part of greater statement
when it comes across a line of code like
someValue = count++;
Why should I keep this check turned on?
It’s a warning because a statement like that can be ambiguous to human readers.
While you and I can look at that and understand that it is equivalent to
a less experienced programmer might incorrectly interpret that as
Of course, this is the simplest example. The warning is much more deserved in a line like
although I can’t say I’ve ever seen a line like that in production code 🙂