title: Return Value of Map.length when run an empty Map
body: <p>So,I was writing some code and stuck in an unusual problem.I am working on flutter using dart and code somewhat looks like this:</p>
  
  <pre><code>class Cart {
    Map&lt;String, String&gt; _item;
  
    void itemCount()
    {
      var count =_item.length;
      print(count);
    }
  
  }
  
  void main()
  {
  Cart cart =Cart();
    cart.itemCount();
  }
  </code></pre>
  
  <p>I had tried this code in the dartpad and I am getting the error:</p>
  
  <p><strong>TypeError: C.JSNull_methods.get$length is not a functionError: TypeError: C.JSNull_methods.get$length is not a function</strong></p>
  
  <p>I am looking for why the length function is not working when the Map is empty but works fine if map is not <strong>NUll</strong>.</p>