This is the code block I have tried to understand += and ++=
scala> import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.ArrayBuffer
scala> val a = ArrayBuffer[Int]()
a: scala.collection.mutable.ArrayBuffer[Int] = ArrayBuffer()
scala> a += 1
res0: a.type = ArrayBuffer(1)
scala> a += (2,3,4);
res1: a.type = ArrayBuffer(1, 2, 3, 4)
scala> a ++= Array(5,6,7)
res4: a.type = ArrayBuffer(1, 2, 3, 4, 5, 6, 7)
what is ++= operator in scala? How does it work? Why val is allowing merging of another array since val type should be constant and not against statically scoped feature?