The Arcade developer docs talk about "increment operators":
The increment/decrement by one operators have both a pre and post versions that differ in what they return. The pre increment version adds one to the variable and returns the new value while the post increment adds one and then returns the initial value of the variable.
//Pre increment example
var x=10
++x // x is now 11 and the value 11 is returned
//Post increment example
var x=10
x++ // x is now 11 but the value of 10 is returned.
Question:
What is an example of using x++ in an Arcade expression? (outside of a for loop)
I don't think I understand why we'd want to use it: "x is now 11 but the value of 10 is returned". Why would we want to return the "initial value of the variable" (10)?
Related: Why avoid increment ("++") and decrement ("--") operators in JavaScript?
Thanks!