2022-10-27 15:07:13 +00:00
|
|
|
export function isAnagram(word1, word2) {
|
|
|
|
// implementar logica aqui
|
2022-11-02 12:15:12 +00:00
|
|
|
if (word1.length != word2.length) {
|
|
|
|
return false
|
|
|
|
} else {
|
|
|
|
const string1 = word1.toLowerCase().split("").sort().join("");
|
|
|
|
const string2 = word2.toLowerCase().split("").sort().join("");
|
|
|
|
|
|
|
|
if (string1 === string2) {
|
|
|
|
return true
|
|
|
|
} else {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
2022-10-27 15:07:13 +00:00
|
|
|
}
|