Concise javascript solution
\nvar groupAnagrams = function(strs) {\n    /* sort each string, use that as key in map and when new sorted string matches a key we add it to that */\n    const
```\nvar groupAnagrams = function(strs) {\n    /* sort each string, use that as key in map and when new sorted string matches a key we add it to that */\n    const map = {};\n    \n    for (const str of strs) {\n        const sorted = str.split(\'\').sort().join(\'\');\n        \n        if (!map[sorted]) {\n            map[sorted] = [str];\n        } else {\n            map[sorted].push(str);\n        }\n    }\n    \n    return Object.values(map);\n};\n```
['JavaScript']