Created
May 29, 2015 23:23
-
-
Save anonymous/eefca5ca3fe8c3ef800a to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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