From 642f731562b2d5e229673353b3d74717a9e6f841 Mon Sep 17 00:00:00 2001 From: Emmanuel Vitor Date: Mon, 31 Oct 2022 13:54:53 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20cria=20algoritmo=20que=20retorne=20se?= =?UTF-8?q?=20um=20palavra=20=C3=A9=20anagram=20da=20outra.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 08-isAnagram/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/08-isAnagram/index.js b/08-isAnagram/index.js index 918308a..402e610 100644 --- a/08-isAnagram/index.js +++ b/08-isAnagram/index.js @@ -1,4 +1,8 @@ export function isAnagram(word1, word2) { // implementar logica aqui - + + let newWord = word1.toLowerCase().split("").sort().join(); + let newWord2 = word2.toLowerCase().split("").sort().join(); + + return (newWord === newWord2) ? true : false; } \ No newline at end of file