From c0b30c28d801930d319e486c2b684a7034a325ba Mon Sep 17 00:00:00 2001 From: Izabela Balizardo Date: Sat, 29 Oct 2022 19:01:28 -0300 Subject: [PATCH] feat: Adiciona 04-fibonacci --- 04-fibonacci/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/04-fibonacci/index.js b/04-fibonacci/index.js index 37c64cc..1feb194 100644 --- a/04-fibonacci/index.js +++ b/04-fibonacci/index.js @@ -1,4 +1,9 @@ export function fibonacci(value) { // implementar logica aqui - -} \ No newline at end of file + + if (value === 0 || value === 1) { + return value; + } else { + return fibonacci(value - 1) + fibonacci(value - 2); + } +}