Skip to content

Instantly share code, notes, and snippets.

Created May 29, 2015 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/eefca5ca3fe8c3ef800a to your computer and use it in GitHub Desktop.
Save anonymous/eefca5ca3fe8c3ef800a to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
// increment
a = 1;
b = a++; // b=1, a=2 // postfix operators returns value, then peforms action (in this case: increments a)
writeDump({"b":b,"a":a});
c = ++a; // c=3, a=3 // prefix operator peforms action then returns result
writeDump({"c":c,"a":a});
// decrement
writeDump([
a--, // a=2
--a // a=1
]);
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment