Map (dictionary)
Key-value pairs.
Syntax
var m = {'key': value}; m['key']Description
Curly braces hold 'key': value pairs. Values are accessed via their keys. keys gives the keys, and values gives the values.
Example
Loading editor…
Expected output
Alex 3
When to use?
Holding properties of an object (user, product); JSON data.