Files
wren/test/map/count.wren
T

13 lines
317 B
Plaintext
Raw Normal View History

2015-01-24 23:21:50 -08:00
var map = {}
2015-01-24 22:27:35 -08:00
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