From 7119baa058624e5bba512ddecd2fc2c5e7face33 Mon Sep 17 00:00:00 2001 From: edumoreira1506 Date: Tue, 10 Sep 2019 14:27:01 -0300 Subject: [PATCH] Shore refacto --- src/algorithms/math/tribonacci/tribonacci.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/algorithms/math/tribonacci/tribonacci.js b/src/algorithms/math/tribonacci/tribonacci.js index 6e566ab5..100949ed 100644 --- a/src/algorithms/math/tribonacci/tribonacci.js +++ b/src/algorithms/math/tribonacci/tribonacci.js @@ -6,13 +6,12 @@ */ export default function tribonacci(n) { const tribSequence = [0]; - let currentValue = 0; if (n >= 2) { - tribSequence.push(currentValue); + tribSequence.push(0); } - currentValue += 1; + let currentValue = 1; for (let i = 2; i < n; i += 1) { tribSequence.push(currentValue);