RosettaCodeData/Task/Associative-array-Iteration/Haxe/associative-array-iteration.hx
2026-04-30 12:34:36 -04:00

18 lines
303 B
Haxe

class Main {
static public function main() {
var map = [1 => "one", 2 => "two"];
// key and value
for (key => value in map) {
trace(key + " " + value);
}
// keys only
for (key in map.keys())
trace(key);
// values only
for (value in map)
trace(value);
}
}