From 139eb74a6c60269974aa608ecddb52088bc71ff7 Mon Sep 17 00:00:00 2001 From: Filipe Quintanilha Date: Fri, 28 Oct 2022 12:57:21 -0300 Subject: [PATCH] feat(isAnagram): desenvolvimento da funcao --- 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..d34e381 100644 --- a/08-isAnagram/index.js +++ b/08-isAnagram/index.js @@ -1,4 +1,7 @@ export function isAnagram(word1, word2) { // implementar logica aqui - + const organiza = str => + str.toLowerCase().split('').sort().join(''); + + return organiza(word1) === organiza(word2); } \ No newline at end of file