Clean JavaScript solution
javascript\nconst groupAnagrams = strs => {\n    const map = {};\n    \n    for (let str of strs) {\n        const key = [...str].sort().join(\'\');\n\n        
```javascript\nconst groupAnagrams = strs => {\n    const map = {};\n    \n    for (let str of strs) {\n        const key = [...str].sort().join(\'\');\n\n        if (!map[key]) {\n            map[key] = [];\n        }\n\n        map[key].push(str);\n    }\n    \n    return Object.values(map);\n};\n```
[]