diff --git a/08-isAnagram/index.js b/08-isAnagram/index.js index 918308a..7dd2b77 100644 --- a/08-isAnagram/index.js +++ b/08-isAnagram/index.js @@ -1,4 +1,13 @@ export function isAnagram(word1, word2) { // implementar logica aqui - + let array = word1.toLowerCase().split('').sort(); + let array2 = word2.toLowerCase().split('').sort(); + + if (word1.length !== word2.length) { + return false; + } else { + if (array.toString() === array2.toString()) { + return true; + } else return false; + } } \ No newline at end of file