What will be the result of comparing maps where from one of map a nonexistent element is removed?
val myMap = Map("MI" -> "Michigan", "OH" -> "Ohio", "WI" -> "Wisconsin", "IA" -> "Iowa")
val aNewMap = myMap - "MN"

Attempted removal of nonexistent elements from a map is handled gracefully.

Source: Scala Exercises: Maps

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Scala quizzes
Sign Up Now
or Subscribe for future quizzes