diff --git a/08-isAnagram/index.js b/08-isAnagram/index.js index 918308a..4bf1e35 100644 --- a/08-isAnagram/index.js +++ b/08-isAnagram/index.js @@ -1,4 +1,11 @@ export function isAnagram(word1, word2) { // implementar logica aqui - + const palavra = str => + str + .toLowerCase() + .replace(/[^a-z0-9]/, '') + .split('') + .sort() + .join(''); +return palavra(word1) === palavra(word2); } \ No newline at end of file