js: anagram: flipping things around