Is there a built-in way to join two arrays in ColdFusion, similar to JavaScript\'s array.concat()
?
You can easily concatenate two lists like this:
So, first convert your two arrays to lists using ArrayToList()
. Combine the two lists with the ListAppend() and then convert the answer back to an array with ListToArray()
.
I don't know how efficient this is, but the code is very simple. I'd love to use the arrayAppend() but I'm in ColdFusion 8.