From aaf3badf7ba2807b4c405ccc20be315902671ba7 Mon Sep 17 00:00:00 2001 From: Bernardo Waldhelm Date: Fri, 28 Oct 2022 13:44:45 -0300 Subject: [PATCH] feat(fibonacci): adicionando resolucao desfaio 4 fibonacci --- 04-fibonacci/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/04-fibonacci/index.js b/04-fibonacci/index.js index 37c64cc..7348d46 100644 --- a/04-fibonacci/index.js +++ b/04-fibonacci/index.js @@ -1,4 +1,9 @@ export function fibonacci(value) { // implementar logica aqui - + if (value <= 1) { + return value; + } + + const resultado = fibonacci(value - 1) + fibonacci(value - 2); + return resultado; } \ No newline at end of file