Created
January 18, 2019 08:58
-
-
Save trycf/a1e03fd81465c73a64ae702b5fd7016a to your computer and use it in GitHub Desktop.
TryCF Gist
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> | |
| 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