"Any word or phrase that exactly reproduces the letters in another order is an anagram." (Wikipedia). Add numbers to this definition to be more interest.
Examples of anagrams:
William Shakespeare = I am a weakish speller
silent = listen
12345 = 54321
<span style="font-size:18px;color:#ff0000;">function isAnagram(test, original){
var normalize = function(e){
return e.replace(/[^\w]/g,'').toLowerCase().split('').sort().join('');
};
return normalize(test) === normalize(original);
}</span>