The init() method is utilized to delete the last element of the SortedMap. It will return all the elements of the SortedMap except the last one.
Method Definition: def init: SortedMap[A, B]
Return Type: It returns all the elements of the SortedMap except the last one.
Map(cs -> 2, for -> 3)
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.