Reference map
Removals -, -, which remove bindings from a map.
Additions and updates +, ++, updated, which let you add new bindings to a map or change existing bindings.If the key is not defined in the map, an exception is raised. Maps also define an apply method that returns the value associated with a given key directly, without wrapping it in an Option. If no key is defined in the map, get returns None. If so, it returns the associated value in a Some. The operation “ m get key” tests whether the map contains an association for the given key. The fundamental lookup method for a map is: def get(key): Option. These turn maps into partial functions from keys to values. Lookup operations apply, get, getOrElse, contains, and isDefinedAt.They are summarized in the following table and fall into the following categories: The fundamental operations on maps are similar to those on sets. Scala’s Predef object offers an implicit conversion that lets you write key -> value as an alternate syntax for the pair (key, value). A Map is an Iterable consisting of pairs of keys and values (also named mappings or associations).