Created
September 25, 2019 14:32
-
-
Save trycf/d1169f5124ca4bc8016e815a4da45b60 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> | |
order = {"id":1234,"customer_id":333,"total":1000.00}; | |
// Mutable way | |
order["a"] = "SOMETHING"; | |
// Mutable way | |
order.append( {"b":"SOMETHING ELSE"} ); | |
// Immutable way | |
result = duplicate(order).append({"c":"NEW STRUCT"}); | |
writeDump([ | |
order, | |
result | |
]); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment