diff --git a/08-isAnagram/index.js b/08-isAnagram/index.js index 918308a..46c6e30 100644 --- a/08-isAnagram/index.js +++ b/08-isAnagram/index.js @@ -1,4 +1,14 @@ export function isAnagram(word1, word2) { // implementar logica aqui - -} \ No newline at end of file + if (word1.length === word2.length) { + let word1Lower = word1.toLowerCase().split("").sort(); + let word2Lower = word2.toLowerCase().split("").sort(); + if (word1Lower.join() == word2Lower.join()) { + return true; + } else { + return false; + } + } else { + return false; + } +}