...

/

A Slice of Maps

A Slice of Maps

This lesson discusses how to make slices of maps.

We'll cover the following...

Explanation

Suppose we want to make a slice of maps. We must use make() two times, first for the slice, then for each of the map-elements of the slice. To access a specific key-value pair from a map, you have to use an iterator to specify which map from the slice of maps is required.

For example, if we have a slice of maps called maps, and we want to set a value v with key 1 ...