From cf7023cb7e2fb757df2976b4570f7d6d57d120b2 Mon Sep 17 00:00:00 2001 From: Rhayllon Date: Sat, 29 Oct 2022 04:07:37 -0300 Subject: [PATCH] Feat(Desafio_2.4): Cria resposta desafio 2.4 --- 04-fibonacci/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/04-fibonacci/index.js b/04-fibonacci/index.js index 37c64cc..34e2e43 100644 --- a/04-fibonacci/index.js +++ b/04-fibonacci/index.js @@ -1,4 +1,7 @@ export function fibonacci(value) { // implementar logica aqui - -} \ No newline at end of file + if(value <= 1){ + return value + } + return fibonacci(value - 1) + fibonacci(value - 2) +}