Is there a built-in way to join two arrays in ColdFusion, similar to JavaScript\'s array.concat()?
In CF 10 or Railo 4, you can use the concat() function of the Underscore.cfc library to get a new array that is a concatenation of two other arrays (without modifying the existing arrays). Example cfscript:
newArray = _.concat([1], [2]);
Result:
// newArray == [1, 2]
Using this method to get a new array is a bit cleaner than creating a new array and calling ArrayAppend on it twice.
(Disclaimer: I wrote Underscore.cfc)