Join Two Arrays in ColdFusion

前端 未结 9 837
青春惊慌失措
青春惊慌失措 2020-12-29 19:22

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

9条回答
  •  离开以前
    2020-12-29 19:55

    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.

提交回复
热议问题