{"name": "Mary"}
myMap = {
key = "value",
[35] = 35,
}
%{key: "value"}
(let m (map str int) (alloc (map str int)))
(set m "xyz" 123)
(insert m "abc" 456) ; exactly same as 'set'
(print (get m "xyz"))
(remove m "xyz")
(print (get m "xyz"))
;^ if a value is not there, the "zero" value of the element type is returned
; for numbers, 0; for compound types, null.
let my_map: [int:str] = {
0: "Key 0",
1: "Key 1",
2: "Key 2",
}
|| x = ["a":"Apple", "b":"Bird", "c":"Cat"]
printline x["b"] // Bird
Languages with Maps include JSON, Lua, Elixir, EDN, Wax, Jule, Speedie
View all concepts with or missing a hasMaps measurement
Read more about Maps on the web: 1.