Put the TypeScript code in order
function groupAnagrams(strs: string[]): string[][] { const key = s.split('').sort().join(''); for (const s of strs) { map.get(key)!.push(s); } return Array.from(map.values()); const map = new Map<string, string[]>(); if (!map.has(key)) map.set(key, []);}