functiongroupAnagrams(words) {constmap= {};for (let i =0; i <words.length; i++) {constword= words[i];constsorted= [...word].sort().join('');if (map[sorted] ===undefined) map[sorted] = []; map[sorted].push(word); }returnObject.values(map);}// Do not edit the line below.exports.groupAnagrams = groupAnagrams;