1
0
forked from Mirror/wren
Files
wren/test/core/map/count.wren

13 lines
337 B
Plaintext
Raw Permalink Normal View History

2015-01-24 23:21:50 -08:00
var map = {}
System.print(map.count) // expect: 0
map["one"] = "value"
System.print(map.count) // expect: 1
map["two"] = "value"
System.print(map.count) // expect: 2
map["three"] = "value"
System.print(map.count) // expect: 3
// Adding existing key does not increase count.
map["two"] = "new value"
System.print(map.count) // expect: 3