September 2024
Beginner to intermediate
985 pages
35h 37m
English
In programming, maps refers to data structures in which key-value pairs can be stored. Or in other words, within a map, individual values can be stored for keys and then be retrieved via the keys. The keys within a map must be unique, but values can occur more than once.
Maps are represented in JavaScript by the Map type; consequently, instances can be created using the appropriate constructor function, as shown in Listing 4.104. As a parameter, you pass an array of arrays, where the latter contain the key as the first element (in the example, these are strings) and the value as the second element (in the example, these are numbers). The structure of the map created in this way is illustrated in Figure 4.41 ...
Read now
Unlock full access