public
Created

Merge Structs in ColdFusion

  • Download Gist
gistfile1.cfm
ColdFusion
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<!---
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>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.