From 3c9a57e29d7f24aa24ab7067ce43bc1169ea6f15 Mon Sep 17 00:00:00 2001 From: Vinicius Date: Tue, 8 Nov 2022 18:34:51 -0200 Subject: [PATCH] bugfix: declara i e transforma string em booleano --- 04-fibonacci/index.js | 1 + 05-isPrime/index.js | 4 ++-- 08-isAnagram/index.js | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/04-fibonacci/index.js b/04-fibonacci/index.js index 0131f9a..6da1bbb 100644 --- a/04-fibonacci/index.js +++ b/04-fibonacci/index.js @@ -1,6 +1,7 @@ export function fibonacci(value) { // implementar logica aqui let f = []; + let n = 2; f[0] = 0; f[1] = 1; for (n = 2; n <= value; n++) { diff --git a/05-isPrime/index.js b/05-isPrime/index.js index b24fc68..16e754d 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -18,8 +18,8 @@ export function isPrime(value) { value % 7 != 0 && value % 11 != 0 && value % 13 != 0 - ? "true" - : "false"; + ? true + : false; } return primo; } diff --git a/08-isAnagram/index.js b/08-isAnagram/index.js index 3c03f12..b46b4af 100644 --- a/08-isAnagram/index.js +++ b/08-isAnagram/index.js @@ -3,15 +3,16 @@ export function isAnagram(word1, word2) { let par_1 = word1.toLowerCase().split("").sort(); let par_2 = word2.toLowerCase().split("").sort(); let final; + let i = 0; if (par_1.length != par_2.length) { - final = "false"; + final = false; } else { for (i in par_1) { if (par_1[i] != par_2[i]) { - final = "false"; + final = false; break; } else { - final = "true"; + final = true; } } }