From 65facdebcb011ecdc7e07cecef110e5ba96429ec Mon Sep 17 00:00:00 2001 From: Caroline Moran Date: Fri, 28 Oct 2022 08:51:31 -0400 Subject: [PATCH] fix(fibonacci): muda var para let --- 04-fibonacci/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/04-fibonacci/index.js b/04-fibonacci/index.js index 818b908..d3ec854 100644 --- a/04-fibonacci/index.js +++ b/04-fibonacci/index.js @@ -1,13 +1,13 @@ export function fibonacci(value) { // implementar logica aqui - var penultimo = 0, + let penultimo = 0, ultimo = 1; - var numero; + let numero; let arr = []; if (value < 2) { return value; } else { - for (var count = 2; count <= value; count++) { + for (let count = 2; count <= value; count++) { numero = ultimo + penultimo; penultimo = ultimo; ultimo = numero;