Scala Map init() method with example
The init() method is utilized to delete the last element of the map. It will return all the elements of the Map except the last one.
Method Definition: def init: Map[A, B]
Return Type: It returns all the elements of the map except the last one.
Map(geeks -> 5, for -> 3)