New implementation

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
with Ada.Containers.Indefinite_Hashed_Maps;
with Ada.Strings.Hash;

use Ada.Containers;
for C in My_Map.Iterate loop
   Put_Line ("Key = " & Key (C) & ", Value = " & Element (C));
end loop;
(doseq [k {:a "x" :b "y" :c "z"}] (prn k))
#include <iostream>
for (const auto& [key, value]: mymap) {
	std::cout << "Key: " << key << " Value: " value << '\n';
}
#include <iostream>
for (const auto& kv: mymap) {
	std::cout << "Key: " << kv.first << " Value: " kv.second << std::endl;
}
foreach(var entry in map)
{
    Console.WriteLine("Key=" + entry.Key + ", Value=" + entry.Value);
}
import std.stdio;
int[string] mymap = ["Hello":1 , "World":2];
foreach (k, v; mymap)
    writeln("Key: ", k, " Value: ", v);
mymap.forEach((k, v) => print('Key=$k, Value=$v'));
for {k, x} <- mymap do
  IO.puts("#{k} => #{x}")
end
Enum.each(mymap, fn({k, x}) ->
  IO.puts("#{k} => #{x}")
end)
maps:fold(
	fun(K, V, ok) ->
		io:format("~p: ~p~n", [K, V])
	end, ok, MyMap).
import "fmt"
for k, x := range mymap {
  fmt.Println("Key =", k, ", Value =", x)
}
import Data.List (intercalate)
import qualified Data.Map as Map
let f k v = [show k, " = ", show v]
    mapped = Map.mapWithKeys f mymap
in putStrLn $ intercalate "," $ mapped
for (k in mymap) {
   if (mymap.hasOwnProperty(k))
      console.log("key="+k+", value="+mymap[k]);
}
for (Map.Entry<Object, Object> entry : mymap.entrySet()) {
    Object k = entry.getKey();
    Object x = entry.getValue();
    System.out.println("Key=" + k + ", Value=" + x);
}
for k, x in pairs(mymap) do
	print('Key: '..k..', Value: '..x)
end
foreach ($mymap as $k=>$x)
{
    echo "Key=$k, Value=$x <br>";
}
uses fgl;
type TMyMap = specialize TFPGMap<String, Integer>;
for i := 0 to mymap.Count - 1 do
  WriteLn(mymap.Keys[i], '=', mymap.Data[i]);
while ( ($k,$v) = each %mymap) {
    print "Key=$k, Value=$v\n";
}
forall(get_dict(K, D, V),
       format("~w:~w~n", [K, V]))
from __future__ import print_function
for k, v in mymap.items():
	print(k, v)
mymap.each {|k, x| puts "Key= #{k}  Value=#{x}"}
use std::collections::BTreeMap;
for (key, val) in &mymap {
    println!("Key={key}, Value={val}", key=key, val=val);
}
val x = Map("a" -> 1, "b" -> 2, "c" -> 3)
x.foreach{ case (key, value) => println(s"$key => $value")}