adding nodeJS version of anagrams