The last() method is utilized to return the last element of the map.
Method Definition: def last: (A, B)
Return Type: It returns the last element of the map.
Below is the example of Map last() method.
Here, out of three elements of the Map, the third element of the Map is returned.