This language bar is your friend. Select your favorite languages!

Idiom #140 Delete map entry

Delete from map m the entry having key k.

Explain what happens if k is not an existing key in m.

m.erase(k);
m.remove(k);
m = Map.delete(m, k)
delete(m, k)
import Data.Map.Strict
import Data.Map.Lazy
delete k m
unset($m[k]);
uses ghashmap;
m.delete(k);
m.pop(k, None)
m.delete(k)
use std::collections::HashMap;
m.remove(&k);

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

programming-idioms.org