RosettaCodeData/Task/Hash-from-two-arrays/Fantom/hash-from-two-arrays.fantom
2023-07-01 13:44:08 -04:00

16 lines
296 B
Text

class Main
{
public static Void main ()
{
keys := [1,2,3,4,5]
values := ["one", "two", "three", "four", "five"]
// create an empty map
map := [:]
// add the key-value pairs to it
keys.size.times |Int index|
{
map.add(keys[index], values[index])
}
}
}