5 Line JS Solution, Easy to understand
javascript\n/**\n * @param {string[]} strs\n * @return {string[][]}\n */\nvar groupAnagrams = function(strs) {\n    let mappings = {};\n    \n    for(let word o
```javascript\n/**\n * @param {string[]} strs\n * @return {string[][]}\n */\nvar groupAnagrams = function(strs) {\n    let mappings = {};\n    \n    for(let word of strs) {\n        // this will convert \'eat\' into \'e\',\'a\',\'t\' and then sort it to \'a\',\'e\',\'t\' and then join to \'ate\'\n        // we do this so the sorted anagram key will always be the same. Other related anagrams will have the same key\n        const anagramGroup = word.split("").sort().join("");\n        \n        // if we have a mapping that exists for the anagram group, push the item to that group, \n        // else create a new array and append the word\n        mappings[anagramGroup] ? mappings[anagramGroup].push(word) : mappings[anagramGroup] = [word];\n    }\n    // returns all the mappings as a unified array.\n    return Object.values(mappings);\n};\n```
['JavaScript']