Fun With Anagrams Hackerrank Solution Javascript