From b623b716a9dd5d085bb229175ad3bf586c47aad7 Mon Sep 17 00:00:00 2001 From: devartes Date: Fri, 28 Oct 2022 08:18:37 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20adicionando=20solu=C3=A7=C3=A3o=20do=20?= =?UTF-8?q?4=C2=B0=20desafio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 04-fibonacci/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/04-fibonacci/index.js b/04-fibonacci/index.js index 37c64cc..bbdc320 100644 --- a/04-fibonacci/index.js +++ b/04-fibonacci/index.js @@ -1,4 +1,5 @@ export function fibonacci(value) { // implementar logica aqui - + var sqrt5 = Math.sqrt(5); + return Math.round(Math.pow(((1 + sqrt5) / 2), value) / sqrt5); } \ No newline at end of file