Triple colon Scala
Solution 1:
Concatenates two lists - javadoc
Solution 2:
To add to gkamal's answer, it's important to understand that methods whose names end in a colon are right-associative. So writing l ::: List(3)
is the same as writing List(3).:::(l)
. In this case it doesn't matter since both operands are lists, but in general you'll need this knowledge to find such methods in the scaladocs.
It also helps to know that the scaladocs have a comprehensive index of all methods (and classes, etc) with symbolic names. You can reach it by clicking on the #
in the upper-left corner.