Scala Array FAQ: How do I merge two Arrays or ArrayBuffers?
Solution: Use the ++ method to join two arrays into one new array:
scala> val a = Array(1,2,3)
a: Array[Int] = Array(1, 2, 3)
scala> val b = Array(4,5,6)
b: Array[Int] = Array(4, 5, 6)
scala> val c = a ++ b
c: Array[Int] = Array(1, 2, 3, 4, 5, 6)
ArrayBuffer
Use the same approach to merge two ArrayBuffers into a new ArrayBuffer: