Join Two Arrays in ColdFusion

Yisroel picture Yisroel · Jun 21, 2010 · Viewed 18.7k times · Source

Is there a built-in way to join two arrays in ColdFusion, similar to JavaScript's array.concat()?

Answer

Henry picture Henry · Jun 21, 2010

Not really, but guess what, just use Java! :)

<cfset foo = [1,2,3]>
<cfset bar = [4,5,6]>
<cfset foo.addAll( bar )>

reference: Java's Collection Interface API.

source: http://www.aliaspooryorik.com/blog/index.cfm/e/posts.details/post/merging-two-arrays-267