Returns a IMapMutable (which just wraps the in-built Map) Use Maps.immutable for the immutable alternative.

const m = mapMutable();
// Add one or more entries
m.add(["name", "sally"]);
// Alternatively:
m.set("name", "sally");
// Recall
m.get("name"); // "sally"
m.delete("name");
m.isEmpty; // True
m.clear();
  • Type Parameters

    • K
    • V

    Parameters

    • Rest...data: EitherKey<K, V>

      Optional initial data in the form of an array of { key: value } or [ key, value ]

    Returns IMapMutable<K, V>