The ::() operator in Scala is utilized to add an element to the beginning of the List.
Method Definition: def ::(x: A): List[A]
Return Type: It returns the stated list after adding an element to the beginning of it.
List(5, 1, 2, 3)
List(1, 1, 2, 3)