scala add item to list code example
Example: scala add to list
def::[B >: A](elem: B): List[B]
Adds an element at the beginning of this list.
elem is the element to prepend.
returns a list which contains x as first element
and which continues with this list.
Example:
1 :: List(2, 3) = List(2, 3).::(1) = List(1, 2, 3)