From 3781d8d204d0f21f2ac8ebb8bfde3687bd6907d3 Mon Sep 17 00:00:00 2001 From: Luiz Felipe Silva Date: Mon, 31 Oct 2022 22:32:53 -0300 Subject: [PATCH] feat(isAnagram): algoritmo criado. --- 08-isAnagram/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/08-isAnagram/index.js b/08-isAnagram/index.js index 918308a..8fb140e 100644 --- a/08-isAnagram/index.js +++ b/08-isAnagram/index.js @@ -1,4 +1,8 @@ export function isAnagram(word1, word2) { // implementar logica aqui + let array1 = word1.toLowerCase().split('').sort(); + let array2 = word2.toLowerCase().split('').sort(); + if(array1.join() === array2.join()) return true; + else return false; } \ No newline at end of file -- 2.34.1