feature/algoritmo #11

Merged
ManuelaLuanaSchumackerTavares merged 21 commits from feature/algoritmo into master 2022-10-31 17:24:28 +00:00
Showing only changes of commit 6f25a0e147 - Show all commits

View File

@ -1,4 +1,11 @@
export function isAnagram(word1, word2) { export function isAnagram(word1, word2) {
// implementar logica aqui // implementar logica aqui
const palavra = str =>
str
.toLowerCase()
.replace(/[^a-z0-9]/, '')
.split('')
.sort()
.join('');
return palavra(word1) === palavra(word2);
} }