From 9861989bed8cd19fa21c84dfc3e4113174b543a8 Mon Sep 17 00:00:00 2001 From: Nicolly Vieira Date: Fri, 28 Oct 2022 15:07:47 -0300 Subject: [PATCH] feat(isAnagram): funcao feita --- 08-isAnagram/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/08-isAnagram/index.js b/08-isAnagram/index.js index 918308a..4e473ec 100644 --- a/08-isAnagram/index.js +++ b/08-isAnagram/index.js @@ -1,4 +1,7 @@ export function isAnagram(word1, word2) { // implementar logica aqui - + let primeiraString = word1.toLowerCase().split('').sort().join(''); + let segundaString = word2.toLowerCase().split('').sort().join(''); + + return primeiraString === segundaString ? true : false; } \ No newline at end of file