Created
July 27, 2011 19:25
-
-
Save cfg/1110163 to your computer and use it in GitHub Desktop.
Merge Structs in ColdFusion
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
<!--- | |
See: http://coreygilmore.com/blog/2008/05/08/merge-structs-in-coldfusion/ | |
---> | |
<cfscript> | |
function struct_merge() { | |
var base = {}; | |
var i = 1; | |
for( i = 1; i LTE ArrayLen(arguments); i=i+1 ) { | |
if( IsStruct(arguments[i]) ) { | |
StructAppend(base, arguments[i], true); | |
} | |
} | |
return base; | |
} | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment