feat: implementa função isAnagram #8

Merged
RodrigoJorge merged 1 commits from feature/isAnagram into development 2022-10-28 19:44:14 +00:00

View File

@ -1,4 +1,18 @@
export function isAnagram(word1, word2) {
// implementar logica aqui
let original = word1.toLowerCase();
let original2 = original.split("");
let original3 = original2.sort().join("");
let teste = word2.toLowerCase();
let teste2 = teste.split("");
let teste3 = teste2.sort().join("");
if(original3 == teste3){
return true;
}
else{
return false;
}
}