How To Group Anagrams Problem In Javascript