Skip to content

Instantly share code, notes, and snippets.

@bittersweetryan
Created March 13, 2012 13:06
Show Gist options
  • Save bittersweetryan/2028645 to your computer and use it in GitHub Desktop.
Save bittersweetryan/2028645 to your computer and use it in GitHub Desktop.
Functional Extend in ColdFusion (think jQuery.extend())
<cfscript>
public Struct function extend()
output=false hint="I take structs and add their keys"{
var ret = {};
for(var i = 1; i <= arrayLen(arguments); i++){
for(key in arguments[i]){
ret[key] = arguments[i][key];
}
}
return ret;
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment