forked from M3-Academy/challenge-algorithms-v2.0
18 lines
382 B
JavaScript
18 lines
382 B
JavaScript
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;
|
|
}
|
|
|
|
} |