for (const [key, value] ofmap.entries()) { console.log(`${key} = ${value}`); }
Example: Overview
// Create letm = map(); // Add as array or key & value pair m = m.add(["name" , "sally"]); m = m.add({ key:"name", value:"sally" }); // Add using the more typical set m = m.set("name", "sally"); m.get("name"); // "sally"; m.has("age"); // false m.has("name"); // true m.isEmpty; // false m = m.delete("name"); m.entries(); // Iterator of key value pairs
Since it is immutable, add(), delete() and clear() return a new version with change.
Returns an IMapImmutable. Use Maps.mutable as a mutable alternatve.
Example: Basic usage
Example: Enumerating
Example: Overview
Since it is immutable,
add()
,delete()
andclear()
return a new version with change.