Map.erase functionality

Whilst developing a script to keep track of "in" and "out" events I thought I could add and erase items in a map object and use the count property to keep a tally of current "ins". However it turns out that somemap(someitem).erase does not eliminate the item. This may well be working as designed. If so, what are the chances of adding a somemap(someitem).remove method to completely expunge an existing map item and update the count accordingly? The sample code shows what happens currently.

function OnClick(clickData)
{
	// --------------------------------------------------------
	var map1 = DOpus.Create.Map();
	// --------------------------------------------------------
	DOpus.ClearOutput();
	DOpus.output("map1.count (0) = "+map1.count);
	map1("item1") = true;
	DOpus.output("map1.count (1) = "+map1.count);
	map1("item1").erase;
	DOpus.output("map1.count (2) = "+map1.count);
	// --------------------------------------------------------
}

map1.count (0) = 0
map1.count (1) = 1
map1.count (2) = 1

Use map1.erase("item1"); instead.

Oops. :blush: Thanks @Jon