Jump to content

Associative array/Iteration: Difference between revisions

(→‎{{header|Go}}: add template example)
Line 753:
// 1. Create
var aMap := Dictionary new.
aMap@["key"] := "foox".
aMap@["key"] := "foo".
aMap@["key2"]:= "foo2".
aMap@["key3"]:= "foo3".
aMap@["key4"]:= "foo4".
 
// 2. Enumerate
aMap run each:forEach
(:aKeyValue)[ console printLine:(aKeyValue key):," : ":,aKeyValue) ].
].</lang>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.