Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

anagram checker javascript

function anagrams(stringA, stringB) {
    return cleanString(stringA) === cleanString(stringB);
}

function cleanString(str) {
    return str.replace(/[^w]/g).toLowerCase().split('').sort().join()
}   

anagrams('monk','konm')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #anagram #checker #javascript
ADD COMMENT
Topic
Name
3+5 =