---
title: Map.prototype.size
---
## Map.prototype.size
Returns the number of elements in a `Map` object.

## Syntax
```javascript
myMap.size();
```

##Example
```javascript
const myMap = new Map();
myMap.set('foo',1);
myMap.set('bar',2);
myMap.set('baz',3);


myMap.size(); // 3
```