RosettaCodeData/Task/Associative-array-Iteration/Fantom/associative-array-iteration.fantom
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

22 lines
334 B
Text

class Main
{
public static Void main ()
{
Int:Str map := [1:"alpha", 2:"beta", 3:"gamma"]
map.keys.each |Int key|
{
echo ("Key is: $key")
}
map.vals.each |Str value|
{
echo ("Value is: $value")
}
map.each |Str value, Int key|
{
echo ("Key $key maps to $value")
}
}
}