08-resolvido

This commit is contained in:
Emilly Schuenck de Lima 2022-11-01 14:48:48 -03:00
parent b90ee42bb6
commit d6eb8289d7

View File

@ -1,4 +1,12 @@
export function isAnagram(word1, word2) { export function isAnagram(word1, word2) {
// implementar logica aqui // implementar logica aqui
if (word1.length != word2.length){
return false;
}
let str1 = word1.toUpperCase().split("").sort().join("");
let str2 = word2.toUpperCase().split("").sort().join("");
let resultado = str1 === str2
return resultado;
} }