From 2c23f938b60251a00120a5d3ee1adda874d55545 Mon Sep 17 00:00:00 2001 From: Rafael Sampaio Date: Fri, 28 Oct 2022 10:55:14 -0300 Subject: [PATCH] feat: solucao isAnagram --- 08-isAnagram/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/08-isAnagram/index.js b/08-isAnagram/index.js index 918308a..241bc1f 100644 --- a/08-isAnagram/index.js +++ b/08-isAnagram/index.js @@ -1,4 +1,11 @@ export function isAnagram(word1, word2) { // implementar logica aqui - -} \ No newline at end of file + let str1 = word1.toLowerCase().split("").sort().join(""); + let str2 = word2.toLowerCase().split("").sort().join(""); + + if (str1 === str2) { + return true; + } else { + return false; + } +} -- 2.34.1