Skip to main content
Version: 1.6.0

Removing

The function Map.remove creates a map containing the elements of a given map, without a given element. If the element is not already present, the new map is the same as the old one, as expected.

const my_map : map<int,string> = Map.literal([[1,"one"],[2,"two"]]);
const new_map = Map.remove(2, my_map);
const contains_3 = Map.mem(2, new_map); // == false

Note: See the predefined namespace Map