Merge map values

Kevin Smith zenparsing at gmail.com
Tue Apr 28 12:19:58 UTC 2015


Another option:

    var map = new Map;
    Array.from("mainn")
      .map(c => c.toLowerCase())
      .forEach(c => map.set(c, (map.get(c) | 0) + 1));

This kind of question is probably better left for StackOverflow, however.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150428/f519fe37/attachment.html>


More information about the es-discuss mailing list