A collection that maps keys to values. A map can’t contain duplicate keys. Each key can map to at most one value. Use plain objects to represent Aura Maps in JavaScript. If you want to set map values in JavaScript, use object[key] = value. An attribute with no default value defaults to null in JavaScript. Use default="{}" in markup for an empty map.
A collection that contains no duplicate elements. The order for set items is not guaranteed. For example, "['red', 'green', 'blue']" might be returned as blue,green,red.
Note: To set a default value for Array, List, or Set types, surround comma-separated values with []; for example default="['red', 'green', 'blue']". Setting a default value without square brackets is deprecated and can lead to unexpected behavior.
Important: Don’t use JavaScript Maps (the Map object) for Map Aura types. Use plain JavaScript objects instead.
Checking for Types
To determine a variable type, use typeof or a standard JavaScript method, such as Array.isArray(), instead. The instanceof operator is unreliable due to the potential presence of multiple windows or frames.
Setting List Items
There are several ways to set items in a list. To use a client-side controller, create an attribute of type List and set the items using component.set().
This example retrieves a list of numbers from a client-side controller when a button is clicked.