title: Javascript/NodeJS, get the length of a map
body: <p>so I have a small problem returning the size of a map :</p>
  
  <pre><code>var siteRoomMap = new Map;
  // (algorithm to fill the map)
  
  console.log('in start');
  console.log(siteRoomsMap);
  console.log(siteRoomsMap.size);
  </code></pre>
  
  <p>and this is what i get in the terminal : </p>
  
  <pre><code>in start
  
  {
      '1': {
          siteNumber: 1,
          roomsMap: {
              '1': [Object],
              '2': [Object],
              '3': [Object]
          },
          siteState: false
      },
      '2': {
          siteNumber: 2,
          roomsMap: {
              '1': [Object]
          },
          siteState: false
      }
  }
  
  0
  </code></pre>
  
  <p>I mean, my map clearly has 2 keys/values in it, but it always returns <code>0</code>.
  I tried <code>map.length</code> but I get an <code>undefined</code> (probably cause <code>.length</code> doesn't exist for a map ? )</p>
  
  <p>I could write a function my self that would look like that and call it on my map with </p>
  
  <pre><code>size = myfunction(siteRoomsMap);
  
  var myfunction = function(data){
      for (i in data) {
          size++;
      }
      return size;
  };
  </code></pre>
  
  <p>but why can't I use <code>.size</code> ? I looked in the doc and it clearly says it returns the number of element in the map ???</p>