From 74f51d23177af309aaef3b3f3347371caaa26d77 Mon Sep 17 00:00:00 2001 From: Nathalia Sardou Date: Sun, 30 Oct 2022 00:21:23 -0300 Subject: [PATCH] fibonacci atualizado --- 04-fibonacci/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/04-fibonacci/index.js b/04-fibonacci/index.js index 37c64cc..b12e4f8 100644 --- a/04-fibonacci/index.js +++ b/04-fibonacci/index.js @@ -1,4 +1,5 @@ export function fibonacci(value) { // implementar logica aqui - -} \ No newline at end of file + if (value < 2) return value; + return fibonacci(value - 1) + fibonacci(value - 2); +}