++someVariable vs. someVariable++ in JavaScript
问题 In JavaScript you can use ++ operator before ( pre-increment ) or after the variable name ( post-increment ). What, if any, are the differences between these ways of incrementing a variable? 回答1: Same as in other languages: ++x (pre-increment) means "increment the variable; the value of the expression is the final value" x++ (post-increment) means "remember the original value, then increment the variable; the value of the expression is the original value" Now when used as a standalone