javascript 7 line solution using Primes beats 99.8% without sorting
``\n/**\n * @param {string[]} strs\n * @return {string[][]}\n *\n * key point: \n * prime multiply prime is unique, each char canbe represented by a prime\n * s
```\n/**\n * @param {string[]} strs\n * @return {string[][]}\n *\n * key point: \n * prime multiply prime is unique, each char canbe represented by a prime\n * since [a-z] to  [0-25]\n * use `[charCodeAt() - 97]` to get unique index from the prime array\n * the prodcut can be set to the key name "prod"\n **/\n    var groupAnagrams = function (strs) {\n      const map = {};\n      const primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101];\n      strs.forEach(str => {\n        let prod = str.split("").reduce((r, c) => r * primes[c.charCodeAt() - 97], 1);\n        map[prod] ? map[prod].push(str) : map[prod] = [str];\n      });\n      return Object.values(map);\n    };
['JavaScript']