Simple JavaScript solution
var groupAnagrams = function(strs) {\n        strs = strs.sort();\n        var mapping = {};\n        for (var i = 0; i < strs.length; i++) {\n            var s
    var groupAnagrams = function(strs) {\n        strs = strs.sort();\n        var mapping = {};\n        for (var i = 0; i < strs.length; i++) {\n            var str = strs[i];\n            var sorted = str.split('').sort().join('');\n            \n            if (mapping[sorted] === undefined) {\n                mapping[sorted] = [str];\n            } else {\n                mapping[sorted].push(str);\n            }\n        }\n        \n        var output = [];\n        for (var arr in mapping) {\n            output.push(mapping[arr]);\n        }\n        \n        return output;\n    };
['JavaScript']