create
ts
function Map.create<K, V>(
iterable?: Iterable<readonly [K, V]> | null | undefined,
): Map<K, V>Creates a new Map from an iterable of key-value pairs.
Example
ts
import { Map } from "@monstermann/map";
Map.create([
["a", 1],
["b", 2],
["c", 3],
]); // Map(2) { "a" => 1, "b" => 2, "c" => 3 }