title: How to count items' occurence in a List
body: <p>I am new to Dart.  Currently I have a List of duplicate items, and I would like to count the occurence of them and store it in a Map.</p>
  
  <pre><code>var elements = ["a", "b", "c", "d", "e", "a", "b", "c", "f", "g", "h", "h", "h", "e", "a"];
  </code></pre>
  
  <p>I want to have a result like:</p>
  
  <pre><code>{
    "a": 3,
    "b": 2,
    "c": 2,
    "d": 2,
    "e": 2,
    "f": 1,
    "g": 1,
    "h": 3
  }
  </code></pre>
  
  <p>I did some research and found a JavaScript solution, but I don't know how to translate it to Dart.</p>
  
  <pre><code>var counts = {};
  your_array.forEach(function(x) { counts[x] = (counts[x] || 0)+1; });
  </code></pre>