Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save trycf/a1e03fd81465c73a64ae702b5fd7016a to your computer and use it in GitHub Desktop.

Select an option

Save trycf/a1e03fd81465c73a64ae702b5fd7016a to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
function foo(first /*, ...rest*/) {
var args = structCopy(arguments);
structDelete(args, "first");
var rest = args.reduce(function(accumulator, el) {
return accumulator.append(args[el]);
}, []);
return {
first: first,
rest: rest
};
}
result = foo("apple","bean","carrot","date");
writeDump(result);
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment