Files
wren/test/map/count.wren
2015-01-24 23:21:50 -08:00

13 lines
317 B
Plaintext

var map = {}
IO.print(map.count) // expect: 0
map["one"] = "value"
IO.print(map.count) // expect: 1
map["two"] = "value"
IO.print(map.count) // expect: 2
map["three"] = "value"
IO.print(map.count) // expect: 3
// Adding existing key does not increase count.
map["two"] = "new value"
IO.print(map.count) // expect: 3