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

Idiom #170 Get map size

Set n to the number of elements stored in mymap.

This is not always equal to the map capacity.

const n = mymap.length;
n := len(mymap)
int n = mymap.size();
$n = count($mymap);
n := MyMap.Count;
n = len(mymap)
n = mymap.size
let n = mymap.len();

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

Idiom created by

Related idioms