In the previous lesson, you mastered the operations you can perform on a set. In this lesson, you’ll discover a new data structure called Map
. In Scala, Map
is an immutable data structure to store a set of keys, each of them associated with a value. The concept of mapping keys to values is not unique to the Scala language; some languages, such as Java, refer to it using the term hashmap; others, such as Python, call it dictionary. You’ll create an instance of Map
and add and remove elements to it. You’ll merge and subtract the keys of two maps to create a new one. You’ll manipulate and transform its entries using the map
and flatMap
functions. You’ll also combine multiple values using for-comprehension
. In the capstone, you’ll use Map
to read the data from a CSV file.