anagram in JS