Skip to content

Instantly share code, notes, and snippets.

@cfg
Created July 27, 2011 19:25
Show Gist options
  • Save cfg/1110163 to your computer and use it in GitHub Desktop.
Save cfg/1110163 to your computer and use it in GitHub Desktop.
Merge Structs in ColdFusion
<!---
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