Map (dictionary)
Key-value pairs.
Syntax
def m = [k: v]; m.k or m["k"]
Description
Key-value pairs are held using square brackets. Values are accessed via m.key or m["key"].
Example
Loading editor…
Expected output
Alex 2
When to use?
Storing object properties; configuration.