Skip to content

Instantly share code, notes, and snippets.

@elpete
Last active November 23, 2015 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elpete/910ec8524eb5dc00df5e to your computer and use it in GitHub Desktop.
Save elpete/910ec8524eb5dc00df5e to your computer and use it in GitHub Desktop.
Issues using the `arguments` scope with `StructEach`
<cfscript>
function dumpOutput(filters = {}) {
arguments.filters.each(function(key, value, struct) {
writeDump(arguments);
});
}
function dumpByPassingArguments() {
dumpOutput(filters = arguments);
}
writeDump("Dump by passing struct directly:");
dumpOutput({
orderNumber = [
'10000000',
'10000001'
]
});
writeOutput("<br />");
writeDump("Dump by passing struct through the arguments scope of another function:");
dumpByPassingArguments({
orderNumber = [
'10000000',
'10000001'
]
});
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment