forked from M3-Academy/challenge-algorithms-v2.0
12 lines
244 B
JavaScript
12 lines
244 B
JavaScript
export function isAnagram(word1, word2) {
|
|
// implementar logica aqui
|
|
return putOnUnicodeOrder(word1) === putOnUnicodeOrder(word2);
|
|
}
|
|
|
|
function putOnUnicodeOrder(string){
|
|
return string
|
|
.toLowerCase()
|
|
.split("")
|
|
.sort()
|
|
.join("");
|
|
} |