Created
March 13, 2012 13:06
-
-
Save bittersweetryan/2028645 to your computer and use it in GitHub Desktop.
Functional Extend in ColdFusion (think jQuery.extend())
This file contains hidden or 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> | |
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