forked from M3-Academy/challenge-algorithms-v2.0
11 lines
290 B
JavaScript
11 lines
290 B
JavaScript
export function isAnagram(word1, word2) {
|
|
// implementar logica aqui
|
|
if (word1.length !== word2.length) {
|
|
return false
|
|
} else {
|
|
word1 = word1.toUpperCase().split("").sort().join("");
|
|
word2 = word2.toUpperCase().split("").sort().join("");
|
|
return word1 === word2;
|
|
}
|
|
|
|
} |