From 2d18f109e10b257b14b3319cb8ba1ef262bae9b3 Mon Sep 17 00:00:00 2001 From: Eleonora Otz Date: Fri, 28 Oct 2022 16:41:45 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20Soluciona=20o=20exerc=C3=ADcio=2008=20-?= =?UTF-8?q?=20Is=20anagram?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 08-isAnagram/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/08-isAnagram/index.js b/08-isAnagram/index.js index 918308a..160191a 100644 --- a/08-isAnagram/index.js +++ b/08-isAnagram/index.js @@ -1,4 +1,11 @@ export function isAnagram(word1, word2) { // implementar logica aqui - + word1 = word1.toUpperCase().split('').sort().join('') + word2 = word2.toUpperCase().split('').sort().join('') + + if(word1 === word2){ + return true; + } else { + return false; + } } \ No newline at end of file